-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into test-fungible-module
- Loading branch information
Showing
83 changed files
with
5,125 additions
and
1,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This Dockerfile is used to build a Docker image for Anvil, a localnet for testing purposes. | ||
# Currently we directly set the chain ID to 11155111 and expose the default Anvil port specifically for the chain migration test. | ||
|
||
# Start from the latest Rust image as Anvil is built with Rust | ||
FROM ghcr.io/foundry-rs/foundry:latest | ||
|
||
# Expose the default Anvil port | ||
EXPOSE 8545 | ||
|
||
# Run Anvil with specified chain ID and a prefunded account when the container starts | ||
ENTRYPOINT ["anvil", "--host", "0.0.0.0", "--chain-id", "11155111"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
contrib/localnet/orchestrator/restart-zetaclientd-at-upgrade.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to restart zetaclientd after an upgrade | ||
# It waits for the upgrade height to be reached and then restarts the zetaclientd on all nodes in the network | ||
# It interacts with the network using the zetaclientd binary | ||
|
||
clibuilder() | ||
{ | ||
echo "" | ||
echo "Usage: $0 -u UPGRADE_HEIGHT" | ||
echo -e "\t-u Height of upgrade, should match governance proposal" | ||
echo -e "\t-n Number of clients in the network" | ||
exit 1 # Exit script after printing help | ||
} | ||
|
||
while getopts "u:n:" opt | ||
do | ||
case "$opt" in | ||
u ) UPGRADE_HEIGHT="$OPTARG" ;; | ||
n ) NUM_OF_NODES="$OPTARG" ;; | ||
? ) clibuilder ;; # Print cliBuilder in case parameter is non-existent | ||
esac | ||
done | ||
|
||
# generate client list | ||
START=0 | ||
END=$((NUM_OF_NODES-1)) | ||
CLIENT_LIST=() | ||
for i in $(eval echo "{$START..$END}") | ||
do | ||
CLIENT_LIST+=("zetaclient$i") | ||
done | ||
|
||
echo "$UPGRADE_HEIGHT" | ||
|
||
CURRENT_HEIGHT=0 | ||
|
||
while [[ $CURRENT_HEIGHT -lt $UPGRADE_HEIGHT ]] | ||
do | ||
CURRENT_HEIGHT=$(curl -s zetacore0:26657/status | jq '.result.sync_info.latest_block_height' | tr -d '"') | ||
echo current height is "$CURRENT_HEIGHT", waiting for "$UPGRADE_HEIGHT" | ||
sleep 5 | ||
done | ||
|
||
echo upgrade height reached, restarting zetaclients | ||
|
||
for NODE in "${CLIENT_LIST[@]}"; do | ||
ssh -o "StrictHostKeyChecking no" "$NODE" -i ~/.ssh/localtest.pem killall zetaclientd | ||
ssh -o "StrictHostKeyChecking no" "$NODE" -i ~/.ssh/localtest.pem "$GOPATH/bin/new/zetaclientd start < /root/password.file > $HOME/zetaclient.log 2>&1 &" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to restart zetaclientd after an upgrade | ||
# It waits for the upgrade height to be reached and then restarts the zetaclientd on all nodes in the network | ||
# It interacts with the network using the zetaclientd binary | ||
# This script immediately restarts the zetaclientd on zetaclient0 and zetaclient1 containers in the network | ||
|
||
clibuilder() | ||
{ | ||
echo "" | ||
echo "Usage: $0 -u UPGRADE_HEIGHT" | ||
echo -e "\t-u Height of upgrade, should match governance proposal" | ||
echo -e "\t-n Number of clients in the network" | ||
exit 1 # Exit script after printing help | ||
} | ||
echo restarting zetaclients | ||
|
||
while getopts "u:n:" opt | ||
do | ||
case "$opt" in | ||
u ) UPGRADE_HEIGHT="$OPTARG" ;; | ||
n ) NUM_OF_NODES="$OPTARG" ;; | ||
? ) clibuilder ;; # Print cliBuilder in case parameter is non-existent | ||
esac | ||
done | ||
ssh -o "StrictHostKeyChecking no" "zetaclient0" -i ~/.ssh/localtest.pem killall zetaclientd | ||
ssh -o "StrictHostKeyChecking no" "zetaclient1" -i ~/.ssh/localtest.pem killall zetaclientd | ||
ssh -o "StrictHostKeyChecking no" "zetaclient0" -i ~/.ssh/localtest.pem "/usr/local/bin/zetaclientd start < /root/password.file > $HOME/zetaclient.log 2>&1 &" | ||
ssh -o "StrictHostKeyChecking no" "zetaclient1" -i ~/.ssh/localtest.pem "/usr/local/bin/zetaclientd start < /root/password.file > $HOME/zetaclient.log 2>&1 &" | ||
|
||
# generate client list | ||
START=0 | ||
END=$((NUM_OF_NODES-1)) | ||
CLIENT_LIST=() | ||
for i in $(eval echo "{$START..$END}") | ||
do | ||
CLIENT_LIST+=("zetaclient$i") | ||
done | ||
|
||
echo "$UPGRADE_HEIGHT" | ||
|
||
CURRENT_HEIGHT=0 | ||
|
||
while [[ $CURRENT_HEIGHT -lt $UPGRADE_HEIGHT ]] | ||
do | ||
CURRENT_HEIGHT=$(curl -s zetacore0:26657/status | jq '.result.sync_info.latest_block_height' | tr -d '"') | ||
echo current height is "$CURRENT_HEIGHT", waiting for "$UPGRADE_HEIGHT" | ||
sleep 5 | ||
done | ||
|
||
echo upgrade height reached, restarting zetaclients | ||
|
||
for NODE in "${CLIENT_LIST[@]}"; do | ||
ssh -o "StrictHostKeyChecking no" "$NODE" -i ~/.ssh/localtest.pem killall zetaclientd | ||
ssh -o "StrictHostKeyChecking no" "$NODE" -i ~/.ssh/localtest.pem "$GOPATH/bin/new/zetaclientd start < /root/password.file > $HOME/zetaclient.log 2>&1 &" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.