Running "Canis Major" network upgrade with cosmovisor
Warning:
It is recommended that cosmovisor is better to be used on full nodes rather than validators as currently there's a potential race condition: cosmos/cosmos-sdk#9384
Step 0 - Install cosmosviosr
One can follow this link to install.
Alternatively, run the below commands instead
$ git clone https://github.com/cosmos/cosmos-sdk.git
$ cd cosmos-sdk/cosmovisor
$ make cosmovisor
Step 1 - Set up Environment Variables
Set your Environment Variables for cosmovisor to run
export DAEMON_NAME=chain-maind
export DAEMON_HOME=/home/ubuntu/.chain-maind
export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_ALLOW_DOWNLOAD_BINARIES=true
export DAEMON_LOG_BUFFER_SIZE=512
Step 1.1 - Create cosmovisor folder structure
One can follow this folder structure
.chain-maind/
βββ config
βΒ
βββ cosmovisor
βΒ Β βββ current -> genesis or upgrades/v3.3.0
βΒ Β βββ genesis
βΒ Β β βββ bin
βΒ Β β βββ chain-maind
β βββ upgrades
β βββ v3.3.0
β βββ bin
β βββ chain-maind
βββ data
For .chain-maind/cosmovisor/genesis/bin/chain-maind
, it is the binary before the upgrade proceeds. In our case of the "DRACO II" upgrade, it should be chain-maind with version 2.*
. Kindly have this binary ready before running cosmovisor.
Step 2. - Run everything
Start
cosmovisor
, e.g.:
$ ./cosmovisor start
Since we enable DAEMON_ALLOW_DOWNLOAD_BINARIES=true
, cosmovisor will automatically download binary with 3.3.1
in ./cosmovisor/upgrades/v2.0.0/bin/chain-maind
and update ./cosmovisor/current
directory symlink to upgrades/v3.3.0
instead when proposed upgrade log is found. cosmovisor will create ./cosmovisor/upgrades/v3.3.0/bin/chain-maind
for you.
Last updated