Skip to content

Commit

Permalink
test: added upgrade test with cosmovisor
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Dec 5, 2024
1 parent 33e4987 commit 78cd939
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
File renamed without changes.
31 changes: 31 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ RUN wget -qO- https://github.com/KYVENetwork/chain/releases/download/v1.0.0/kyve
&& ~/bins/kyved-v1.0.0 init ksync --chain-id kyve-1 \
&& wget https://raw.githubusercontent.com/KYVENetwork/networks/main/kyve-1/genesis.json -O ~/.kyve/config/genesis.json

# install cosmovisor with all kyve versions for upgrade testing
RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.6.0

ENV DAEMON_HOME=/root/.kyve
ENV DAEMON_NAME=kyved

RUN cosmovisor init ~/bins/kyved-v1.0.0

RUN wget -qO- https://github.com/KYVENetwork/chain/releases/download/v1.1.3/kyved_mainnet_linux_amd64.tar.gz | tar -xzv \
&& cosmovisor add-upgrade v1.1.0 kyved

RUN wget -qO- https://github.com/KYVENetwork/chain/releases/download/v1.2.2/kyved_mainnet_linux_amd64.tar.gz | tar -xzv \
&& cosmovisor add-upgrade v1.2.0 kyved

RUN wget -qO- https://github.com/KYVENetwork/chain/releases/download/v1.3.2/kyved_mainnet_linux_amd64.tar.gz | tar -xzv \
&& cosmovisor add-upgrade v1.3.0 kyved

RUN wget -qO- https://github.com/KYVENetwork/chain/releases/download/v1.4.0/kyved_mainnet_linux_amd64.tar.gz | tar -xzv \
&& cosmovisor add-upgrade v1.4.0 kyved

RUN wget https://github.com/KYVENetwork/chain/releases/download/v1.5.0/kyved_mainnet_linux_amd64 -O kyved \
&& chmod +x kyved \
&& cosmovisor add-upgrade v1.5.0 kyved

# install dydxprotocold
RUN wget -qO- https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv2.0.1/dydxprotocold-v2.0.1-linux-amd64.tar.gz | tar -xzv \
&& mv build/dydxprotocold-v2.0.1-linux-amd64 ~/bins/dydxprotocold-v2.0.1 \
Expand Down Expand Up @@ -55,3 +79,10 @@ RUN git clone --depth 1 --branch v0.1.1-beta-patch https://github.com/andromedap
&& cd .. \
&& rm -r andromedad \
&& sed -i -r 's/minimum-gas-prices = ""/minimum-gas-prices = "0uandr"/' ~/.andromeda/config/app.toml

# install nobled
RUN wget https://github.com/noble-assets/noble/releases/download/v8.0.3/nobled_linux-amd64 \
&& chmod +x nobled_linux-amd64 \
&& mv nobled_linux-amd64 ~/bins/nobled-v8.0.3 \
&& ~/bins/nobled-v8.0.3 init ksync --chain-id noble-1 \
&& wget https://raw.githubusercontent.com/strangelove-ventures/noble-networks/main/mainnet/noble-1/genesis.json -O ~/.noble/config/genesis.json
15 changes: 15 additions & 0 deletions tests/height_sync_test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
[ "$status" -eq 0 ]
}

@test "KYVE Cosmovisor: try to height-sync with an upgrade betweeen snapshot and target height" {
run ./build/ksync height-sync --opt-out -b cosmovisor -c kaon-1 -t 2061120 -d -a -y
[ "$status" -eq 0 ]
}

@test "dYdX: height sync to specific height" {
run ./build/ksync height-sync --opt-out -b $HOME/bins/dydxprotocold-v2.0.1 -c kaon-1 -t 5935178 -r -d -y
[ "$status" -eq 0 ]
Expand All @@ -27,3 +32,13 @@
run ./build/ksync height-sync --opt-out -b $HOME/bins/andromedad-1-v0.1.1-beta-patch -c kaon-1 -t 2700020 -r -d -y
[ "$status" -eq 0 ]
}

@test "Noble: height-sync to specific height" {
run ./build/ksync height-sync --opt-out -b $HOME/bins/nobled-v8.0.3 -t 16557020 -r -d -y
[ "$status" -eq 0 ]
}

@test "Noble: height-sync to specific height on snapshot height" {
run ./build/ksync height-sync --opt-out -b $HOME/bins/nobled-v8.0.3 -t 16554000 -r -d -y
[ "$status" -eq 0 ]
}

0 comments on commit 78cd939

Please sign in to comment.