Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker entrypoint, start.sh #1891

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ EXPOSE 8545
EXPOSE 8546
EXPOSE 9090
EXPOSE 26657
EXPOSE 9091
EXPOSE 9091
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
### CI

* [1867](https://github.com/zeta-chain/node/pull/1867) - default restore_type for full node docker-compose to snapshot instead of statesync for reliability.
* [1891](https://github.com/zeta-chain/node/pull/1891) - fix typo that was introduced to docker-compose and a typo in start.sh for the docker start script for full nodes.

## Version: v14

Expand Down
8 changes: 4 additions & 4 deletions contrib/athens3/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# build:
# context: ../../..
# dockerfile: Dockerfile
image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14}
image: zetachain/zetacored:${DOCKER_TAG:-v14.0.1}
environment:
DAEMON_HOME: "/root/.zetacored"
NETWORK: athens3
Expand Down Expand Up @@ -35,8 +35,8 @@ services:
- "9090:9090"
- "9091:9091"
volumes:
- zetacored_data:/root/.zetacored/
entrypoint: bash /scripts/start-zetae2e.sh
- zetacored_data_athens3:/root/.zetacored/
entrypoint: bash /scripts/start.sh

volumes:
zetacored_data:
zetacored_data_athens3:
89 changes: 45 additions & 44 deletions contrib/docker-scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@ logt() {
echo "$(date '+%Y-%m-%d %H:%M:%S') $1"
}


function load_defaults {
#DEFAULT: Mainnet Statesync.
export DAEMON_HOME=${DAEMON_HOME:=/root/.zetacored}
export NETWORK=${NETWORK:=mainnet}
export RESTORE_TYPE=${RESTORE_TYPE:=statesync}
export SNAPSHOT_API=${SNAPSHOT_API:=https://snapshots.zetachain.com}
export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=${TRUST_HEIGHT_DIFFERENCE_STATE_SYNC:=40000}
export COSMOVISOR_VERSION=${COSMOVISOR_VERSION:=v1.5.0}
export CHAIN_ID=${CHAIN_ID:=zetachain_7000-1}
export COSMOVISOR_CHECKSUM=${COSMOVISOR_CHECKSUM:=626dfc58c266b85f84a7ed8e2fe0e2346c15be98cfb9f9b88576ba899ed78cdc}
export VISOR_NAME=${VISOR_NAME:=cosmovisor}
export DAEMON_NAME=${DAEMON_NAME:=zetacored}
export DAEMON_ALLOW_DOWNLOAD_BINARIES=${DAEMON_ALLOW_DOWNLOAD_BINARIES:=false}
export DAEMON_RESTART_AFTER_UPGRADE=${DAEMON_RESTART_AFTER_UPGRADE:=true}
export UNSAFE_SKIP_BACKUP=${UNSAFE_SKIP_BACKUP:=true}
export CLIENT_DAEMON_NAME=${CLIENT_DAEMON_NAME:=zetaclientd}
export CLIENT_DAEMON_ARGS=${CLIENT_DAEMON_ARGS:""}
export CLIENT_SKIP_UPGRADE=${CLIENT_SKIP_UPGRADE:=true}
export CLIENT_START_PROCESS=${CLIENT_START_PROCESS:=false}
export MONIKER=${MONIKER:=local-test}
export RE_DO_START_SEQUENCE=${RE_DO_START_SEQUENCE:=false}

#ATHENS3
export BINARY_LIST_ATHENS3=${BINARY_LIST_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/binary_list.json}
export STATE_SYNC_RPC_NODE_FILE_ATHENS3=${STATE_SYNC_RPC_NODE_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/state_sync_node}
export RPC_STATE_SYNC_RPC_LIST_FILE_ATHENS3=${RPC_STATE_SYNC_RPC_LIST_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/rpc_state_sync_nodes}
export APP_TOML_FILE_ATHENS3=${APP_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/app.toml}
export CONFIG_TOML_FILE_ATHENS3=${CONFIG_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/config.toml}
export CLIENT_TOML_FILE_ATHENS3=${CLIENT_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/client.toml}
export GENESIS_FILE_ATHENS3=${GENESIS_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/genesis.json}

#MAINNET
export BINARY_LIST_MAINNET=${BINARY_LIST_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/binary_list.json}
export STATE_SYNC_RPC_NODE_FILE_MAINNET=${STATE_SYNC_RPC_NODE_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/state_sync_node}
export RPC_STATE_SYNC_RPC_LIST_FILE_MAINNET=${RPC_STATE_SYNC_RPC_LIST_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/rpc_state_sync_nodes}
export APP_TOML_FILE_MAINNET=${APP_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/app.toml}
export CONFIG_TOML_FILE_MAINNET=${CONFIG_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/config.toml}
export CLIENT_TOML_FILE_MAINNET=${CLIENT_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/client.toml}
export GENESIS_FILE_MAINNET=${GENESIS_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/genesis.json}

}

function init_chain {
if [ -d "${DAEMON_HOME}/config" ]; then
logt "${DAEMON_NAME} home directory already initialized."
Expand Down Expand Up @@ -193,55 +236,14 @@ function move_zetacored_binaries {
}

function start_network {
${VISOR_NAME} version
${VISOR_NAME} run start --home ${DAEMON_HOME} \
--log_level info \
--moniker ${MONIKER} \
--rpc.laddr tcp://0.0.0.0:26657 \
--minimum-gas-prices 1.0azeta "--grpc.enable=true"
}

function load_defaults {
#DEFAULT: Mainnet Statesync.
export DAEMON_HOME=${DAEMON_HOME:=/root/.zetacored}
export NETWORK=${NETWORK:=mainnet}
export RESTORE_TYPE=${RESTORE_TYPE:=statesync}
export SNAPSHOT_API=${SNAPSHOT_API:=https://snapshots.zetachain.com}
export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=${TRUST_HEIGHT_DIFFERENCE_STATE_SYNC:=40000}
export COSMOVISOR_VERSION=${COSMOVISOR_VERSION:=v1.5.0}
export CHAIN_ID=${CHAIN_ID:=zetachain_7000-1}
export COSMOVISOR_CHECKSUM=${COSMOVISOR_CHECKSUM:=626dfc58c266b85f84a7ed8e2fe0e2346c15be98cfb9f9b88576ba899ed78cdc}
export VISOR_NAME=${VISOR_NAME:=cosmovisor}
export DAEMON_NAME=${DAEMON_NAME:=zetacored}
export DAEMON_ALLOW_DOWNLOAD_BINARIES=${DAEMON_ALLOW_DOWNLOAD_BINARIES:=false}
export DAEMON_RESTART_AFTER_UPGRADE=${DAEMON_RESTART_AFTER_UPGRADE:=true}
export UNSAFE_SKIP_BACKUP=${UNSAFE_SKIP_BACKUP:=true}
export CLIENT_DAEMON_NAME=${CLIENT_DAEMON_NAME:=zetaclientd}
export CLIENT_DAEMON_ARGS=${CLIENT_DAEMON_ARGS:""}
export CLIENT_SKIP_UPGRADE=${CLIENT_SKIP_UPGRADE:=true}
export CLIENT_START_PROCESS=${CLIENT_START_PROCESS:=false}
export MONIKER=${MONIKER:=local-test}
export RE_DO_START_SEQUENCE=${RE_DO_START_SEQUENCE:=false}

#ATHENS3
export BINARY_LIST_ATHENS3=${BINARY_LIST_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/binary_list.json}
export STATE_SYNC_RPC_NODE_FILE_ATHENS3=${STATE_SYNC_RPC_NODE_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/state_sync_node}
export RPC_STATE_SYNC_RPC_LIST_FILE_ATHENS3=${RPC_STATE_SYNC_RPC_LIST_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/rpc_state_sync_nodes}
export APP_TOML_FILE_ATHENS3=${APP_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/app.toml}
export CONFIG_TOML_FILE_ATHENS3=${CONFIG_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/config.toml}
export CLIENT_TOML_FILE_ATHENS3=${CLIENT_TOML_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/client.toml}
export GENESIS_FILE_ATHENS3=${GENESIS_FILE_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3/genesis.json}

#MAINNET
export BINARY_LIST_MAINNET=${BINARY_LIST_ATHENS3:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/binary_list.json}
export STATE_SYNC_RPC_NODE_FILE_MAINNET=${STATE_SYNC_RPC_NODE_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/state_sync_node}
export RPC_STATE_SYNC_RPC_LIST_FILE_MAINNET=${RPC_STATE_SYNC_RPC_LIST_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/rpc_state_sync_nodes}
export APP_TOML_FILE_MAINNET=${APP_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/app.toml}
export CONFIG_TOML_FILE_MAINNET=${CONFIG_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/config.toml}
export CLIENT_TOML_FILE_MAINNET=${CLIENT_TOML_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/client.toml}
export GENESIS_FILE_MAINNET=${GENESIS_FILE_MAINNET:=https://raw.githubusercontent.com/zeta-chain/network-config/main/mainnet/genesis.json}

}

logt "Load Default Values for ENV Vars if not set."
load_defaults

Expand Down Expand Up @@ -296,5 +298,4 @@ else

logt "Start Network"
start_network
fi

fi
8 changes: 4 additions & 4 deletions contrib/mainnet/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# build:
# context: ../../..
# dockerfile: Dockerfile
image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14}
image: zetachain/zetacored:${DOCKER_TAG:-v14.0.1}
container_name: zetachain_mainnet_rpc
environment:
DAEMON_HOME: "/root/.zetacored"
Expand Down Expand Up @@ -36,10 +36,10 @@ services:
- "9090:9090"
- "9091:9091"
volumes:
- zetacored_data:/root/.zetacored/
entrypoint: bash /scripts/start-zetae2e.sh
- zetacored_data_mainnet:/root/.zetacored/
entrypoint: bash /scripts/start.sh
#for debugging
#entrypoint: ["/bin/sh", "-c"]
#command: ["while true; do sleep 86400; done"]
volumes:
zetacored_data:
zetacored_data_mainnet:
Loading