-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add helper scripts and add logging for upgrade
- Loading branch information
1 parent
c966986
commit a63dbd9
Showing
7 changed files
with
58 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
docs/upgrades/1.15/bin/ | ||
.env | ||
sgx_sk.pem | ||
*.a | ||
|
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,7 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
|
||
sudo rm -fr /tmp/secretd | ||
sudo rm -fr /tmp/secretcli | ||
mkdir /tmp/secretd | ||
mkdir /tmp/secretcli |
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 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
|
||
UPGRADE_BLOCK="$(docker exec node bash -c 'secretd status | jq "(.SyncInfo.latest_block_height | tonumber) + 30"')" | ||
# Propose upgrade | ||
PROPOSAL_ID="$(docker exec node bash -c "secretd tx gov submit-proposal software-upgrade v1.15 --upgrade-height $UPGRADE_BLOCK --title blabla --description yolo --deposit 100000000uscrt --from a -y -b block | jq '.logs[0].events[] | select(.type == \"submit_proposal\") | .attributes[] | select(.key == \"proposal_id\") | .value | tonumber'")" | ||
# Vote yes (voting period is 90 seconds) | ||
docker exec node bash -c "secretd tx gov vote ${PROPOSAL_ID} yes --from a -y -b block" | ||
|
||
echo "PROPOSAL_ID = ${PROPOSAL_ID}" | ||
echo "UPGRADE_BLOCK = ${UPGRADE_BLOCK}" |
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,28 @@ | ||
#!/bin/bash | ||
set -o xtrace | ||
|
||
docker exec bootstrap bash -c 'rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin' | ||
docker exec node bash -c 'rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin' | ||
# update bootstrap | ||
docker cp ./bin/secretd bootstrap:/tmp/upgrade-bin | ||
docker cp ./bin/librust_cosmwasm_enclave.signed.so bootstrap:/tmp/upgrade-bin | ||
docker cp ./bin/libgo_cosmwasm.so bootstrap:/tmp/upgrade-bin | ||
# update node | ||
docker cp ./bin/secretd node:/tmp/upgrade-bin | ||
docker cp ./bin/librust_cosmwasm_enclave.signed.so node:/tmp/upgrade-bin | ||
docker cp ./bin/libgo_cosmwasm.so node:/tmp/upgrade-bin | ||
docker cp ./bin/librandom_api.so node:/tmp/upgrade-bin | ||
docker cp ./bin/tendermint_enclave.signed.so node:/tmp/upgrade-bin | ||
# stop node's secretd | ||
docker exec node bash -c 'pkill -9 secretd' | ||
# copy over updated binaries | ||
docker exec bootstrap bash -c 'cp /tmp/upgrade-bin/librust_cosmwasm_enclave.signed.so /usr/lib/' | ||
docker exec bootstrap bash -c 'cp /tmp/upgrade-bin/libgo_cosmwasm.so /usr/lib/' | ||
docker exec node bash -c 'cp /tmp/upgrade-bin/secretd /usr/bin/' | ||
docker exec node bash -c 'cp /tmp/upgrade-bin/librust_cosmwasm_enclave.signed.so /usr/lib/' | ||
docker exec node bash -c 'cp /tmp/upgrade-bin/libgo_cosmwasm.so /usr/lib/' | ||
|
||
# prepare a tmp dir to store validator's private key | ||
rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin | ||
docker cp bootstrap:/root/.secretd/config/priv_validator_key.json /tmp/upgrade-bin/. | ||
docker cp /tmp/upgrade-bin/priv_validator_key.json node:/root/.secretd/config/priv_validator_key.json |