MediBloc Panacea
Comment on page


cosmovisor is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, cosmovisor can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.
We will explain how to use it based on version 1.4.0 of cosmovisor.
For a more detailed explanation, see the official cosmovisor documentation.

Cosmovisor Setup

Install the cosmovisor binary.
You will find a cosmovisor in path $GOPATH/bin.
go install # Current version v1.4.0
Set the required environment variabes.
There are four variables. (two are requirement, and two are optional)
  • DAEMON_HOME (Requirement)
    • This includes genesis binary and upgrade binaries.
    • export DAEMON_HOME=$HOME/.panacea
  • DAEMON_NAME (Requirement)
    • It's the name of binary.
    • export DAEMON_NAME=panacead
    • Whether to automatically download the new binary.
    • The default value is false.
    • Unfortunately, automatic download is not available yet.(by
    • Whether to restart the process after the upgrade is completed.
    • The default value is true.
    • allow a node operator to define a delay between the node halt (for upgrade) and backup by the specified time.
    • The value must be a duration.(e.g. 1s)
    • The default value is none.
    • export DAEMON_RESTART_DELAY=1s`
    • Use this option to set a custom backup directory. If not set, $DAEMON_HOME is used.
    • If set to true, upgrades directly without performing a backup.
    • Otherwise (false, default) backs up the data before trying the upgrade.
    • The default value of false is useful and recommended in case of failures and when a backup needed to rollback.
    • We recommend using the default backup option UNSAFE_SKIP_BACKUP=false.
    • The maximum number of times to call pre-upgrade in the application after exit status of 31.
    • After the maximum number of retries, cosmovisor fails the upgrade.
    • The default value is 0
We make setting to manually download the binary and to automatically proceed with the upgrade.


Set the necessary environment variables. Below are the default settings for panacea.
export DAEMON_HOME=$HOME/.panacea
export DAEMON_NAME=panacead
Create a directory for the genesis binary. The current version of binary should be under the directory.
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
Clone and check out the current panacead mainnet version.
git clone -b tags/[current-active-version]
cd panacea-core
Build a binary and copy it to the genesis path of the cosmovisor.
make clean && make build
cp ./build/panacead $DAEMON_HOME/cosmovisor/genesis/bin
Discontinue the currently running panacead and run it with cosmovisor.
stop panacead
cosmovisor start

Upgrade chain

cosmovisor supports chain upgrades automatically. This requires some preliminary work.
You need to create a directory for the binary to be upgraded.
# Generally, [upgrade-version] refers to the 'Name' value set in the SoftwareUpgradeProposal.
mkdir -p $DAEMON_HOME/cosmovisor/upgrades/[upgrade-version]/bin
Generate a new binary and navigate to the directory you created above.
git clone -b tags/[upgrade-version]
cd panacea-core
make clean && make build
cp ./build/panacead $DAEMON_HOME/cosmovisor/upgrades/[upgrade-version]/bin
The upgrade is complete when the chain reaches the target height of upgrade. The binary is replaced by cosmovisor automatically, and the chain is started.