Running "Canis Major" network upgrade with cosmovisor

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

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.:

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.

Important: If one doesn't want to enable DAEMON_ALLOW_DOWNLOAD_BINARIES, one should prepare ./cosmovisor/upgrades/v3.3.0/bin/chain-maind manually before upgrade time. Linux, Mac and Windows are also available.

Tip: Example of running cosmovisor with systemd

Last updated