Cosmovisor Sync

If you would like to use cosmovisor...

Prerequisites:

  • A Layer node machine configured like this.

Build and configure Cosmovisor

  1. Clone the cosmos repo, change directory to cosmos-sdk

git clone https://github.com/cosmos/cosmos-sdk && cd cosmos-sdk/tools/cosmovisor
  1. Build cosmovisor with the command:

go build ./cmd/cosmovisor
  1. Add the following to the end of your ~/.bashrc or ~/.zshrc file:

# cosmovisor
export DAEMON_NAME=layerd
export DAEMON_HOME=$HOME/.layer
export DAEMON_RESTART_AFTER_UPGRADE=true
export DAEMON_ALLOW_DOWNLOAD_BINARIES=false
export DAEMON_POLL_INTERVAL=300ms
export UNSAFE_SKIP_BACKUP=true
export DAEMON_PREUPGRADE_MAX_RETRIES=0

Use source ~/.bashrc or source ~/.zshrc to load the variables.

  1. Once you have all of the binaries downloaded, initialize Cosmovisor and add all the upgrades. Change the file paths in the command to match the path to each binary exactly:

# set up cosmovisor. Each command is done seperatly.
./cosmovisor init ~/layer/binaries/v3.0.1/layerd
./cosmovisor add-upgrade ~/layer/binaries/v3.0.2/layerd
  1. To start your node with cosmovisor managing upgrades:

./cosmovisor run start --api.enable --api.swagger --home ~/.layer --price-daemon-enabled=false --panic-on-daemon-failure-enabled=false --key-name YOUR_ACCOUNT_NAME

Last updated