Skip to content

Commit

Permalink
updated with latest changes, will fix the version issue when building…
Browse files Browse the repository at this point in the history
… locally
  • Loading branch information
gzukel committed Apr 24, 2024
1 parent a3945da commit 91d5f3f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 15 deletions.
28 changes: 26 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down
5 changes: 3 additions & 2 deletions contrib/athens3/zetacored-localbuild/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions contrib/athens3/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
38 changes: 32 additions & 6 deletions contrib/docker-scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 3 additions & 1 deletion contrib/mainnet/zetacored-localbuild/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions contrib/mainnet/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 91d5f3f

Please sign in to comment.