Setting up Cosmovisor
Installing Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
mv $GOPATH/bin/cosmovisor /usr/local/bin/cosmovisor
Download Cosmovisor Binary
Download the Binary for your system architecture from the following links and place it in your $PATH amd64: https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.5.0/cosmovisor-v1.5.0-linux-amd64.tar.gz arm64: https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.5.0/cosmovisor-v1.5.0-linux-arm64.tar.gz
This example assumes you are using amd64 architecture. If you are using arm64 replace amd64 with arm64 in the commands below.
wget https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.5.0/cosmovisor-v1.5.0-linux-amd64.tar.gz
mv cosmovisor-amd64 /usr/local/bin/cosmovisor
Setting up Cosmovisor
Create cosmovisor
Directories
mkdir -p ~/.zetacored/config
mkdir -p ~/.zetacored/cosmovisor/genesis/bin
mkdir -p ~/.zetacored/cosmovisor/upgrades
Setup cosmovisor
systemd service
In this example we'll run Cosmovisor as a systemd service. You can also run it as a docker container or as a standalone process. The environment variables are explained in the Environment Variables section at the end of this document.
Create a file at /etc/systemd/system/cosmovisor.service
with the following
contents. Make sure to change the User
and /home/zetachain/
fields to the
user you want to run the service as.
[Unit]
Description=cosmovisor ZetaChain Service
After=multi-user.target
StartLimitIntervalSec=0
[Install]
WantedBy=multi-user.target
[Service]
WorkingDirectory=/home/zetachain/.zetacored/cosmovisor
Environment="DAEMON_HOME=/home/zetachain/.zetacored"
Environment="DAEMON_NAME=zetacored"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_DATA_BACKUP_DIR=/home/zetachain/.zetacored"
Environment="CLIENT_DAEMON_NAME=zetaclientd"
Environment="CLIENT_SKIP_UPGRADE=false"
Environment="CLIENT_START_PROCESS=false"
Environment="UNSAFE_SKIP_BACKUP=true"
Type=simple
Restart=always
RestartSec=600
User=zetachain
LimitNOFILE=262144
ExecStart=cosmovisor start --home /home/zetachain/.zetacored/ --log_format json --moniker <YOUR_NODE_NAME_HERE>
Install the zetacored
Binary
Download zetacored
Binary
Download the latest zetacored
binary for your system architecture from the
following links and place it in the cosmovisor/genesis/bin/
directory. This
example assumes you are using ubuntu 22 on amd64 architecture. You may need to
make adjustments for your system.
wget https://github.com/zeta-chain/node/releases/latest/download/zetacored-ubuntu-22-amd64
mv zetacored-ubuntu-22-amd64 ~/.zetacored/cosmovisor/genesis/bin/zetacored
chmod +x ~/.zetacored/cosmovisor/genesis/bin/zetacored
Install ZetaChain Configuration Files
ZetaChain configuration files for the Athens3 Testnet can be downloaded from the Athens3 Github Repo
Install them as follows:
git clone https://github.com/zeta-chain/network-athens3
cp network-athens3/network_files/config/* ~/.zetacored/config/
Starting Cosmovisor
State Sync
You may choose to sync the state of your node from a snapshot. This will speed up the time it takes to sync your node. Instructions for syncing from a snapshot can be found here.
Start the cosmovisor
Service
sudo systemctl daemon-reload
sudo systemctl enable cosmovisor
sudo systemctl start cosmovisor
Check the cosmovisor
Service Status
sudo systemctl status cosmovisor
Check the cosmovisor
Logs
journalctl -u cosmovisor -f
Monitoring
In a production environment we recommend monitoring the node resources (CPU load, Memory Usage, Disk usage and Disk IO) for any performance degradation.
ZetaChain Core generates a log that can be monitored for errors and used for
troubleshooting. If you install Zetacore as a Systemd service using the
instructions above you can view this log with
journalctl -o cat -f -u zetacored
.
Prometheus can be enabled to serve metrics which can be consumed by Prometheus collector(s). Telemetry include Prometheus metrics can be enabled in the app.toml file. See the CosmosSDK Telemetry Documentation for more information.
See more about your Validator Monitoring here.
More Information About Cosmovisor
For more detailed information about Cosmosvisor you can visit the Cosmos Documentation Here