diff --git a/protocol/testing/current_version.sh b/protocol/testing/current_version.sh new file mode 100755 index 0000000000..bb0a2af3aa --- /dev/null +++ b/protocol/testing/current_version.sh @@ -0,0 +1,5 @@ +CURRENT_VERSION="v6.0.0" + +# Define the mapping from version to URL +declare -A version_to_url +version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz" diff --git a/protocol/testing/mainnet/Dockerfile b/protocol/testing/mainnet/Dockerfile index f2480aa057..f5eccfcacf 100644 --- a/protocol/testing/mainnet/Dockerfile +++ b/protocol/testing/mainnet/Dockerfile @@ -3,6 +3,7 @@ FROM dydxprotocol-base RUN apk add --no-cache bash jq aws-cli RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 +COPY ./testing/current_version.sh /dydxprotocol/ COPY ./testing/mainnet/. /dydxprotocol/ ENV HOME /dydxprotocol diff --git a/protocol/testing/mainnet/cosmovisor/genesis/bin/dydxprotocold b/protocol/testing/mainnet/cosmovisor/genesis/bin/dydxprotocold deleted file mode 100755 index 3e1b0984dc..0000000000 Binary files a/protocol/testing/mainnet/cosmovisor/genesis/bin/dydxprotocold and /dev/null differ diff --git a/protocol/testing/mainnet/mainnet.sh b/protocol/testing/mainnet/mainnet.sh index 90fc34ca92..c656fd5267 100755 --- a/protocol/testing/mainnet/mainnet.sh +++ b/protocol/testing/mainnet/mainnet.sh @@ -7,10 +7,6 @@ source "./vars.sh" CHAIN_ID="dydx-mainnet-1" -# Define the mapping from version to URL -declare -A version_to_url -version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz" - # Define dependencies for this script. # `jq` and `dasel` are used to manipulate json and yaml files respectively. install_prerequisites() { @@ -18,10 +14,6 @@ install_prerequisites() { } set_cosmovisor_binary_permissions() { - # The genesis binary should always exist. - for f in $HOME/cosmovisor/genesis/bin/* ; do - chmod 755 $f - done # Set up upgrade binaries. for version in "${!version_to_url[@]}"; do echo "Setting up version ${version}..." @@ -39,7 +31,7 @@ set_cosmovisor_binary_permissions() { chmod 755 "$version_dir/bin/dydxprotocold" echo "Successfully set up $version_dir/bin/dydxprotocold" done - current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION_DIR/bin" + current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION/bin" mkdir -p $current_version_path cp /bin/dydxprotocold $current_version_path } diff --git a/protocol/testing/mainnet/vars.sh b/protocol/testing/mainnet/vars.sh index f8337f11c9..c786aeca5f 100755 --- a/protocol/testing/mainnet/vars.sh +++ b/protocol/testing/mainnet/vars.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail -CURRENT_VERSION_DIR="v6.0.0" +source "./current_version.sh" # Full node home directories will be set up for indices 0 to LAST_FULL_NODE_INDEX LAST_FULL_NODE_INDEX=5 diff --git a/protocol/testing/testnet/Dockerfile b/protocol/testing/testnet/Dockerfile index 5298e065ef..b79ee15e56 100644 --- a/protocol/testing/testnet/Dockerfile +++ b/protocol/testing/testnet/Dockerfile @@ -3,6 +3,7 @@ FROM dydxprotocol-base RUN apk add --no-cache bash jq aws-cli RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 +COPY ./testing/current_version.sh /dydxprotocol/ COPY ./testing/testnet/. /dydxprotocol/ ENV HOME /dydxprotocol diff --git a/protocol/testing/testnet/cosmovisor/genesis/bin/dydxprotocold b/protocol/testing/testnet/cosmovisor/genesis/bin/dydxprotocold deleted file mode 100755 index 3e1b0984dc..0000000000 Binary files a/protocol/testing/testnet/cosmovisor/genesis/bin/dydxprotocold and /dev/null differ diff --git a/protocol/testing/testnet/testnet.sh b/protocol/testing/testnet/testnet.sh index c4589eeb3d..903ed4bbaf 100755 --- a/protocol/testing/testnet/testnet.sh +++ b/protocol/testing/testnet/testnet.sh @@ -8,10 +8,6 @@ source "./vars.sh" CHAIN_ID="dydx-testnet-1" -# Define the mapping from version to URL -declare -A version_to_url -version_to_url["v5.2.0"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv5.2.0/dydxprotocold-v5.2.0-linux-amd64.tar.gz" - # Define dependencies for this script. # `jq` and `dasel` are used to manipulate json and yaml files respectively. install_prerequisites() { @@ -19,10 +15,6 @@ install_prerequisites() { } set_cosmovisor_binary_permissions() { - # The genesis binary should always exist. - for f in $HOME/cosmovisor/genesis/bin/* ; do - chmod 755 $f - done # Set up upgrade binaries. for version in "${!version_to_url[@]}"; do echo "Setting up version ${version}..." @@ -40,7 +32,7 @@ set_cosmovisor_binary_permissions() { chmod 755 "$version_dir/bin/dydxprotocold" echo "Successfully set up $version_dir/bin/dydxprotocold" done - current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION_DIR/bin" + current_version_path="$HOME/cosmovisor/upgrades/$CURRENT_VERSION/bin" mkdir -p $current_version_path cp /bin/dydxprotocold $current_version_path } diff --git a/protocol/testing/testnet/vars.sh b/protocol/testing/testnet/vars.sh index 5b83e7a208..ffb9161bec 100755 --- a/protocol/testing/testnet/vars.sh +++ b/protocol/testing/testnet/vars.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eo pipefail -CURRENT_VERSION_DIR="v6.0.0" +source "./current_version.sh" # Full node home directories will be set up for indices 0 to LAST_FULL_NODE_INDEX LAST_FULL_NODE_INDEX=2