- A Layer node machine configured like this.
- Clone the cosmos repo, change directory to
cosmos-sdk
git clone https://github.com/cosmos/cosmos-sdk && cd cosmos-sdk/tools/cosmovisor
- Build cosmovisor with the command:
go build ./cmd/cosmovisor
- 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.
- Gather binaries.
{% hint style="info" %} At the time of writing there are no upgrade binaries. Use v3.0.1. {% endhint %}
{% code overflow="wrap" %}
# genesis version v3.0.1
mkdir ~/binaries && cd ~/binaries && mkdir v2.0.0-alpha1 && cd v2.0.0-alpha1 && wget https://github.com/tellor-io/layer/releases/download/v0.2.1/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
...
{% endcode %}
To check that these downloaded and extracted correctly: ls ~/binaries
- 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 ~/locaion/of/upgrade/binary
# ...
- To start your node with cosmovisor managing upgrades:
{% code overflow="wrap" %}
cosmovisor run start --api.enable --api.swagger --price-daemon-enabled=false --panic-on-daemon-failure-enabled=false --key-name $ACCOUNT_NAME
{% endcode %}