Skip to content

Commit

Permalink
remove zetavisor and replace with cosmovisor (#175)
Browse files Browse the repository at this point in the history
Co-authored-by: Billy Yang <[email protected]>
  • Loading branch information
billyyang423 and Billy Yang authored Oct 16, 2023
1 parent c58d7d1 commit 7dd4056
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 238 deletions.
154 changes: 154 additions & 0 deletions docs/validators/cosmovisor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
sidebar_position: 5
sidebar_label: Setting up Cosmovisor
hide_title: false
id: setting-up-Cosmovisor
title: Setting up Cosmovisor
---

# Setting up Cosmovisor

## Installing Cosmovisor

```
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
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.

```bash
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

```bash
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](#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.

```bash
[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.

```bash
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](https://github.com/zeta-chain/network-athens3/tree/main/network_files/config)

Install them as follows:

```bash
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](https://docs.zetachain.io/docs/running-a-full-node#state-sync).

### Start the `cosmovisor` Service

```bash
sudo systemctl daemon-reload
sudo systemctl enable cosmovisor
sudo systemctl start cosmovisor
```

### Check the `cosmovisor` Service Status

```bash
sudo systemctl status cosmovisor
```

### Check the `cosmovisor` Logs

```bash
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](https://docs.cosmos.network/v0.46/core/telemetry.html) for more
information.

## More Information About Cosmovisor
For more detailed information about Cosmosvisor you can visit the [Cosmos Documentation Here](https://docs.cosmos.network/main/build/tooling/cosmovisor)
238 changes: 0 additions & 238 deletions docs/validators/zetavisor.mdx

This file was deleted.

0 comments on commit 7dd4056

Please sign in to comment.