From 321e6a58a00a4a33bd7ce69198e8337185d30859 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Tue, 23 Apr 2024 18:42:16 -0600 Subject: [PATCH 01/16] ci: added two new make commands for building working brances to test non-governance upgrades against a full node fully synced against testnet or mainnet --- Makefile | 8 +++- changelog.md | 1 + .../zetacored-localbuild/docker-compose.yml | 42 ++++++++++++++++++ contrib/athens3/zetacored/docker-compose.yml | 6 +-- contrib/docker-scripts/start.sh | 21 ++++++--- .../zetacored-localbuild/docker-compose.yml | 44 +++++++++++++++++++ contrib/mainnet/zetacored/docker-compose.yml | 10 +---- readme.md | 14 +++++- 8 files changed, 125 insertions(+), 21 deletions(-) create mode 100644 contrib/athens3/zetacored-localbuild/docker-compose.yml create mode 100644 contrib/mainnet/zetacored-localbuild/docker-compose.yml diff --git a/Makefile b/Makefile index 2cc2bf1d80..d3d97fe733 100644 --- a/Makefile +++ b/Makefile @@ -291,9 +291,15 @@ mainnet-zetarpc-node: mainnet-bitcoind-node: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose up -athens3-zetarpc-node: +testnet-zetarpc-node: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up +mainnet-zetarpc-node-local-dev: + cd contrib/mainnet/zetacored-localbuild && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + +testnet-zetarpc-node-local-dev: + cd contrib/athens3/zetacored-localbuild && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + ############################################################################### ### Debug Tools ### ############################################################################### diff --git a/changelog.md b/changelog.md index 19c08aebc9..4b4042538e 100644 --- a/changelog.md +++ b/changelog.md @@ -100,6 +100,7 @@ ### CI +* []() - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. * [1958](https://github.com/zeta-chain/node/pull/1958) - Fix e2e advanced test debug checkbox. * [1945](https://github.com/zeta-chain/node/pull/1945) - update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. * [1940](https://github.com/zeta-chain/node/pull/1940) - adjust release pipeline to be created as pre-release instead of latest diff --git a/contrib/athens3/zetacored-localbuild/docker-compose.yml b/contrib/athens3/zetacored-localbuild/docker-compose.yml new file mode 100644 index 0000000000..d92b35d443 --- /dev/null +++ b/contrib/athens3/zetacored-localbuild/docker-compose.yml @@ -0,0 +1,42 @@ +version: '3.8' +services: + zetachain_mainnet_rpc: + platform: linux/amd64 + build: + context: ../../.. + dockerfile: Dockerfile + 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 + CHAIN_ID: "athens_7001-1" + VISOR_NAME: "cosmovisor" + DAEMON_NAME: "zetacored" + DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" + DAEMON_RESTART_AFTER_UPGRADE: "true" + UNSAFE_SKIP_BACKUP: "true" + CLIENT_DAEMON_NAME: "zetaclientd" + CLIENT_DAEMON_ARGS: "" + CLIENT_SKIP_UPGRADE: "true" + CLIENT_START_PROCESS: "false" + MONIKER: athens3-local-rpc + RE_DO_START_SEQUENCE: "false" + IS_LOCAL_DEVELOPMENT: "true" + ports: + - "26656:26656" + - "1317:1317" + - "8545:8545" + - "8546:8546" + - "26657:26657" + - "9090:9090" + - "9091:9091" + volumes: + - zetacored_data_athens3:/root/.zetacored/ + - ../../../contrib/docker-scripts/start.sh:/scripts/start.sh + entrypoint: bash /scripts/start.sh + +volumes: + zetacored_data_athens3: diff --git a/contrib/athens3/zetacored/docker-compose.yml b/contrib/athens3/zetacored/docker-compose.yml index cee5b695bc..38df212770 100644 --- a/contrib/athens3/zetacored/docker-compose.yml +++ b/contrib/athens3/zetacored/docker-compose.yml @@ -2,10 +2,6 @@ version: '3.8' services: zetachain_mainnet_rpc: platform: linux/amd64 - #This will build the binary from the GIT_REF you are locally on. -# build: -# context: ../../.. -# dockerfile: Dockerfile image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1} environment: DAEMON_HOME: "/root/.zetacored" @@ -26,6 +22,7 @@ services: CLIENT_START_PROCESS: "false" MONIKER: local-test RE_DO_START_SEQUENCE: "false" + IS_LOCAL_DEVELOPMENT: "false" ports: - "26656:26656" - "1317:1317" @@ -37,6 +34,5 @@ services: volumes: - zetacored_data_athens3:/root/.zetacored/ entrypoint: bash /scripts/start.sh - volumes: zetacored_data_athens3: diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index d60f131c2c..dc56397647 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -236,12 +236,21 @@ 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" + if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then + ${DAEMON_NAME} version + ${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 + ${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" + fi } 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 new file mode 100644 index 0000000000..25828a7376 --- /dev/null +++ b/contrib/mainnet/zetacored-localbuild/docker-compose.yml @@ -0,0 +1,44 @@ +version: '3.8' +services: + zetachain_mainnet_rpc: + platform: linux/amd64 + build: + context: ../../.. + dockerfile: Dockerfile + container_name: zetachain_mainnet_rpc + environment: + DAEMON_HOME: "/root/.zetacored" + NETWORK: mainnet + RESTORE_TYPE: "snapshot" + SNAPSHOT_API: https://snapshots.zetachain.com + TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 + CHAIN_ID: "zetachain_7000-1" + VISOR_NAME: "cosmovisor" + DAEMON_NAME: "zetacored" + DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" + DAEMON_RESTART_AFTER_UPGRADE: "true" + UNSAFE_SKIP_BACKUP: "true" + CLIENT_DAEMON_NAME: "zetaclientd" + CLIENT_DAEMON_ARGS: "" + CLIENT_SKIP_UPGRADE: "true" + CLIENT_START_PROCESS: "false" + MONIKER: local-test + RE_DO_START_SEQUENCE: "false" + IS_LOCAL_DEVELOPMENT: "true" + ports: + - "26656:26656" + - "1317:1317" + - "8545:8545" + - "8546:8546" + - "26657:26657" + - "9090:9090" + - "9091:9091" + volumes: + - zetacored_data_mainnet:/root/.zetacored/ + - ../../../contrib/docker-scripts/start.sh:/scripts/start.sh + entrypoint: bash /scripts/start.sh + #for debugging + #entrypoint: ["/bin/sh", "-c"] + #command: ["while true; do sleep 86400; done"] +volumes: + zetacored_data_mainnet: diff --git a/contrib/mainnet/zetacored/docker-compose.yml b/contrib/mainnet/zetacored/docker-compose.yml index ed75d0254c..06959b7cc1 100644 --- a/contrib/mainnet/zetacored/docker-compose.yml +++ b/contrib/mainnet/zetacored/docker-compose.yml @@ -2,11 +2,7 @@ version: '3.8' services: zetachain_mainnet_rpc: platform: linux/amd64 - #This will build the binary from the GIT_REF you are locally on. - # build: - # context: ../../.. - # dockerfile: Dockerfile - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1} + image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.1} container_name: zetachain_mainnet_rpc environment: DAEMON_HOME: "/root/.zetacored" @@ -27,6 +23,7 @@ services: CLIENT_START_PROCESS: "false" MONIKER: local-test RE_DO_START_SEQUENCE: "false" + IS_LOCAL_DEVELOPMENT: "false" ports: - "26656:26656" - "1317:1317" @@ -38,8 +35,5 @@ services: volumes: - 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_mainnet: diff --git a/readme.md b/readme.md index b4ba24455f..ef502ffe9c 100644 --- a/readme.md +++ b/readme.md @@ -119,13 +119,25 @@ This guide details deploying Zetacored nodes on both ZetaChain mainnet and Athen ```shell make mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1 ``` + +**For MAinnet:** +- Use this command for Mainnet to build form the current branch your on and launch with that binary with current athens3 state. This is for testing non-governance upgrade changes locally against a full node. + ```shell + make mainnet-zetarpc-node-local-dev + ``` **For Athens3 (Testnet):** - Similar command structure for Athens3, ensuring the correct Docker tag is used. ```shell make testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1 ``` - + +**For Athens3 (Testnet) Local Development:** +- Use this command for Athens3 to build form the current branch your on and launch with that binary with current athens3 state. This is for testing non-governance upgrade changes locally against a full node. + ```shell + make testnet-zetarpc-node-local-dev + ``` + #### Modifying the Sync Type **To change the sync type for your node:** From 81c30eacb14a386569153129c382eb8697b14f88 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Tue, 23 Apr 2024 18:43:24 -0600 Subject: [PATCH 02/16] ci: added two new make commands for building working brances to test non-governance upgrades against a full node fully synced against testnet or mainnet --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d3d97fe733..a5b439b4da 100644 --- a/Makefile +++ b/Makefile @@ -295,10 +295,10 @@ testnet-zetarpc-node: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up mainnet-zetarpc-node-local-dev: - cd contrib/mainnet/zetacored-localbuild && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + cd contrib/mainnet/zetacored-localbuild && docker-compose up testnet-zetarpc-node-local-dev: - cd contrib/athens3/zetacored-localbuild && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + cd contrib/athens3/zetacored-localbuild && docker-compose up ############################################################################### ### Debug Tools ### From b7bf20949798821069831d363d87d59bdef2982c Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Tue, 23 Apr 2024 18:46:32 -0600 Subject: [PATCH 03/16] ci: added two new make commands for building working brances to test non-governance upgrades against a full node fully synced against testnet or mainnet --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4b4042538e..9dfbc62b62 100644 --- a/changelog.md +++ b/changelog.md @@ -100,7 +100,7 @@ ### CI -* []() - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. +* [2070](https://github.com/zeta-chain/node/pull/2070) - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. * [1958](https://github.com/zeta-chain/node/pull/1958) - Fix e2e advanced test debug checkbox. * [1945](https://github.com/zeta-chain/node/pull/1945) - update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. * [1940](https://github.com/zeta-chain/node/pull/1940) - adjust release pipeline to be created as pre-release instead of latest From a3945dab67f7419ef3f1a17bb43799c8409a9ebb Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 11:51:35 -0600 Subject: [PATCH 04/16] updated the start sequence to not use zetacored but cosmovisor all around... --- contrib/docker-scripts/start.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index dc56397647..cb29691cab 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -237,20 +237,14 @@ function move_zetacored_binaries { function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then - ${DAEMON_NAME} version - ${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 - ${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" + cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored 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." From 91d5f3f1ad2b1e648e20ae7376cd286c59bbc1f2 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 16:50:48 -0600 Subject: [PATCH 05/16] 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" From 227c20473652adc30f9504f0d60665776656acb8 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 21:29:09 -0600 Subject: [PATCH 06/16] updated --- Dockerfile | 5 ++++- contrib/docker-scripts/start.sh | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b43c2ca501..3414b4a7a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,9 @@ RUN go mod download # Copy the rest of the source code and build the application COPY . . -RUN make install +RUN EXPECTED_MAJOR_VERSION=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ + make install VERSION="${EXPECTED_MAJOR_VERSION}" && \ + echo -n "${EXPECTED_MAJOR_VERSION}" > /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION # Run Stage FROM alpine:3.18 @@ -46,6 +48,7 @@ RUN apk --no-cache add git jq bash curl nano vim tmux python3 libusb-dev linux-h # Copy the binaries from the build stage COPY --from=builder /go/bin/zetaclientd /usr/local/bin/zetaclientd COPY --from=builder /go/bin/zetacored /usr/local/bin/zetacored +COPY --from=builder /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION /scripts/EXPECTED_MAJOR_VERSION # Set the working directory WORKDIR /usr/local/bin diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 39e8243d3c..f5dbe0460d 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -242,14 +242,24 @@ function start_network { 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}') + logt "Visor Version" + ${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n' - VISOR_VERSION=$(${VISOR_NAME} version) - DAEMON_VERSION=$(${DAEMON_NAME} version) + logt "Visor Version" + ${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n' + EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) + VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') + 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]*') + logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" + logt "VISOR_VERSION: ${VISOR_VERSION}" + logt "DAEMON_VERSION: ${DAEMON_VERSION}" + logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" + logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" + 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 From d4c7bdf100bf91d4a87dea94a8bbfa835c19882f Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 21:29:26 -0600 Subject: [PATCH 07/16] updated --- contrib/docker-scripts/start.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index f5dbe0460d..7633b3dd9a 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -242,12 +242,6 @@ function start_network { ln -s ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored ${DAEMON_HOME}/cosmovisor/current/bin/zetacored fi - logt "Visor Version" - ${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n' - - logt "Visor Version" - ${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n' - EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') DAEMON_VERSION=$(${DAEMON_NAME} version) From 8c261fad911ff30b4c3058c6186880186f9295ca Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 21:58:06 -0600 Subject: [PATCH 08/16] updated --- contrib/docker-scripts/start.sh | 69 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 7633b3dd9a..42ab8766b8 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -240,40 +240,47 @@ function start_network { 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=$(cat /scripts/EXPECTED_MAJOR_VERSION) - VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') - 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]*') - logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" - logt "VISOR_VERSION: ${VISOR_VERSION}" - logt "DAEMON_VERSION: ${DAEMON_VERSION}" - logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" - logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" - - 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 + EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) + VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') + 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]*') + + logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" + logt "VISOR_VERSION: ${VISOR_VERSION}" + logt "DAEMON_VERSION: ${DAEMON_VERSION}" + logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" + logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" + + 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" + 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 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" + 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 } From 36343827212dd4b220b1e0ae6483753cdde6364d Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 25 Apr 2024 16:36:09 -0600 Subject: [PATCH 09/16] updated read me docs file name and start logic --- Makefile | 36 +-- .../zetacored-localbuild/docker-compose.yml | 4 +- contrib/athens3/zetacored/docker-compose.yml | 4 +- contrib/docker-scripts/start.sh | 69 +++--- .../zetacored-localbuild/docker-compose.yml | 2 +- contrib/mainnet/zetacored/docker-compose.yml | 2 +- readme.md | 232 ++++-------------- 7 files changed, 103 insertions(+), 246 deletions(-) diff --git a/Makefile b/Makefile index 13c3a9df19..6dbae25dd5 100644 --- a/Makefile +++ b/Makefile @@ -285,43 +285,49 @@ release: ### Local Mainnet Development ### ############################################################################### -mainnet-zetarpc-node: - cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up - -mainnet-bitcoind-node: +start-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose up -testnet-zetarpc-node: +start-zetacored-rpc-mainnet: + cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + +start-zetacored-rpc-testnet: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up -mainnet-bitcoind-node-down: +stop-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -testnet-zetarpc-node-down: +stop-zetacored-rpc-testnet: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -mainnet-bitcoind-node-down-clean: +stop-zetacored-rpc-mainnet: + cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + +stop-and-clean-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v -testnet-zetarpc-node-down-clean: +stop-and-clean-zetacored-rpc-testnet: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v -mainnet-zetarpc-node-local-dev: +stop-and-clean-zetacored-rpc-mainnet: + cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + +start-zetacored-rpc-mainnet-localbuild: cd contrib/mainnet/zetacored-localbuild && docker-compose up --build -testnet-zetarpc-node-local-dev: +start-zetacored-rpc-testnet-localbuild: cd contrib/athens3/zetacored-localbuild && docker-compose up --build -mainnet-zetarpc-node-local-dev-down: +stop-zetacored-rpc-mainnet-localbuild: cd contrib/mainnet/zetacored-localbuild && docker-compose down -testnet-zetarpc-node-local-dev-down: +stop-zetacored-rpc-testnet-localbuild: cd contrib/athens3/zetacored-localbuild && docker-compose down -mainnet-zetarpc-node-local-dev-down-clean: +stop-and-clean-zetacored-rpc-mainnet-localbuild: cd contrib/mainnet/zetacored-localbuild && docker-compose down -v -testnet-zetarpc-node-local-dev-down-cliean: +stop-and-clean-zetacored-rpc-testnet-localbuild: cd contrib/athens3/zetacored-localbuild && docker-compose down -v ############################################################################### diff --git a/contrib/athens3/zetacored-localbuild/docker-compose.yml b/contrib/athens3/zetacored-localbuild/docker-compose.yml index cfe01da31b..a6f4b13394 100644 --- a/contrib/athens3/zetacored-localbuild/docker-compose.yml +++ b/contrib/athens3/zetacored-localbuild/docker-compose.yml @@ -1,6 +1,6 @@ version: '3.8' services: - zetachain_mainnet_rpc: + zetachain_athens3_rpc: platform: linux/amd64 build: context: ../../.. @@ -15,7 +15,7 @@ services: VISOR_NAME: "cosmovisor" DAEMON_NAME: "zetacored" DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" + DAEMON_RESTART_AFTER_UPGRADE: "false" UNSAFE_SKIP_BACKUP: "true" CLIENT_DAEMON_NAME: "zetaclientd" CLIENT_DAEMON_ARGS: "" diff --git a/contrib/athens3/zetacored/docker-compose.yml b/contrib/athens3/zetacored/docker-compose.yml index 3116f690d8..8f2be919df 100644 --- a/contrib/athens3/zetacored/docker-compose.yml +++ b/contrib/athens3/zetacored/docker-compose.yml @@ -1,8 +1,8 @@ version: '3.8' services: - zetachain_mainnet_rpc: + zetachain_athens3_rpc: platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1} + image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.0} environment: DAEMON_HOME: "/root/.zetacored" NETWORK: athens3 diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 42ab8766b8..8deb63389e 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -238,50 +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 + mkdir -p ${DAEMON_HOME}/cosmovisor/current/bin + rm -rf ${DAEMON_HOME}/cosmovisor/current/bin/zetacored || echo "Doesn't Exist" ln -s ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored ${DAEMON_HOME}/cosmovisor/current/bin/zetacored + fi + EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) + VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') + 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]*') + + logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" + logt "VISOR_VERSION: ${VISOR_VERSION}" + logt "DAEMON_VERSION: ${DAEMON_VERSION}" + logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" + logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" + + 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 - EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) - VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') - 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]*') - - logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" - logt "VISOR_VERSION: ${VISOR_VERSION}" - logt "DAEMON_VERSION: ${DAEMON_VERSION}" - logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" - logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" - - 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 + if [ "$VISOR_VERSION" != "$DAEMON_VERSION" ]; then + logt "cosmovisor version doesn't appear to match your daemon version. Start ${DAEMON_NAME}" 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" + logt "cosmovisor version match your daemon version. Start ${VISOR_NAME}" fi + + ${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 bce18a6b80..4e3aa61e25 100644 --- a/contrib/mainnet/zetacored-localbuild/docker-compose.yml +++ b/contrib/mainnet/zetacored-localbuild/docker-compose.yml @@ -16,7 +16,7 @@ services: VISOR_NAME: "cosmovisor" DAEMON_NAME: "zetacored" DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" + DAEMON_RESTART_AFTER_UPGRADE: "false" UNSAFE_SKIP_BACKUP: "true" CLIENT_DAEMON_NAME: "zetaclientd" CLIENT_DAEMON_ARGS: "" diff --git a/contrib/mainnet/zetacored/docker-compose.yml b/contrib/mainnet/zetacored/docker-compose.yml index 753dfc6776..f08c2b4a3b 100644 --- a/contrib/mainnet/zetacored/docker-compose.yml +++ b/contrib/mainnet/zetacored/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: zetachain_mainnet_rpc: platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.1} + image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.0} container_name: zetachain_mainnet_rpc environment: DAEMON_HOME: "/root/.zetacored" diff --git a/readme.md b/readme.md index ef502ffe9c..49ef8a0d13 100644 --- a/readme.md +++ b/readme.md @@ -110,194 +110,56 @@ Once the release is approved the pipeline will continue and will publish the rel This guide details deploying Zetacored nodes on both ZetaChain mainnet and Athens3 (testnet), alongside setting up a Bitcoin node for mainnet. The setup utilizes Docker Compose with environment variables for a streamlined deployment process. -### Deploying Zetacored Nodes - -#### Launching a Node - -**For Mainnet:** -- Use the `make` command with a specified Docker tag to initiate a mainnet Zetacored node. - ```shell - make mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1 - ``` - -**For MAinnet:** -- Use this command for Mainnet to build form the current branch your on and launch with that binary with current athens3 state. This is for testing non-governance upgrade changes locally against a full node. - ```shell - make mainnet-zetarpc-node-local-dev - ``` - -**For Athens3 (Testnet):** -- Similar command structure for Athens3, ensuring the correct Docker tag is used. - ```shell - make testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1 - ``` - -**For Athens3 (Testnet) Local Development:** -- Use this command for Athens3 to build form the current branch your on and launch with that binary with current athens3 state. This is for testing non-governance upgrade changes locally against a full node. - ```shell - make testnet-zetarpc-node-local-dev - ``` - -#### Modifying the Sync Type - -**To change the sync type for your node:** -- Edit docker-compose.yml in contrib/{NETWORK}/zetacored/. -- Set RESTORE_TYPE to your desired method (snapshot, snapshot-archive, statesync). - -#### Zetacored Environment Variables - -| Variable | Description | -|----------|-------------| -| `DAEMON_HOME` | Daemon's home directory (`/root/.zetacored`). | -| `NETWORK` | Network identifier: `mainnet` or `athens3` (for testnet). | -| `RESTORE_TYPE` | Node restoration method: `snapshot`, `snapshot-archive`, `statesync`. | -| `SNAPSHOT_API` | API URL for fetching snapshots. | -| `TRUST_HEIGHT_DIFFERENCE_STATE_SYNC` | Trust height difference for state synchronization. | -| `CHAIN_ID` | Chain ID for the network. | -| `VISOR_NAME` | Visor software name, typically `cosmovisor`. | -| `DAEMON_NAME` | Daemon software name, `zetacored`. | -| `DAEMON_ALLOW_DOWNLOAD_BINARIES` | Enable daemon to download binaries. | -| `DAEMON_RESTART_AFTER_UPGRADE` | Restart daemon after software upgrade. | -| `UNSAFE_SKIP_BACKUP` | Skip backup during potentially unsafe operations. | -| `CLIENT_DAEMON_NAME` | Client daemon name, such as `zetaclientd`. | -| `CLIENT_DAEMON_ARGS` | Extra arguments for the client daemon. | -| `CLIENT_SKIP_UPGRADE` | Skip client software upgrade. | -| `CLIENT_START_PROCESS` | Begin client process start-up. | -| `MONIKER` | Node's moniker or nickname. | -| `RE_DO_START_SEQUENCE` | Restart node setup from scratch if necessary. | +Here's a comprehensive documentation using markdown tables to cover all the `make` commands for managing Zetacored and Bitcoin nodes, including where to modify the environment variables in Docker Compose configurations. + +### Zetacored / BTC Node Deployment and Management + +#### Commands Overview for Zetacored + +| Environment | Action | Command | Docker Compose Location | +|-------------|--------|---------|-------------------------| +| **Mainnet** | Start Node | `make start-mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/mainnet/zetacored` | +| **Mainnet** | Start Node (Local Build) | `make start-mainnet-zetarpc-node-local-build` | `contrib/mainnet/zetacored-localbuild` | +| **Mainnet** | Stop Node | `make stop-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | +| **Mainnet** | Clean Node Data | `make clean-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | +| **Testnet (Athens3)** | Start Node | `make start-testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/athens3/zetacored` | +| **Testnet (Athens3)** | Start Node (Local Build) | `make start-testnet-zetarpc-node-local-build` | `contrib/athens3/zetacored-localbuild` | +| **Testnet (Athens3)** | Stop Node | `make stop-testnet-zetarpc-node` | `contrib/athens3/zetacored` | +| **Testnet (Athens3)** | Clean Node Data | `make clean-testnet-zetarpc-node` | `contrib/athens3/zetacored` | ### Bitcoin Node Setup for Mainnet -**Restoring a BTC Watcher Node:** -- To deploy a Bitcoin mainnet node, specify the `DOCKER_TAG` for your Docker image. - ```shell - make mainnet-bitcoind-node DOCKER_TAG=36-mainnet - ``` - -#### Bitcoin Node Environment Variables - -| Variable | Description | -|----------|-------------| -| `bitcoin_username` | Username for Bitcoin RPC. | -| `bitcoin_password` | Password for Bitcoin RPC. | -| `NETWORK_HEIGHT_URL` | URL to fetch the latest block height. | -| `WALLET_NAME` | Name of the Bitcoin wallet. | -| `WALLET_ADDRESS` | Bitcoin wallet address for transactions. | -| `SNAPSHOT_URL` | URL for downloading the blockchain snapshot. | -| `SNAPSHOT_RESTORE` | Enable restoration from snapshot. | -| `CLEAN_SNAPSHOT` | Clean existing data before restoring snapshot. | -| `DOWNLOAD_SNAPSHOT` | Download the snapshot if not present. | - -### Docker Compose Configurations - -#### Zetacored Mainnet - -```yaml -version: '3.8' -services: - zetachain_mainnet_rpc: - platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1} - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: mainnet - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "zetachain_7000-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - MONIKER: local-test - RE_DO_START_SEQUENCE: "false" - ports: - - "26656:26656" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - - - zetacored_data_mainnet:/root/.zetacored/ - entrypoint: bash /scripts/start.sh -volumes: - zetacored_data_mainnet: -``` +#### Commands Overview for Bitcoin -#### Zetacored Athens3/Testnet - -```yaml -version: '3.8' -services: - zetachain_testnet_rpc: - platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14-testnet} - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: athens3 - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "athens_7001-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - MONIKER: local-test - RE_DO_START_SEQUENCE: "false" - ports: - - "26656:26656" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - zetacored_data_athens3:/root/.zetacored/ - entrypoint: bash /scripts/start.sh -volumes: - zetacored_data_athens3: -``` +| Action | Command | Docker Compose Location | +|--------|---------|-------------------------| +| Start Node | `make start-mainnet-bitcoind-node DOCKER_TAG=36-mainnet` | `contrib/mainnet/bitcoind` | +| Stop Node | `make stop-mainnet-bitcoind-node` | `contrib/mainnet/bitcoind` | +| Clean Node Data | `make clean-mainnet-bitcoind-node` | `contrib/mainnet/bitcoind` | -#### Bitcoin Mainnet Node - -```yaml -version: '3' -services: - bitcoin: - image: zetachain/bitcoin:${DOCKER_TAG:-36-mainnet} - platform: linux/amd64 - environment: - - bitcoin_username=test - - bitcoin_password=test - - NETWORK_HEIGHT_URL=https://blockstream.info/api/blocks/tip/height - - WALLET_NAME=tssMainnet - - WALLET_ADDRESS=bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y - - SNAPSHOT_URL=https://storage.googleapis.com/bitcoin-rpc-snapshots-prod/bitcoind-mainnet-2024-02-20-00-22-06.tar.gz - - SNAPSHOT_RESTORE=true - - CLEAN_SNAPSHOT=true - - DOWNLOAD_SNAPSHOT=true - volumes: - - bitcoin_data:/root/ - ports: - - 8332:8332 -volumes: - bitcoin_data: -``` +### Configuration Options + +#### Where to Modify Environment Variables + +The environment variables for both Zetacored and Bitcoin nodes are defined in the `docker-compose.yml` files located in the respective directories mentioned above. These variables control various operational aspects like the sync type, networking details, and client behavior. + +#### Example Environment Variables for Zetacored + +| Variable | Description | Example | +|----------|-------------|---------| +| `DAEMON_HOME` | Daemon's home directory | `/root/.zetacored` | +| `NETWORK` | Network identifier | `mainnet`, `athens3` | +| `CHAIN_ID` | Chain ID for the network | `zetachain_7000-1`, `athens_7001-1` | +| `RESTORE_TYPE` | Node restoration method | `snapshot`, `statesync` | +| `SNAPSHOT_API` | API URL for fetching snapshots | `https://snapshots.zetachain.com` | + +#### Example Environment Variables for Bitcoin + +| Variable | Description | Example | +|----------|-------------|---------| +| `bitcoin_username` | Username for Bitcoin RPC | `user` | +| `bitcoin_password` | Password for Bitcoin RPC | `pass` | +| `WALLET_NAME` | Name of the Bitcoin wallet | `tssMainnet` | +| `WALLET_ADDRESS` | Bitcoin wallet address for transactions | `bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y` | -Replace placeholders in Docker Compose files and `make` commands with actual values appropriate for your deployment scenario. This complete setup guide is designed to facilitate the deployment and management of Zetacored and Bitcoin nodes in various environments. \ No newline at end of file +This detailed tabulation ensures all necessary commands and configurations are neatly organized, providing clarity on where to manage the settings and how to execute different operations for Zetacored and Bitcoin nodes across different environments. From 5bbf934f175fcae513f5441cfb2c2b490079a174 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Thu, 25 Apr 2024 17:12:05 -0600 Subject: [PATCH 10/16] updated --- Makefile | 10 +++++----- readme.md | 27 +++++++++++++++++---------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 6dbae25dd5..df05f76855 100644 --- a/Makefile +++ b/Makefile @@ -303,13 +303,13 @@ stop-zetacored-rpc-testnet: stop-zetacored-rpc-mainnet: cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -stop-and-clean-bitcoin-node-mainnet: +clean-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v -stop-and-clean-zetacored-rpc-testnet: +clean-zetacored-rpc-testnet: cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v -stop-and-clean-zetacored-rpc-mainnet: +clean-zetacored-rpc-mainnet: cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v start-zetacored-rpc-mainnet-localbuild: @@ -324,10 +324,10 @@ stop-zetacored-rpc-mainnet-localbuild: stop-zetacored-rpc-testnet-localbuild: cd contrib/athens3/zetacored-localbuild && docker-compose down -stop-and-clean-zetacored-rpc-mainnet-localbuild: +zetacored-rpc-mainnet-localbuild: cd contrib/mainnet/zetacored-localbuild && docker-compose down -v -stop-and-clean-zetacored-rpc-testnet-localbuild: +zetacored-rpc-testnet-localbuild: cd contrib/athens3/zetacored-localbuild && docker-compose down -v ############################################################################### diff --git a/readme.md b/readme.md index 49ef8a0d13..13e2248452 100644 --- a/readme.md +++ b/readme.md @@ -116,16 +116,23 @@ Here's a comprehensive documentation using markdown tables to cover all the `mak #### Commands Overview for Zetacored -| Environment | Action | Command | Docker Compose Location | -|-------------|--------|---------|-------------------------| -| **Mainnet** | Start Node | `make start-mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/mainnet/zetacored` | -| **Mainnet** | Start Node (Local Build) | `make start-mainnet-zetarpc-node-local-build` | `contrib/mainnet/zetacored-localbuild` | -| **Mainnet** | Stop Node | `make stop-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | -| **Mainnet** | Clean Node Data | `make clean-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | -| **Testnet (Athens3)** | Start Node | `make start-testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/athens3/zetacored` | -| **Testnet (Athens3)** | Start Node (Local Build) | `make start-testnet-zetarpc-node-local-build` | `contrib/athens3/zetacored-localbuild` | -| **Testnet (Athens3)** | Stop Node | `make stop-testnet-zetarpc-node` | `contrib/athens3/zetacored` | -| **Testnet (Athens3)** | Clean Node Data | `make clean-testnet-zetarpc-node` | `contrib/athens3/zetacored` | +Here's the updated table incorporating the new make commands you provided for managing both the Zetacored and Bitcoin nodes. + +| Environment | Action | Command | Docker Compose Location | +|--------------------------------------|--------------------------------|-------------------------------------------------------------|-----------------------------------------| +| **Mainnet** | Start Zetacored Node | `make start-mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/mainnet/zetacored` | +| **Mainnet** | Stop Zetacored Node | `make stop-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | +| **Mainnet** | Clean Zetacored Node Data | `make clean-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | +| **Testnet (Athens3)** | Start Zetacored Node | `make start-testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/athens3/zetacored` | +| **Testnet (Athens3)** | Stop Zetacored Node | `make stop-testnet-zetarpc-node` | `contrib/athens3/zetacored` | +| **Testnet (Athens3)** | Clean Zetacored Node Data | `make clean-testnet-zetarpc-node` | `contrib/athens3/zetacored` | +| **Mainnet Local Build** | Start Zetacored Node | `make start-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | +| **Mainnet Local Build** | Stop Zetacored Node | `make stop-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | +| **Mainnet Local Build** | Clean Zetacored Node Data | `make clean-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | +| **Testnet Local Build (Athens3)** | Start Zetacored Node | `make start-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | +| **Testnet Local Build (Athens3)** | Stop Zetacored Node | `make stop-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | +| **Testnet Local Build (Athens3)** | Clean Zetacored Node Data | `make clean-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | + ### Bitcoin Node Setup for Mainnet From 147347af9d8e296f83fefb2df7bcd62b9a3acd12 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Mon, 29 Apr 2024 07:48:55 -0600 Subject: [PATCH 11/16] updates --- Makefile | 58 ++++++++++------- .../zetacored-localbuild/docker-compose.yml | 43 ------------- contrib/athens3/zetacored/docker-compose.yml | 39 ------------ contrib/docker-scripts/start.sh | 3 - .../zetacored-localbuild/docker-compose.yml | 46 -------------- contrib/mainnet/zetacored/docker-compose.yml | 40 ------------ .../bitcoind-mainnet}/docker-compose.yml | 0 contrib/rpc/ethereum/Dockerfile | 8 +++ contrib/rpc/ethereum/docker-compose.yml | 38 ++++++++++++ contrib/rpc/zetacored/init_docker_compose.sh | 62 +++++++++++++++++++ contrib/rpc/zetacored/kill_docker_compose.sh | 14 +++++ contrib/rpc/zetacored/networks/.athens3 | 14 +++++ .../zetacored/networks/.athens3-localbuild | 14 +++++ contrib/rpc/zetacored/networks/.mainnet | 14 +++++ .../zetacored/networks/.mainnet-localbuild | 14 +++++ 15 files changed, 212 insertions(+), 195 deletions(-) delete mode 100644 contrib/athens3/zetacored-localbuild/docker-compose.yml delete mode 100644 contrib/athens3/zetacored/docker-compose.yml delete mode 100644 contrib/mainnet/zetacored-localbuild/docker-compose.yml delete mode 100644 contrib/mainnet/zetacored/docker-compose.yml rename contrib/{mainnet/bitcoind => rpc/bitcoind-mainnet}/docker-compose.yml (100%) create mode 100644 contrib/rpc/ethereum/Dockerfile create mode 100644 contrib/rpc/ethereum/docker-compose.yml create mode 100644 contrib/rpc/zetacored/init_docker_compose.sh create mode 100644 contrib/rpc/zetacored/kill_docker_compose.sh create mode 100644 contrib/rpc/zetacored/networks/.athens3 create mode 100644 contrib/rpc/zetacored/networks/.athens3-localbuild create mode 100644 contrib/rpc/zetacored/networks/.mainnet create mode 100644 contrib/rpc/zetacored/networks/.mainnet-localbuild diff --git a/Makefile b/Makefile index df05f76855..9b7c4f513f 100644 --- a/Makefile +++ b/Makefile @@ -285,50 +285,60 @@ release: ### Local Mainnet Development ### ############################################################################### +#BTC start-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose up -start-zetacored-rpc-mainnet: - cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up - -start-zetacored-rpc-testnet: - cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up - stop-bitcoin-node-mainnet: cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -stop-zetacored-rpc-testnet: - cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down +clean-bitcoin-node-mainnet: + cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + + +#ZETA + +#FULL-NODE-RPC-FROM-BUILT-IMAGE +start-zetacored-rpc-mainnet: + cd contrib/rpc/zetacored && bash init_docker_compose.sh mainnet image $(DOCKER_TAG) stop-zetacored-rpc-mainnet: - cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + cd contrib/rpc/zetacored && bash kill_docker_compose.sh mainnet false -clean-bitcoin-node-mainnet: - cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v +clean-zetacored-rpc-mainnet: + cd contrib/rpc/zetacored && bash kill_docker_compose.sh mainnet true + +#FULL-NODE-RPC-FROM-BUILT-IMAGE +start-zetacored-rpc-testnet: + cd contrib/rpc/zetacored && bash init_docker_compose.sh athens3 image $(DOCKER_TAG) + +stop-zetacored-rpc-testnet: + cd contrib/rpc/zetacored && bash kill_docker_compose.sh athens3 false clean-zetacored-rpc-testnet: - cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + cd contrib/rpc/zetacored && bash kill_docker_compose.sh athens3 true -clean-zetacored-rpc-mainnet: - cd contrib/mainnet/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v +#FULL-NODE-RPC-FROM-LOCAL-BUILD start-zetacored-rpc-mainnet-localbuild: - cd contrib/mainnet/zetacored-localbuild && docker-compose up --build - -start-zetacored-rpc-testnet-localbuild: - cd contrib/athens3/zetacored-localbuild && docker-compose up --build + cd contrib/rpc/zetacored && bash init_docker_compose.sh mainnet localbuild $(DOCKER_TAG) stop-zetacored-rpc-mainnet-localbuild: - cd contrib/mainnet/zetacored-localbuild && docker-compose down + cd contrib/rpc/zetacored && bash kill_docker_compose.sh mainnet false + +clean-zetacored-rpc-mainnet-localbuild: + cd contrib/rpc/zetacored && bash kill_docker_compose.sh mainnet true + +#FULL-NODE-RPC-FROM-LOCAL-BUILD +start-zetacored-rpc-testnet-localbuild: + cd contrib/rpc/zetacored && bash init_docker_compose.sh athens3 localbuild $(DOCKER_TAG) stop-zetacored-rpc-testnet-localbuild: - cd contrib/athens3/zetacored-localbuild && docker-compose down + cd contrib/rpc/zetacored && bash kill_docker_compose.sh athens3 false -zetacored-rpc-mainnet-localbuild: - cd contrib/mainnet/zetacored-localbuild && docker-compose down -v +clean-zetacored-rpc-testnet-localbuild: + cd contrib/rpc/zetacored && bash kill_docker_compose.sh athens3 true -zetacored-rpc-testnet-localbuild: - 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 deleted file mode 100644 index a6f4b13394..0000000000 --- a/contrib/athens3/zetacored-localbuild/docker-compose.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: '3.8' -services: - zetachain_athens3_rpc: - platform: linux/amd64 - build: - context: ../../.. - dockerfile: Dockerfile - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: athens3 - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "athens_7001-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "false" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - 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" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - zetacored_data_athens3:/root/.zetacored/ - - ../../../contrib/docker-scripts/start.sh:/scripts/start.sh - entrypoint: bash /scripts/start.sh - -volumes: - zetacored_data_athens3: diff --git a/contrib/athens3/zetacored/docker-compose.yml b/contrib/athens3/zetacored/docker-compose.yml deleted file mode 100644 index 8f2be919df..0000000000 --- a/contrib/athens3/zetacored/docker-compose.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: '3.8' -services: - zetachain_athens3_rpc: - platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.0} - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: athens3 - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "athens_7001-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - 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" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - zetacored_data_athens3:/root/.zetacored/ - entrypoint: bash /scripts/start.sh -volumes: - zetacored_data_athens3: diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 8deb63389e..0c2a1a4b0a 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -238,9 +238,6 @@ function move_zetacored_binaries { function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored - mkdir -p ${DAEMON_HOME}/cosmovisor/current/bin - rm -rf ${DAEMON_HOME}/cosmovisor/current/bin/zetacored || echo "Doesn't Exist" - ln -s ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored ${DAEMON_HOME}/cosmovisor/current/bin/zetacored fi EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') diff --git a/contrib/mainnet/zetacored-localbuild/docker-compose.yml b/contrib/mainnet/zetacored-localbuild/docker-compose.yml deleted file mode 100644 index 4e3aa61e25..0000000000 --- a/contrib/mainnet/zetacored-localbuild/docker-compose.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: '3.8' -services: - zetachain_mainnet_rpc: - platform: linux/amd64 - build: - context: ../../.. - dockerfile: Dockerfile - container_name: zetachain_mainnet_rpc - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: mainnet - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "zetachain_7000-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "false" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - 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" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - zetacored_data_mainnet:/root/.zetacored/ - - ../../../contrib/docker-scripts/start.sh:/scripts/start.sh - entrypoint: bash /scripts/start.sh - #for debugging - #entrypoint: ["/bin/sh", "-c"] - #command: ["while true; do sleep 86400; done"] -volumes: - zetacored_data_mainnet: diff --git a/contrib/mainnet/zetacored/docker-compose.yml b/contrib/mainnet/zetacored/docker-compose.yml deleted file mode 100644 index f08c2b4a3b..0000000000 --- a/contrib/mainnet/zetacored/docker-compose.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '3.8' -services: - zetachain_mainnet_rpc: - platform: linux/amd64 - image: zetachain/zetacored:${DOCKER_TAG:-ubuntu-v14.0.1.0} - container_name: zetachain_mainnet_rpc - environment: - DAEMON_HOME: "/root/.zetacored" - NETWORK: mainnet - RESTORE_TYPE: "snapshot" - SNAPSHOT_API: https://snapshots.zetachain.com - TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: 40000 - CHAIN_ID: "zetachain_7000-1" - VISOR_NAME: "cosmovisor" - DAEMON_NAME: "zetacored" - DAEMON_ALLOW_DOWNLOAD_BINARIES: "false" - DAEMON_RESTART_AFTER_UPGRADE: "true" - UNSAFE_SKIP_BACKUP: "true" - CLIENT_DAEMON_NAME: "zetaclientd" - CLIENT_DAEMON_ARGS: "" - CLIENT_SKIP_UPGRADE: "true" - CLIENT_START_PROCESS: "false" - 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" - - "1317:1317" - - "8545:8545" - - "8546:8546" - - "26657:26657" - - "9090:9090" - - "9091:9091" - volumes: - - zetacored_data_mainnet:/root/.zetacored/ - entrypoint: bash /scripts/start.sh -volumes: - zetacored_data_mainnet: diff --git a/contrib/mainnet/bitcoind/docker-compose.yml b/contrib/rpc/bitcoind-mainnet/docker-compose.yml similarity index 100% rename from contrib/mainnet/bitcoind/docker-compose.yml rename to contrib/rpc/bitcoind-mainnet/docker-compose.yml diff --git a/contrib/rpc/ethereum/Dockerfile b/contrib/rpc/ethereum/Dockerfile new file mode 100644 index 0000000000..25451ea475 --- /dev/null +++ b/contrib/rpc/ethereum/Dockerfile @@ -0,0 +1,8 @@ +# Use the official Go Ethereum image +FROM ethereum/client-go:latest + +# Expose the ports (8545 for JSON-RPC, 8546 for WebSocket, 30303 for P2P) +EXPOSE 8545 8546 30303 + +# Set the entrypoint to start Geth +ENTRYPOINT ["geth"] diff --git a/contrib/rpc/ethereum/docker-compose.yml b/contrib/rpc/ethereum/docker-compose.yml new file mode 100644 index 0000000000..9c199ecef3 --- /dev/null +++ b/contrib/rpc/ethereum/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' +services: + lighthouse: + image: sigp/lighthouse:latest + command: lighthouse --network mainnet beacon --http --checkpoint-sync-url https://sync.invis.tools + ports: + - "5052:5052" + volumes: + - type: volume + source: lighthouse_data + target: /root/.lighthouse + geth: + build: . + ports: + - "8545:8545" # JSON-RPC + - "8546:8546" # WebSocket + - "30303:30303" # P2P Network + volumes: + - type: volume + source: ethereum_data + target: /root/.ethereum + command: + - "--http" + - "--http.addr" + - "0.0.0.0" + - "--http.vhosts=*" + - "--http.api=admin,eth,debug,miner,net,txpool,personal,web3" + - "--ws" + - "--ws.addr" + - "0.0.0.0" + - "--ws.api=admin,eth,debug,miner,net,txpool,personal,web3" + - "--ws.origins=*" + - "--maxpeers=50" + - "--syncmode=snap" + +volumes: + ethereum_data: + lighthouse_data: diff --git a/contrib/rpc/zetacored/init_docker_compose.sh b/contrib/rpc/zetacored/init_docker_compose.sh new file mode 100644 index 0000000000..4e934dd2ff --- /dev/null +++ b/contrib/rpc/zetacored/init_docker_compose.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +NETWORK=${1} +TYPE=${2} +DOCKER_TAG=${3} + +if [ "$TYPE" == "image" ]; then + echo "Source Environment File." + SOURCE_FILE_NAME="networks/.${NETWORK}" + if [ ! -f "$SOURCE_FILE_NAME" ]; then + echo "Environment file $SOURCE_FILE_NAME does not exist." + exit 1 + fi + source ${SOURCE_FILE_NAME} +elif [ "$TYPE" == "localbuild" ]; then + echo "Source Environment File." + SOURCE_FILE_NAME="networks/.${NETWORK}-localbuild" + if [ ! -f "$SOURCE_FILE_NAME" ]; then + echo "Environment file $SOURCE_FILE_NAME does not exist." + exit 1 + fi + source ${SOURCE_FILE_NAME} +fi + +# Define the path to the Docker Compose file +FILE_PATH="${NETWORK}-docker-compose.yml" +cp docker-compose.yml ${FILE_PATH} + +# Determine the appropriate Docker Compose configuration based on TYPE +if [ "$TYPE" == "image" ]; then + IMAGE_BLOCK="image: zetachain/zetacored:\${DOCKER_TAG:-ubuntu-v14.0.1.0}" + NAME="zetacored-rpc-${NETWORK}" +elif [ "$TYPE" == "localbuild" ]; then + IMAGE_BLOCK=$(cat << 'EOF' +build: + context: ../../.. + dockerfile: Dockerfile +EOF +) + NAME="zetacored-rpc-${NETWORK}-localbuild" +else + echo "Invalid TYPE. Please specify 'image' or 'localbuild'." + exit 1 +fi + +IMAGE_BLOCK_ESCAPED=$(echo "$IMAGE_BLOCK" | sed 's/[&/]/\\&/g; s/$/\\/') +IMAGE_BLOCK_ESCAPED=${IMAGE_BLOCK_ESCAPED%?} + +# Replace placeholders in the Docker Compose file +sed -i '' "s|-=name=-|$NAME|g" $FILE_PATH +sed -i '' "s|-=image_block=-|$IMAGE_BLOCK_ESCAPED|g" $FILE_PATH + +echo "DEBUG ENV VARS" +printenv +echo "================" + +echo "Placeholders have been replaced in $FILE_PATH." +cat $FILE_PATH +echo "================" + +# Run Docker Compose +docker-compose -f ${FILE_PATH} up \ No newline at end of file diff --git a/contrib/rpc/zetacored/kill_docker_compose.sh b/contrib/rpc/zetacored/kill_docker_compose.sh new file mode 100644 index 0000000000..5d6a2c192d --- /dev/null +++ b/contrib/rpc/zetacored/kill_docker_compose.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +NETWORK=${1} +CLEAN=${2} +FILE_PATH="${NETWORK}-docker-compose.yml" + +if [ "${CLEAN}" == "true" ]; then + docker-compose -f ${FILE_PATH} down -v + rm -rf ${FILE_PATH} +else + docker-compose -f ${FILE_PATH} down + rm -rf ${FILE_PATH} +fi + diff --git a/contrib/rpc/zetacored/networks/.athens3 b/contrib/rpc/zetacored/networks/.athens3 new file mode 100644 index 0000000000..d89a99033d --- /dev/null +++ b/contrib/rpc/zetacored/networks/.athens3 @@ -0,0 +1,14 @@ +export DAEMON_HOME="/root/.zetacored" +export NETWORK=athens3 +export RESTORE_TYPE="snapshot" +export SNAPSHOT_API=https://snapshots.zetachain.com +export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=40000 +export CHAIN_ID="athens_7001-1" +export VISOR_NAME="cosmovisor" +export DAEMON_NAME="zetacored" +export DAEMON_ALLOW_DOWNLOAD_BINARIES="false" +export DAEMON_RESTART_AFTER_UPGRADE="true" +export UNSAFE_SKIP_BACKUP="true" +export MONIKER=testnet-docker-rpc +export RE_DO_START_SEQUENCE="false" +export IS_LOCAL_DEVELOPMENT="false" \ No newline at end of file diff --git a/contrib/rpc/zetacored/networks/.athens3-localbuild b/contrib/rpc/zetacored/networks/.athens3-localbuild new file mode 100644 index 0000000000..b8e0acb6ad --- /dev/null +++ b/contrib/rpc/zetacored/networks/.athens3-localbuild @@ -0,0 +1,14 @@ +export DAEMON_HOME="/root/.zetacored" +export NETWORK=athens3 +export RESTORE_TYPE="snapshot" +export SNAPSHOT_API=https://snapshots.zetachain.com +export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=40000 +export CHAIN_ID="athens_7001-1" +export VISOR_NAME="cosmovisor" +export DAEMON_NAME="zetacored" +export DAEMON_ALLOW_DOWNLOAD_BINARIES="false" +export DAEMON_RESTART_AFTER_UPGRADE="false" +export UNSAFE_SKIP_BACKUP="true" +export MONIKER=testnet-docker-rpc +export RE_DO_START_SEQUENCE="false" +export IS_LOCAL_DEVELOPMENT="true" \ No newline at end of file diff --git a/contrib/rpc/zetacored/networks/.mainnet b/contrib/rpc/zetacored/networks/.mainnet new file mode 100644 index 0000000000..4b7420b539 --- /dev/null +++ b/contrib/rpc/zetacored/networks/.mainnet @@ -0,0 +1,14 @@ +export DAEMON_HOME="/root/.zetacored" +export NETWORK=mainnet +export RESTORE_TYPE="snapshot" +export SNAPSHOT_API=https://snapshots.zetachain.com +export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=40000 +export CHAIN_ID="zetachain_7000-1" +export VISOR_NAME="cosmovisor" +export DAEMON_NAME="zetacored" +export DAEMON_ALLOW_DOWNLOAD_BINARIES="false" +export DAEMON_RESTART_AFTER_UPGRADE="true" +export UNSAFE_SKIP_BACKUP="true" +export MONIKER=mainnet-docker-rpc +export RE_DO_START_SEQUENCE="false" +export IS_LOCAL_DEVELOPMENT="false" diff --git a/contrib/rpc/zetacored/networks/.mainnet-localbuild b/contrib/rpc/zetacored/networks/.mainnet-localbuild new file mode 100644 index 0000000000..371e6fe215 --- /dev/null +++ b/contrib/rpc/zetacored/networks/.mainnet-localbuild @@ -0,0 +1,14 @@ +export DAEMON_HOME="/root/.zetacored" +export NETWORK=mainnet +export RESTORE_TYPE="snapshot" +export SNAPSHOT_API=https://snapshots.zetachain.com +export TRUST_HEIGHT_DIFFERENCE_STATE_SYNC=40000 +export CHAIN_ID="zetachain_7000-1" +export VISOR_NAME="cosmovisor" +export DAEMON_NAME="zetacored" +export DAEMON_ALLOW_DOWNLOAD_BINARIES="false" +export DAEMON_RESTART_AFTER_UPGRADE="false" +export UNSAFE_SKIP_BACKUP="true" +export MONIKER=mainnet-docker-rpc +export RE_DO_START_SEQUENCE="false" +export IS_LOCAL_DEVELOPMENT="true" From be70d738cc3309be3e7dfc178fe3515e4f983ed9 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Mon, 29 Apr 2024 07:49:18 -0600 Subject: [PATCH 12/16] updates --- contrib/rpc/zetacored/docker-compose.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 contrib/rpc/zetacored/docker-compose.yml diff --git a/contrib/rpc/zetacored/docker-compose.yml b/contrib/rpc/zetacored/docker-compose.yml new file mode 100644 index 0000000000..fa0f8caacb --- /dev/null +++ b/contrib/rpc/zetacored/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3.8' +services: + -=name=-: + platform: linux/amd64 + -=image_block=- + container_name: "zetachain_${NETWORK:-mainnet}_rpc" + environment: + DAEMON_HOME: "${DAEMON_HOME:-/root/.zetacored}" + NETWORK: ${NETWORK:-mainnet} + RESTORE_TYPE: "${RESTORE_TYPE:-snapshot}" + SNAPSHOT_API: ${SNAPSHOT_API:-https://snapshots.zetachain.com} + TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: ${TRUST_HEIGHT_DIFFERENCE_STATE_SYNC:-40000} + CHAIN_ID: "${CHAIN_ID:-zetachain_7000-1}" + VISOR_NAME: "${VISOR_NAME:-cosmovisor}" + DAEMON_NAME: "${DAEMON_NAME:-zetacored}" + DAEMON_ALLOW_DOWNLOAD_BINARIES: "${DAEMON_ALLOW_DOWNLOAD_BINARIES:-false}" + DAEMON_RESTART_AFTER_UPGRADE: "${DAEMON_RESTART_AFTER_UPGRADE:-true}" + UNSAFE_SKIP_BACKUP: "${UNSAFE_SKIP_BACKUP:-true}" + MONIKER: ${MONIKER:-mainnet-docker-rpc} + #If this is true it will erase everything and start over from scratch. + RE_DO_START_SEQUENCE: "${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: "${IS_LOCAL_DEVELOPMENT:-false}" + ports: + - "26656:26656" + - "1317:1317" + - "8545:8545" + - "8546:8546" + - "26657:26657" + - "9090:9090" + - "9091:9091" + volumes: + - -=name=-:/root/.zetacored/ + entrypoint: bash /scripts/start.sh +volumes: + -=name=-: From 215b2e98651c34966e9a8298df9111cc4e7c05eb Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Mon, 29 Apr 2024 07:51:24 -0600 Subject: [PATCH 13/16] updated --- Dockerfile | 8 ++++---- contrib/docker-scripts/start.sh | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3414b4a7a7..b4dbcd0693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,9 +20,9 @@ RUN go mod download # Copy the rest of the source code and build the application COPY . . -RUN EXPECTED_MAJOR_VERSION=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ - make install VERSION="${EXPECTED_MAJOR_VERSION}" && \ - echo -n "${EXPECTED_MAJOR_VERSION}" > /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION +RUN expected_major_version=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ + make install VERSION="${expected_major_version}" && \ + echo -n "${expected_major_version}" > /go/delivery/zeta-node/expected_major_version # Run Stage FROM alpine:3.18 @@ -48,7 +48,7 @@ RUN apk --no-cache add git jq bash curl nano vim tmux python3 libusb-dev linux-h # Copy the binaries from the build stage COPY --from=builder /go/bin/zetaclientd /usr/local/bin/zetaclientd COPY --from=builder /go/bin/zetacored /usr/local/bin/zetacored -COPY --from=builder /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION /scripts/EXPECTED_MAJOR_VERSION +COPY --from=builder /go/delivery/zeta-node/expected_major_version /scripts/expected_major_version # Set the working directory WORKDIR /usr/local/bin diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 0c2a1a4b0a..0e94a2001a 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -239,22 +239,22 @@ function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored fi - EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) + expected_major_version=$(cat /scripts/expected_major_version) VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') 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]*') - logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" + logt "expected_major_version: ${expected_major_version}" logt "VISOR_VERSION: ${VISOR_VERSION}" logt "DAEMON_VERSION: ${DAEMON_VERSION}" logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" - 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" + 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" + logt "Both versions match the expected major release version: $expected_major_version" fi if [ "$VISOR_VERSION" != "$DAEMON_VERSION" ]; then From 76012d4df33c6f551c8482158ef313c4c821b601 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Mon, 29 Apr 2024 08:00:31 -0600 Subject: [PATCH 14/16] updated --- Makefile | 16 ++++++++++++---- readme.md | 36 ++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 9b7c4f513f..df5d584f83 100644 --- a/Makefile +++ b/Makefile @@ -287,14 +287,23 @@ release: #BTC start-bitcoin-node-mainnet: - cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + cd contrib/rpc/bitcoind-mainnet && DOCKER_TAG=$(DOCKER_TAG) docker-compose up stop-bitcoin-node-mainnet: - cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + cd contrib/rpc/bitcoind-mainnet && DOCKER_TAG=$(DOCKER_TAG) docker-compose down clean-bitcoin-node-mainnet: - cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v + cd contrib/rpc/bitcoind-mainnet && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v +#ETHEREUM +start-eth-node-mainnet: + cd contrib/rpc/ethereum && DOCKER_TAG=$(DOCKER_TAG) docker-compose up + +stop-eth-node-mainnet: + cd contrib/rpc/ethereum && DOCKER_TAG=$(DOCKER_TAG) docker-compose down + +clean-eth-node-mainnet: + cd contrib/rpc/ethereum && DOCKER_TAG=$(DOCKER_TAG) docker-compose down -v #ZETA @@ -318,7 +327,6 @@ stop-zetacored-rpc-testnet: clean-zetacored-rpc-testnet: cd contrib/rpc/zetacored && bash kill_docker_compose.sh athens3 true - #FULL-NODE-RPC-FROM-LOCAL-BUILD start-zetacored-rpc-mainnet-localbuild: cd contrib/rpc/zetacored && bash init_docker_compose.sh mainnet localbuild $(DOCKER_TAG) diff --git a/readme.md b/readme.md index 13e2248452..dc5a9a284b 100644 --- a/readme.md +++ b/readme.md @@ -116,22 +116,26 @@ Here's a comprehensive documentation using markdown tables to cover all the `mak #### Commands Overview for Zetacored -Here's the updated table incorporating the new make commands you provided for managing both the Zetacored and Bitcoin nodes. - -| Environment | Action | Command | Docker Compose Location | -|--------------------------------------|--------------------------------|-------------------------------------------------------------|-----------------------------------------| -| **Mainnet** | Start Zetacored Node | `make start-mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/mainnet/zetacored` | -| **Mainnet** | Stop Zetacored Node | `make stop-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | -| **Mainnet** | Clean Zetacored Node Data | `make clean-mainnet-zetarpc-node` | `contrib/mainnet/zetacored` | -| **Testnet (Athens3)** | Start Zetacored Node | `make start-testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/athens3/zetacored` | -| **Testnet (Athens3)** | Stop Zetacored Node | `make stop-testnet-zetarpc-node` | `contrib/athens3/zetacored` | -| **Testnet (Athens3)** | Clean Zetacored Node Data | `make clean-testnet-zetarpc-node` | `contrib/athens3/zetacored` | -| **Mainnet Local Build** | Start Zetacored Node | `make start-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | -| **Mainnet Local Build** | Stop Zetacored Node | `make stop-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | -| **Mainnet Local Build** | Clean Zetacored Node Data | `make clean-zetacored-rpc-mainnet-localbuild` | `contrib/mainnet/zetacored-localbuild` | -| **Testnet Local Build (Athens3)** | Start Zetacored Node | `make start-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | -| **Testnet Local Build (Athens3)** | Stop Zetacored Node | `make stop-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | -| **Testnet Local Build (Athens3)** | Clean Zetacored Node Data | `make clean-zetacored-rpc-testnet-localbuild` | `contrib/athens3/zetacored-localbuild` | +| Environment | Action | Command | Docker Compose Location | +|-------------------------------------|-----------------------------|---------------------------------------------------------------|------------------------------------------| +| **Mainnet** | Start Bitcoin Node | `make start-bitcoin-node-mainnet` | `contrib/rpc/bitcoind-mainnet` | +| **Mainnet** | Stop Bitcoin Node | `make stop-bitcoin-node-mainnet` | `contrib/rpc/bitcoind-mainnet` | +| **Mainnet** | Clean Bitcoin Node Data | `make clean-bitcoin-node-mainnet` | `contrib/rpc/bitcoind-mainnet` | +| **Mainnet** | Start Ethereum Node | `make start-eth-node-mainnet` | `contrib/rpc/ethereum` | +| **Mainnet** | Stop Ethereum Node | `make stop-eth-node-mainnet` | `contrib/rpc/ethereum` | +| **Mainnet** | Clean Ethereum Node Data | `make clean-eth-node-mainnet` | `contrib/rpc/ethereum` | +| **Mainnet** | Start Zetacored Node | `make start-mainnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/rpc/zetacored` | +| **Mainnet** | Stop Zetacored Node | `make stop-mainnet-zetarpc-node` | `contrib/rpc/zetacored` | +| **Mainnet** | Clean Zetacored Node Data | `make clean-mainnet-zetarpc-node` | `contrib/rpc/zetacored` | +| **Testnet (Athens3)** | Start Zetacored Node | `make start-testnet-zetarpc-node DOCKER_TAG=ubuntu-v14.0.1` | `contrib/rpc/zetacored` | +| **Testnet (Athens3)** | Stop Zetacored Node | `make stop-testnet-zetarpc-node` | `contrib/rpc/zetacored` | +| **Testnet (Athens3)** | Clean Zetacored Node Data | `make clean-testnet-zetarpc-node` | `contrib/rpc/zetacored` | +| **Mainnet Local Build** | Start Zetacored Node | `make start-zetacored-rpc-mainnet-localbuild` | `contrib/rpc/zetacored` | +| **Mainnet Local Build** | Stop Zetacored Node | `make stop-zetacored-rpc-mainnet-localbuild` | `contrib/rpc/zetacored` | +| **Mainnet Local Build** | Clean Zetacored Node Data | `make clean-zetacored-rpc-mainnet-localbuild` | `contrib/rpc/zetacored` | +| **Testnet Local Build (Athens3)** | Start Zetacored Node | `make start-zetacored-rpc-testnet-localbuild` | `contrib/rpc/zetacored` | +| **Testnet Local Build (Athens3)** | Stop Zetacored Node | `make stop-zetacored-rpc-testnet-localbuild` | `contrib/rpc/zetacored` | +| **Testnet Local Build (Athens3)** | Clean Zetacored Node Data | `make clean-zetacored-rpc-testnet-localbuild` | `contrib/rpc/zetacored` | ### Bitcoin Node Setup for Mainnet From e82a7d77651783a0ada930f29dcb476f72b896e6 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Tue, 30 Apr 2024 18:24:16 -0600 Subject: [PATCH 15/16] updated the script to ensure the local builds never load the wrong binary and updated inline with comments I got --- Dockerfile | 3 ++- contrib/docker-scripts/start.sh | 6 ++++-- contrib/rpc/ethereum/docker-compose.yml | 4 ++-- contrib/rpc/zetacored/init_docker_compose.sh | 7 +++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4dbcd0693..570a08ec4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,8 @@ COPY . . RUN expected_major_version=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ make install VERSION="${expected_major_version}" && \ - echo -n "${expected_major_version}" > /go/delivery/zeta-node/expected_major_version + git_hash=$(git rev-parse --short HEAD) && \ + echo -n "${expected_major_version}-${git_hash}" > /go/delivery/zeta-node/expected_major_version # Run Stage FROM alpine:3.18 diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 0e94a2001a..6e2cebaf1f 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -238,14 +238,16 @@ function move_zetacored_binaries { function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored + find /root/.zetacored/cosmovisor/upgrades/ -type f -path "*/bin/zetacored" -exec cp /usr/local/bin/zetacored {} \; fi - expected_major_version=$(cat /scripts/expected_major_version) + expected_major_version=$(cat /scripts/expected_major_version | cut -d '-' -f 1) VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') 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]*') - logt "expected_major_version: ${expected_major_version}" + logt "EXPECTED_VERSION_WITH_HASH: $(cat /scripts/expected_major_version | cut -d '-' -f 1)" + logt "EXPECTED_MAJOR_VERSION: ${expected_major_version}" logt "VISOR_VERSION: ${VISOR_VERSION}" logt "DAEMON_VERSION: ${DAEMON_VERSION}" logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" diff --git a/contrib/rpc/ethereum/docker-compose.yml b/contrib/rpc/ethereum/docker-compose.yml index 9c199ecef3..c2e433d22e 100644 --- a/contrib/rpc/ethereum/docker-compose.yml +++ b/contrib/rpc/ethereum/docker-compose.yml @@ -12,8 +12,8 @@ services: geth: build: . ports: - - "8545:8545" # JSON-RPC - - "8546:8546" # WebSocket + - "18545:18545" # JSON-RPC + - "18546:18546" # WebSocket - "30303:30303" # P2P Network volumes: - type: volume diff --git a/contrib/rpc/zetacored/init_docker_compose.sh b/contrib/rpc/zetacored/init_docker_compose.sh index 4e934dd2ff..04e9f6857c 100644 --- a/contrib/rpc/zetacored/init_docker_compose.sh +++ b/contrib/rpc/zetacored/init_docker_compose.sh @@ -58,5 +58,8 @@ echo "Placeholders have been replaced in $FILE_PATH." cat $FILE_PATH echo "================" -# Run Docker Compose -docker-compose -f ${FILE_PATH} up \ No newline at end of file +if [ "$TYPE" == "image" ]; then + docker-compose -f ${FILE_PATH} up +elif [ "$TYPE" == "localbuild" ]; then + docker-compose -f ${FILE_PATH} up --build +fi From e02c4b93bd8e5792b9908d7ce655873b5e338659 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 1 May 2024 09:38:42 -0600 Subject: [PATCH 16/16] updated --- changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 776a3ea304..bb2f5e881c 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,9 @@ ## Unreleased +### CI +* [2070](https://github.com/zeta-chain/node/pull/2070) - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. + ### Refactor * [2032](https://github.com/zeta-chain/node/pull/2032) - improve some general structure of the ZetaClient codebase @@ -108,7 +111,6 @@ ### CI -* [2070](https://github.com/zeta-chain/node/pull/2070) - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes. * [1958](https://github.com/zeta-chain/node/pull/1958) - Fix e2e advanced test debug checkbox. * [1945](https://github.com/zeta-chain/node/pull/1945) - update advanced testing pipeline to not execute tests that weren't selected so they show skipped instead of skipping steps. * [1940](https://github.com/zeta-chain/node/pull/1940) - adjust release pipeline to be created as pre-release instead of latest