Cosmovisor Example

The purpose of this document is to inform the users on how to upgrade the chain to v0.3.5 using cosmovisor. All processes mentioned in this document must be conducted on the binary v0.3.3 preconfigured chain server.

Cosmovisor download & setup

1. Download Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

2. Using the command below

sudo mv ~/go/bin/cosmovisor /usr/local/bin/cosmovisor

3. Setup environment

echo "# [FirmaChain] Setup Cosmovisor" >> ~/.profile
echo "export DAEMON_NAME=firmachaind" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.firmachain" >> ~/.profile
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=false" >> ~/.profile
echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.profile
echo "export DAEMON_POLL_INTERVAL=300" >> ~/.profile
echo "export UNSAFE_SKIP_BACKUP=false" >> ~/.profile
echo "export DAEMON_PREUPGRADE_MAX_RETRIES=0" >> ~/.profile

Once you've applied all environment variables, please reload the .profile file by running the command provided below.

source ~/.profile

If all environment variables have been registered successfully, you can input the command provided below to get an output on the registered variables.

echo $DAEMON_NAME
=> firmachaind

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

※ In case of 1.0.0 version.

  • Please execute the command below. If you don't execute this command, you can't run cosmovisor.

echo "{}" >> /home/firma/.firmachain/cosmovisor/current/upgrade-info.json

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

In order to launch cosmovisor, please enter the command provided below.

$ cosmovisor run start
7:44AM INF running app args=["start"] module=cosmovisor path=/home/firma/.firmachain/cosmovisor/genesis/bin/firmachaind
7:44AM INF starting ABCI with Tendermint
7:44AM INF Starting multiAppConn service impl=multiAppConn module=proxy
7:44AM INF Starting localClient service connection=query impl=localClient module=abci-client
7:44AM INF Starting localClient service connection=snapshot impl=localClient module=abci-client
7:44AM INF Starting localClient service connection=mempool impl=localClient module=abci-client
7:44AM INF Starting localClient service connection=consensus impl=localClient module=abci-client
7:44AM INF Starting EventBus service impl=EventBus module=events
7:44AM INF Starting PubSub service impl=PubSub module=pubsub
7:44AM INF Starting IndexerService service impl=IndexerService module=txindex
7:44AM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 software-version=0.3.3
7:44AM INF ABCI Replay Blocks appHeight=0 module=consensus stateHeight=0 storeHeight=0
7:44AM INF asserting crisis invariants inv=0/11 module=x/crisis name=gov/module-account
7:44AM INF asserting crisis invariants inv=1/11 module=x/crisis name=distribution/nonnegative-outstanding
7:44AM INF asserting crisis invariants inv=2/11 module=x/crisis name=distribution/can-withdraw
7:44AM INF asserting crisis invariants inv=3/11 module=x/crisis name=distribution/reference-count
7:44AM INF asserting crisis invariants inv=4/11 module=x/crisis name=distribution/module-account
7:44AM INF asserting crisis invariants inv=5/11 module=x/crisis name=bank/nonnegative-outstanding
7:44AM INF asserting crisis invariants inv=6/11 module=x/crisis name=bank/total-supply
7:44AM INF asserting crisis invariants inv=7/11 module=x/crisis name=staking/module-accounts
7:44AM INF asserting crisis invariants inv=8/11 module=x/crisis name=staking/nonnegative-power
7:44AM INF asserting crisis invariants inv=9/11 module=x/crisis name=staking/positive-delegation
7:44AM INF asserting crisis invariants inv=10/11 module=x/crisis name=staking/delegator-shares
...
12:55PM INF ABCI Replay Blocks appHeight=1 module=consensus stateHeight=1 storeHeight=1

Now, Cosmovisor is up and running.

Upgrade version binary download & setup

The user must already be running FirmaChain v0.3.3 and this process illustrates the necessary preparations to upgrade the chain to v0.3.5 using Software Proposal.

1. Folder Structure Setting

mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades/v0.3.5/bin

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

※ In case of 1.0.0 version.

  • Please execute the command below. If you don't execute this command, you can't run cosmovisor.

echo "{}" >> /home/firma/.firmachain/cosmovisor/current/upgrade-info.json

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

2. Prepare firmachaind binary

git clone https://github.com/firmachain/firmachain.git
cd firmachain
git pull or git checkout v0.3.5
make install

3. Copy and Paste the Binary File to the Cosmovisor Upgrade Folder Directory

mv go/bin/firmachaind $DAEMON_HOME/cosmovisor/upgrades/v0.3.5/bin/firmachaind

Post-Upgrade

cosmovisor should be up and running using the upgraded file in v0.3.5/bin folder. Please use the command provided below to check the upgraded binary version.

$ cosmovisor run version
8:02AM INF running app args=["version"] module=cosmovisor path=/home/firma/.firmachain/cosmovisor/upgrades/v0.3.5/bin/firmachaind
0.3.5-beta3-1-g4a1ba1c

Last updated