Setting up Cosmovisor
Automated Validator / Node Upgrades
Reference: Cosmovisor Cosmos Documentation
About Cosmovisor
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
it 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.
Setup
Installation
You can download Cosmovisor from the GitHub releases.
To install the latest version of
cosmovisor
, run the following command:
Install from source
Run cosmovisor version
to check the cosmovisor version.
Environment Variables
DAEMON_HOME
is the location where upgrade binaries should be kept (e.g.$HOME/.selfchain
).DAEMON_NAME
is the name of the binary itself (eg.selfchaind
).DAEMON_ALLOW_DOWNLOAD_BINARIES
(optional) if set totrue
will enable the auto-downloading of new binaries (for security reasons, this is intended for full nodes rather than validators).DAEMON_RESTART_AFTER_UPGRADE
(optional) if set totrue
After a successful upgrade, it will restart the sub-process with the same command line arguments and flags (but a new binary).
Add the necessary environment variables, for example by adding these variables to the profile that will be running Cosmovisor. You can edit the ~/.profile file by adding the following content:
The Data Folder Layout
$DAEMON_HOME/cosmovisor
is expected to belong completely to cosmovisor
the subprocesses that are controlled by it. The folder content is organized as follows:
Set up Genesis Binary
Create genesis folders:
Find the location of selfchaind
:
Copy the selfchaind binary to the genesis/bin from the path returned from the above command. Let's assume the returned path is /usr/local/go/bin/selfchaind
.
Configure the host's init system
Configure cosmovisor
as a system service for automatically starting.
If you're on Linux, you can do this by creating a service:
Change the contents of the below to match your setup - cosmovisor
Start Cosmovisor
Enable the service and start it:
Check it is running using:
Last updated