Skip to main content
Cosmovisor is a comprehensive process manager that can serve as an easy substitute for the standard initiad start command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. Cosmovisor’s main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval.
1

Install Cosmovisor

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

export DAEMON_HOME=~/.initia
export DAEMON_NAME=initiad

cosmovisor init ~/go/bin/initiad # <path-to-executable>

# only if there is planned upgrade
export UPGRADE_NAME=<upgrade-name>
export UPGRADE_VERSION=<upgrade-version>
mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin
(                                                                              \
	cd initia &&                                                           \
	git fetch --all --tags &&                                              \
	git checkout $UPGRADE_VERSION &&                                       \
	make build &&                                                          \
	mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \
)
2

Update System Service File

[Unit]
Description=initiad

[Service]
Type=simple
User=ubuntu
ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia
WorkingDirectory=/home/ubuntu/.initia
Restart=on-abort
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=initiad
LimitNOFILE=4096
Environment="DAEMON_NAME=initiad"
Environment="DAEMON_HOME=/home/ubuntu/.initia" 
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_RESTART_DELAY=5s"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
To update the node manually, set the environment variable DAEMON_ALLOW_DOWNLOAD_BINARIES=false. This disables automatic binary downloads. Afterward, download the required binary yourself and place it in the designated installation directory.
3

Restart initiad

sudo systemctl daemon-reload
sudo systemctl restart initiad