From 91d5f3f1ad2b1e648e20ae7376cd286c59bbc1f2 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 16:50:48 -0600 Subject: [PATCH] updated with latest changes, will fix the version issue when building locally --- Makefile | 28 +++++++++++++- .../zetacored-localbuild/docker-compose.yml | 5 ++- contrib/athens3/zetacored/docker-compose.yml | 5 ++- contrib/docker-scripts/start.sh | 38 ++++++++++++++++--- .../zetacored-localbuild/docker-compose.yml | 4 +- contrib/mainnet/zetacored/docker-compose.yml | 5 ++- 6 files changed, 70 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index a5b439b4da..13c3a9df19 100644 --- a/Makefile +++ b/Makefile @@ -294,11 +294,35 @@ mainnet-bitcoind-node: testnet-zetarpc-node: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up +mainnet-bitcoind-node-down: + cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + +testnet-zetarpc-node-down: + cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + +mainnet-bitcoind-node-down-clean: + cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + +testnet-zetarpc-node-down-clean: + cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + mainnet-zetarpc-node-local-dev: - cd contrib/mainnet/zetacored-localbuild && docker-compose up + cd contrib/mainnet/zetacored-localbuild && docker-compose up --build testnet-zetarpc-node-local-dev: - cd contrib/athens3/zetacored-localbuild && docker-compose up + cd contrib/athens3/zetacored-localbuild && docker-compose up --build + +mainnet-zetarpc-node-local-dev-down: + cd contrib/mainnet/zetacored-localbuild && docker-compose down + +testnet-zetarpc-node-local-dev-down: + cd contrib/athens3/zetacored-localbuild && docker-compose down + +mainnet-zetarpc-node-local-dev-down-clean: + cd contrib/mainnet/zetacored-localbuild && docker-compose down -v + +testnet-zetarpc-node-local-dev-down-cliean: + cd contrib/athens3/zetacored-localbuild && docker-compose down -v ############################################################################### ### Debug Tools ### diff --git a/contrib/athens3/zetacored-localbuild/docker-compose.yml b/contrib/athens3/zetacored-localbuild/docker-compose.yml index d92b35d443..cfe01da31b 100644 --- a/contrib/athens3/zetacored-localbuild/docker-compose.yml +++ b/contrib/athens3/zetacored-localbuild/docker-compose.yml @@ -8,7 +8,6 @@ services: environment: DAEMON_HOME: "/root/.zetacored" NETWORK: athens3 - #RESTORE_TYPE=snapshot/snapshot-archive/statesync RESTORE_TYPE: "snapshot" SNAPSHOT_API: https://snapshots.zetachain.com TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 @@ -22,8 +21,10 @@ services: CLIENT_DAEMON_ARGS: "" CLIENT_SKIP_UPGRADE: "true" CLIENT_START_PROCESS: "false" - MONIKER: athens3-local-rpc + MONIKER: testnet-docker-rpc + #If this is true it will erase everything and start over from scratch. RE_DO_START_SEQUENCE: "false" + #If this is true it will build the dockerfile and use binary from built docker file instead of remote docker image for local development testing on non-governance upgrades. IS_LOCAL_DEVELOPMENT: "true" ports: - "26656:26656" diff --git a/contrib/athens3/zetacored/docker-compose.yml b/contrib/athens3/zetacored/docker-compose.yml index 38df212770..3116f690d8 100644 --- a/contrib/athens3/zetacored/docker-compose.yml +++ b/contrib/athens3/zetacored/docker-compose.yml @@ -6,7 +6,6 @@ services: environment: DAEMON_HOME: "/root/.zetacored" NETWORK: athens3 - #RESTORE_TYPE=snapshot/snapshot-archive/statesync RESTORE_TYPE: "snapshot" SNAPSHOT_API: https://snapshots.zetachain.com TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 @@ -20,8 +19,10 @@ services: CLIENT_DAEMON_ARGS: "" CLIENT_SKIP_UPGRADE: "true" CLIENT_START_PROCESS: "false" - MONIKER: local-test + MONIKER: testnet-docker-rpc + #If this is true it will erase everything and start over from scratch. RE_DO_START_SEQUENCE: "false" + #If this is true it will build the dockerfile and use binary from built docker file instead of remote docker image for local development testing on non-governance upgrades. IS_LOCAL_DEVELOPMENT: "false" ports: - "26656:26656" diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index cb29691cab..39e8243d3c 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -238,13 +238,39 @@ function move_zetacored_binaries { function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored + rm -rf ${DAEMON_HOME}/cosmovisor/current/bin/zetacored + ln -s ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored ${DAEMON_HOME}/cosmovisor/current/bin/zetacored + fi + + EXPECTED_MAJOR_VERSION=$(grep 'const releaseVersion = ' $FILE_PATH | awk -F'"' '{print $2}') + + VISOR_VERSION=$(${VISOR_NAME} version) + DAEMON_VERSION=$(${DAEMON_NAME} version) + + VISOR_MAJOR_VERSION=$(echo $VISOR_VERSION | grep -o '^v[0-9]*') + DAEMON_MAJOR_VERSION=$(echo $DAEMON_VERSION | grep -o '^v[0-9]*') + + if [ "$VISOR_MAJOR_VERSION" != "$EXPECTED_MAJOR_VERSION" ] || [ "$DAEMON_MAJOR_VERSION" != "$EXPECTED_MAJOR_VERSION" ]; then + logt "One or both versions don't match the expected major release version: $EXPECTED_MAJOR_VERSION" + else + logt "Both versions match the expected major release version: $EXPECTED_MAJOR_VERSION" + fi + + if [ "$VISOR_VERSION" != "$DAEMON_VERSION" ]; then + logt "cosmovisor version doesn't appear to match your daemon version. Start ${DAEMON_NAME}" + ${DAEMON_NAME} 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" + else + logt "cosmovisor version match your daemon version. Start ${VISOR_NAME}" + ${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" fi - ${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" } logt "Load Default Values for ENV Vars if not set." diff --git a/contrib/mainnet/zetacored-localbuild/docker-compose.yml b/contrib/mainnet/zetacored-localbuild/docker-compose.yml index 25828a7376..bce18a6b80 100644 --- a/contrib/mainnet/zetacored-localbuild/docker-compose.yml +++ b/contrib/mainnet/zetacored-localbuild/docker-compose.yml @@ -22,8 +22,10 @@ services: CLIENT_DAEMON_ARGS: "" CLIENT_SKIP_UPGRADE: "true" CLIENT_START_PROCESS: "false" - MONIKER: local-test + MONIKER: mainnet-docker-rpc + #If this is true it will erase everything and start over from scratch. RE_DO_START_SEQUENCE: "false" + #If this is true it will build the dockerfile and use binary from built docker file instead of remote docker image for local development testing on non-governance upgrades. IS_LOCAL_DEVELOPMENT: "true" ports: - "26656:26656" diff --git a/contrib/mainnet/zetacored/docker-compose.yml b/contrib/mainnet/zetacored/docker-compose.yml index 06959b7cc1..753dfc6776 100644 --- a/contrib/mainnet/zetacored/docker-compose.yml +++ b/contrib/mainnet/zetacored/docker-compose.yml @@ -7,7 +7,6 @@ services: environment: DAEMON_HOME: "/root/.zetacored" NETWORK: mainnet - #RESTORE_TYPE=snapshot/snapshot-archive/statesync RESTORE_TYPE: "snapshot" SNAPSHOT_API: https://snapshots.zetachain.com TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 @@ -21,8 +20,10 @@ services: CLIENT_DAEMON_ARGS: "" CLIENT_SKIP_UPGRADE: "true" CLIENT_START_PROCESS: "false" - MONIKER: local-test + MONIKER: mainnet-docker-rpc + #If this is true it will erase everything and start over from scratch. RE_DO_START_SEQUENCE: "false" + #If this is true it will build the dockerfile and use binary from built docker file instead of remote docker image for local development testing on non-governance upgrades. IS_LOCAL_DEVELOPMENT: "false" ports: - "26656:26656"