forked from lavanet/lava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade before checking out to a different branch to migrate to
- Loading branch information
1 parent
bcc8a51
commit 47637e6
Showing
7 changed files
with
104 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package v3 | ||
package v2 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
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 | ||
export DAEMON_NAME=lavad | ||
export CHAIN_ID=lava | ||
export DAEMON_HOME=$HOME/.lava | ||
export DAEMON_RESTART_AFTER_UPGRADE=true | ||
export UPRADE_NAME=v2 | ||
echo "env vars set" |
60 changes: 60 additions & 0 deletions
60
scripts/upgrade/start_upgradeable_module_setup_and_run_node.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,60 @@ | ||
#!/bin/bash | ||
MYDIR="$(dirname "$(realpath "$0")")" | ||
echo "$MYDIR" | ||
source $MYDIR/env_vars_for_upgrade.sh | ||
|
||
# maybe we need to | ||
# rm -rf $DAEMON_HOME | ||
ignite chain build | ||
ignite chain init | ||
|
||
echo "binary name: $DAEMON_NAME" | ||
echo "cosmovisor path: $DAEMON_NAME" | ||
echo "removing old cosmovisor dir $DAEMON_HOME/cosmovisor" | ||
rm -rf $DAEMON_HOME/cosmovisor | ||
echo "creating $DAEMON_HOME/cosmovisor/genesis/bin" | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin | ||
echo "copying /home/user/go/bin/lavad to $DAEMON_HOME/cosmovisor/genesis/bin" | ||
cp $HOME/go/bin/lavad $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
cosmovisor start start | ||
|
||
# option 1. rebuild, put new binary into the cosmovisor directory of upgrades | ||
# option 2. fetch the binary from a server. | ||
|
||
# next step: | ||
# run upgrade a running module from a different terminal. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# an example for a proposal with upgrade binaries with remote path to binary file. (this requires that the wont be a binary file in | ||
# the cosmovisor upgrade path) | ||
|
||
# tx gov submit-proposal software-upgrade Vega \ | ||
# --title Vega \ | ||
# --deposit 100uatom \ | ||
# --upgrade-height 7368420 \ | ||
# --upgrade-info '{"binaries":{"linux/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-amd64","linux/arm64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-arm64","darwin/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-darwin-amd64"}}' \ | ||
# --description "upgrade to Vega" \ | ||
# --gas 400000 \ | ||
# --from user \ | ||
# --chain-id test \ | ||
# --home test/val2 \ | ||
# --node tcp://localhost:36657 \ | ||
# --yes |
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 | ||
MYDIR="$(dirname "$(realpath "$0")")" | ||
echo "$MYDIR" | ||
source $MYDIR/env_vars_for_upgrade.sh | ||
# git checkout some branch here | ||
ignite chain build | ||
|
||
echo "mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPRADE_NAME/bin" | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPRADE_NAME/bin | ||
cp $HOME/go/bin/lavad $DAEMON_HOME/cosmovisor/upgrades/$UPRADE_NAME/bin | ||
echo "cp $HOME/go/bin/lavad $DAEMON_HOME/cosmovisor/upgrades/$UPRADE_NAME/bin" | ||
|
||
for i in $(lavad q block | tr "," "\n"); | ||
do | ||
if [[ "$i" == *"height"* ]]; then | ||
BLOCK_HEIGHT=$(echo $i | sed 's/"//g' | sed 's/height://') | ||
break | ||
fi | ||
done | ||
|
||
BLOCK_HEIGHT_CHOSEN=$(echo "$((BLOCK_HEIGHT + 20))") | ||
|
||
lavad tx gov submit-proposal software-upgrade $UPRADE_NAME --title upgrade --description upgrade --upgrade-height $BLOCK_HEIGHT_CHOSEN --from alice --yes --gas "auto" | ||
lavad tx gov deposit 1 10000000ulava --from alice --yes --gas "auto" | ||
lavad tx gov vote 1 yes --from alice --yes --gas "auto" | ||
echo "chosen block for upgrade: $BLOCK_HEIGHT_CHOSEN" | ||
lavad q upgrade plan | ||
# wait for upgrade. |
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