Nolus Docs

Cosmovisor

Automate chain-upgrade binary swaps with a systemd-managed Cosmovisor service.

Using Cosmovisor is optional. It monitors the governance module and swaps in the upgraded binary automatically, cutting downtime around chain upgrades. Without it, you'd manually download the new binary, stop the current process, switch binaries, and restart.

1. Install

Install the latest Cosmovisor from the Cosmos SDK:

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

2. Environment variables

Append to ~/.profile:

export DAEMON_NAME=nolusd
export DAEMON_HOME=$HOME/.nolus
export MONIKER_NAME=<the-name-of-your-node>

Reload:

source ~/.profile

3. Folder layout

$DAEMON_HOME/cosmovisor is fully managed by Cosmovisor. The current subdirectory is a symlink to the active version (genesis or upgrades). Create the base directories:

mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades

4. Genesis binary

Copy your compiled nolusd into the place Cosmovisor expects:

cp /home/<your-user>/go/bin/nolusd $DAEMON_HOME/cosmovisor/genesis/bin

5. systemd service

Create /etc/systemd/system/cosmovisor.service (substitute your user account where shown):

[Unit]
Description=cosmovisor
After=network-online.target

[Service]
User=<your-user>
ExecStart=/home/<your-user>/go/bin/cosmovisor run start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=nolusd"
Environment="DAEMON_HOME=/home/<your-user>/.nolus"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"

[Install]
WantedBy=multi-user.target

On this page