diff --git a/tests/upgrade/integration/scripts/old_binary_setup.sh b/tests/upgrade/integration/scripts/old_binary_setup.sh new file mode 100644 index 000000000..b9b56c40a --- /dev/null +++ b/tests/upgrade/integration/scripts/old_binary_setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -euox pipefail + +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +pushd "$DIR/../../../docker/localnet" + +# Generate configs (make sure old binary is installed locally) +bash gen-network-config-old-binary.sh +sudo chown -R 1000:1000 network-config + +# Start network +docker compose --env-file mainnet-latest.env up --detach --no-build + +# Import keys +bash import-keys.sh + +# TODO: Get rid of this sleep. +sleep 5 + +# Copy keys +sudo docker compose --env-file mainnet-latest.env cp network-config/validator-0/keyring-test validator-0:/home/cheqd/.cheqdnode +sudo docker compose --env-file mainnet-latest.env cp network-config/validator-1/keyring-test validator-1:/home/cheqd/.cheqdnode +sudo docker compose --env-file mainnet-latest.env cp network-config/validator-2/keyring-test validator-2:/home/cheqd/.cheqdnode +sudo docker compose --env-file mainnet-latest.env cp network-config/validator-3/keyring-test validator-3:/home/cheqd/.cheqdnode + +# Restore permissions +sudo docker compose --env-file mainnet-latest.env exec --user root validator-0 chown -R cheqd:cheqd /home/cheqd +sudo docker compose --env-file mainnet-latest.env exec --user root validator-1 chown -R cheqd:cheqd /home/cheqd +sudo docker compose --env-file mainnet-latest.env exec --user root validator-2 chown -R cheqd:cheqd /home/cheqd +sudo docker compose --env-file mainnet-latest.env exec --user root validator-3 chown -R cheqd:cheqd /home/cheqd + +popd \ No newline at end of file