Cosmovisor Setup
Introduction
Cosmovisor is a process manager from the Cosmos SDK that wraps cronosd and switches to the correct upgrade binary automatically when the chain reaches an upgrade height. With Cosmovisor you do not need to manually swap binaries every time Cronos reaches an upgrade point, it holds all the upgrade binaries and picks the right one for you.
This page covers the generic Cosmovisor setup. It is used by the KSYNC sync flow.
Step 1: Install Cosmovisor
Install Cosmovisor with Go (go1.21 or newer):
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latestTo verify the installation, run cosmovisor version.
Step 2: Set the Cosmovisor environment variables
Cosmovisor needs to know which daemon to run and where its home directory is:
export DAEMON_NAME=cronosd
export DAEMON_HOME=$HOME/.cronosThe full set of variables (including the ones below) is also set in the systemd service file examples:
DAEMON_NAME=cronosdDAEMON_HOME=$HOME/.cronosDAEMON_ALLOW_DOWNLOAD_BINARIES=falseDAEMON_RESTART_AFTER_UPGRADE=falseDAEMON_LOG_BUFFER_SIZE=512UNSAFE_SKIP_BACKUP=true
Step 3: Create the folder structure and add the binaries
Cosmovisor expects the binaries under $DAEMON_HOME/cosmovisor, with the genesis binary in genesis/bin and one folder per upgrade under upgrades/:
Initialize the layout with the genesis binary:
Then add the binary for each upgrade. The must match the on-chain upgrade name exactly:
Run cronosd through Cosmovisor
Once the layout is in place, run cosmovisor in place of cronosd. Cosmovisor forwards the arguments to the active binary and switches to the next upgrade binary automatically at the upgrade height, for example:
For syncing through Cosmovisor with KSYNC, see KSYNC.
Last updated
Was this helpful?

