diff --git a/Dockerfile b/Dockerfile index dc68ba89c1..f354004c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,15 +24,23 @@ RUN make install # Run Stage FROM alpine:3.18 +ENV COSMOVISOR_CHECKSUM="626dfc58c266b85f84a7ed8e2fe0e2346c15be98cfb9f9b88576ba899ed78cdc" +ENV COSMOVISOR_VERSION="v1.5.0" # Copy Start Script Helpers COPY contrib/docker-scripts/* /scripts/ # Install runtime dependencies -RUN apk --no-cache add git jq bash curl python3 libusb-dev linux-headers make build-base wget py3-pip qemu-img qemu-system-x86_64 && \ +RUN apk --no-cache add git jq bash curl nano vim tmux python3 libusb-dev linux-headers make build-base bind-tools psmisc coreutils wget py3-pip qemu-img qemu-system-x86_64 && \ pip install requests && \ chmod a+x -R /scripts && \ wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.31-r0/glibc-2.31-r0.apk && \ - apk add --force-overwrite --allow-untrusted glibc-2.31-r0.apk + apk add --force-overwrite --allow-untrusted glibc-2.31-r0.apk && \ + curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz && \ + mkdir -p /usr/local/gcloud && \ + tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz && \ + /usr/local/gcloud/google-cloud-sdk/install.sh --quiet && \ + ln -s /usr/local/gcloud/google-cloud-sdk/bin/gcloud /usr/bin/gcloud && \ + python /scripts/install_cosmovisor.py # Copy the binaries from the build stage COPY --from=builder /go/bin/zetaclientd /usr/local/bin/zetaclientd diff --git a/changelog.md b/changelog.md index db924b3ee5..9d615c4f01 100644 --- a/changelog.md +++ b/changelog.md @@ -38,6 +38,10 @@ * [1814](https://github.com/zeta-chain/node/pull/1814) - fix code coverage ignore for protobuf generated files +### 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. + ## Version: v14 - [1817](https://github.com/zeta-chain/node/pull/1817) - Add migration script to fix pending and chain nonces on testnet diff --git a/contrib/athens3/zetacored/docker-compose.yml b/contrib/athens3/zetacored/docker-compose.yml index 6db48703d2..0332b9482b 100644 --- a/contrib/athens3/zetacored/docker-compose.yml +++ b/contrib/athens3/zetacored/docker-compose.yml @@ -11,12 +11,10 @@ services: DAEMON_HOME: "/root/.zetacored" NETWORK: athens3 #RESTORE_TYPE=snapshot/snapshot-archive/statesync - RESTORE_TYPE: "statesync" + RESTORE_TYPE: "snapshot" SNAPSHOT_API: https://snapshots.zetachain.com TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - COSMOVISOR_VERSION: "v1.5.0" CHAIN_ID: "athens_7001-1" - COSMOVISOR_CHECKSUM: "626dfc58c266b85f84a7ed8e2fe0e2346c15be98cfb9f9b88576ba899ed78cdc" VISOR_NAME: "cosmovisor" DAEMON_NAME: "zetacored" DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index e235bc30ce..b9ea1b482b 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -41,7 +41,7 @@ function download_configs { function setup_restore_type { if [ "${RESTORE_TYPE}" == "statesync" ]; then - logt "Statesync restore. Download state sync rpc address from network-config." + logt "Statesync restore. Download state sync rpc address from network-config" if [ "${NETWORK}" == "mainnet" ]; then logt "MAINNET STATE SYNC" logt "STATE_SYNC_RPC_NODE_FILE_MAINNET: ${STATE_SYNC_RPC_NODE_FILE_MAINNET}" @@ -77,7 +77,7 @@ function setup_restore_type { logt " Cleanup Snapshot" rm -rf ${SNAPSHOT_DIR}/${SNAPSHOT_FILENAME} elif [ "${NETWORK}" == "athens3" ]; then - SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-snapshot?network=athens3 | jq .latest_snapshot) + SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-snapshot?network=athens3 | jq -r .latest_snapshot) SNAPSHOT_FILENAME=$(basename "${SNAPSHOT_URL}") SNAPSHOT_DIR=$(pwd) logt "Download Snapshot from url: ${SNAPSHOT_URL}" @@ -91,7 +91,7 @@ function setup_restore_type { elif [ "${RESTORE_TYPE}" == "snapshot-archive" ]; then if [ "${NETWORK}" == "mainnet" ]; then logt "Get Latest Snapshot URL" - SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-archive-snapshot?network=mainnet | jq .latest_snapshot) + SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-archive-snapshot?network=mainnet | jq -r .latest_snapshot) SNAPSHOT_FILENAME=$(basename "${SNAPSHOT_URL}") SNAPSHOT_DIR=$(pwd) logt "Download Snapshot from url: ${SNAPSHOT_URL}" @@ -102,7 +102,7 @@ function setup_restore_type { logt " Cleanup Snapshot" rm -rf ${SNAPSHOT_DIR}/${SNAPSHOT_FILENAME} elif [ "${NETWORK}" == "athens3" ]; then - SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-archive-snapshot?network=athens3 | jq .latest_snapshot) + SNAPSHOT_URL=$(curl -s ${SNAPSHOT_API}/latest-archive-snapshot?network=athens3 | jq -r .latest_snapshot) SNAPSHOT_FILENAME=$(basename "${SNAPSHOT_URL}") SNAPSHOT_DIR=$(pwd) logt "Download Snapshot from url: ${SNAPSHOT_URL}" @@ -148,6 +148,7 @@ function change_config_values { logt "EXTERNAL_IP: ${EXTERNAL_IP}" logt "SED Change Config Files." sed -i -e "s/^enable = .*/enable = \"true\"/" ${DAEMON_HOME}/config/config.toml + sed '/^\[statesync\]/,/^\[/ s/enable = "true"/enable = "false"/' ${DAEMON_HOME}/config/config.toml sed -i -e "s/^moniker = .*/moniker = \"${MONIKER}\"/" ${DAEMON_HOME}/config/config.toml sed -i -e "s/^external_address = .*/external_address = \"${EXTERNAL_IP}:26656\"/" ${DAEMON_HOME}/config/config.toml fi @@ -162,18 +163,6 @@ function setup_basic_keyring { fi } -function install_dependencies { - apt-get update - apt-get install nano jq python3 -y - pip3 install requests -} - -function download_cosmovisor { - mkdir -p ${DAEMON_HOME}/cosmovisor/ - mkdir -p ${DAEMON_HOME}/cosmovisor/upgrades/ - python3 /scripts/install_cosmovisor.py -} - function download_binary_version { if [ "${NETWORK}" == "mainnet" ]; then wget -q ${BINARY_LIST_MAINNET} @@ -268,9 +257,6 @@ if [[ -f "${DAEMON_HOME}/start_sequence_status" ]] && grep -q "START_SEQUENCE_CO logt "Modify Chain Configs" change_config_values - logt "Download Cosmosvisor." - download_cosmovisor - logt "Move Zetacored Binaries." move_zetacored_binaries @@ -293,9 +279,6 @@ else logt "Download Configs" download_configs - logt "Download Cosmovisor" - download_cosmovisor - logt "Download Historical Binaries" download_binary_version diff --git a/contrib/mainnet/zetacored/docker-compose.yml b/contrib/mainnet/zetacored/docker-compose.yml index 6df2a17616..d5fde8deda 100644 --- a/contrib/mainnet/zetacored/docker-compose.yml +++ b/contrib/mainnet/zetacored/docker-compose.yml @@ -12,12 +12,10 @@ services: DAEMON_HOME: "/root/.zetacored" NETWORK: mainnet #RESTORE_TYPE=snapshot/snapshot-archive/statesync - RESTORE_TYPE: "statesync" + RESTORE_TYPE: "snapshot" SNAPSHOT_API: https://snapshots.zetachain.com TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - COSMOVISOR_VERSION: "v1.5.0" CHAIN_ID: "zetachain_7000-1" - COSMOVISOR_CHECKSUM: "626dfc58c266b85f84a7ed8e2fe0e2346c15be98cfb9f9b88576ba899ed78cdc" VISOR_NAME: "cosmovisor" DAEMON_NAME: "zetacored" DAEMON_ALLOW_DOWNLOAD_BINARIES: "false"