Install Cosmovisor

Build Cosmovisor

cd ${HOME}
git clone https://github.com/cosmos/cosmos-sdk && cd cosmos-sdk/tools/cosmovisor/
make
sudo cp cosmovisor /usr/local/bin

For MultiNode set ups you can do the following

mkdir -p ${HOME}/.chain-folder(.juno)/cosmovisor/genesis/bin
mkdir -p ${HOME}/.local/bin
cp cosmovisor ${HOME}/.local/bin

///check to see if cosmovisor binary is there 
ls ${HOME}/.local/bin

///move chain binary to cosmovisor dir
cp ${HOME}/go/bin/binary ${HOME}/.chain/cosmovisor/genesis/bin

Service file template

[Unit]
Description=Chain Node Name
After=network-online.target

[Service]
User=<USER>
Group=<GROUP>
ExecStart=/usr/local/bin/cosmovisor run start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=<NODE_BINARY_NAME>"
Environment="DAEMON_HOME=<NODE_HOME_FOLDER>"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
systemctl daemon-reload

systemctl start <service>

journalctl -u <service> -f

Last updated