From 8c261fad911ff30b4c3058c6186880186f9295ca Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 24 Apr 2024 21:58:06 -0600 Subject: [PATCH] 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 }