Skip to content

Commit

Permalink
updated read me docs file name and start logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukel committed Apr 25, 2024
1 parent 8c261fa commit 3634382
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 246 deletions.
36 changes: 21 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions contrib/athens3/zetacored-localbuild/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3.8'
services:
zetachain_mainnet_rpc:
zetachain_athens3_rpc:
platform: linux/amd64
build:
context: ../../..
Expand All @@ -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: ""
Expand Down
4 changes: 2 additions & 2 deletions contrib/athens3/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
69 changes: 29 additions & 40 deletions contrib/docker-scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion contrib/mainnet/zetacored-localbuild/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion contrib/mainnet/zetacored/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 3634382

Please sign in to comment.