Skip to content

Commit

Permalink
Build image with different pre and post upgrade versions for testnet (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-dydx authored Sep 4, 2024
1 parent c466502 commit c965b80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions protocol/testing/testnet/testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ install_prerequisites() {

set_cosmovisor_binary_permissions() {
# Set up upgrade binaries.
for version in "${!version_to_url[@]}"; do
for version in "${!testnet_version_to_url[@]}"; do
echo "Setting up version ${version}..."
version_dir="$HOME/cosmovisor/upgrades/$version"
mkdir -p "$version_dir/bin"
url=${version_to_url[$version]}
url=${testnet_version_to_url[$version]}
tar_file=$(basename $url)

echo "Downloading tar file from ${url}..."
Expand All @@ -32,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/bin"
current_version_path="$HOME/cosmovisor/upgrades/$TESTNET_CURRENT_VERSION/bin"
mkdir -p $current_version_path
cp /bin/dydxprotocold $current_version_path
}
Expand Down
6 changes: 6 additions & 0 deletions protocol/testing/version/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ CURRENT_VERSION=$(<VERSION_CURRENT)
PREUPGRADE_VERSION=$(<VERSION_PREUPGRADE)
PREUPGRADE_VERSION_FULL_NAME=$(<VERSION_FULL_NAME_PREUPGRADE)

TESTNET_CURRENT_VERSION="v6.0.0_testnet_fix"
TESTNET_PREUPGRADE_VERSION="v6.0.0"
TESTNET_PREUPGRADE_VERSION_FULL_NAME="v6.0.2"

# Define the mapping from version to amd64 URL
declare -A version_to_url
version_to_url["$PREUPGRADE_VERSION"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$PREUPGRADE_VERSION_FULL_NAME/dydxprotocold-$PREUPGRADE_VERSION_FULL_NAME-linux-amd64.tar.gz"
declare -A testnet_version_to_url
testnet_version_to_url["$TESTNET_PREUPGRADE_VERSION"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$TESTNET_PREUPGRADE_VERSION_FULL_NAME/dydxprotocold-$TESTNET_PREUPGRADE_VERSION_FULL_NAME-linux-amd64.tar.gz"

0 comments on commit c965b80

Please sign in to comment.