Cosmovisor setup

Install cosmovisor

Run go install to download cosmovisor:

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

Create dir structure for cosmovisor:

export DAEMON_NAME=emped
export DAEMON_HOME=$HOME/.empe-chain/
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin
mkdir -p $DAEMON_HOME/cosmovisor/upgrades

Copy emped binary to cosmovisor genesis bin:

cp ~/go/bin/emped $DAEMON_HOME/cosmovisor/genesis/bin
$DAEMON_HOME/cosmovisor/genesis/bin/emped version

Setup systemd:

sudo tee /etc/systemd/system/cosmovisor.service> /dev/null <<EOF
[Unit]
Description=cosmovisor
After=network-online.target

[Service]
User=$USER
ExecStart=/home/$USER/go/bin/cosmovisor run start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=emped"
Environment="DAEMON_HOME=/home/$USER/.empe-chain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target

EOF

Run a node:

sudo systemctl enable cosmovisor  
sudo systemctl start cosmovisor

Check status

sudo systemctl status cosmovisor

Logs from cosmovisor

sudo journalctl -f -u cosmovisor

Last updated