Skip to content

Commit

Permalink
update the cosmovisor documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy Yang committed Oct 16, 2023
1 parent 3fa3275 commit a509543
Showing 1 changed file with 3 additions and 146 deletions.
149 changes: 3 additions & 146 deletions docs/validators/cosmovisor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: Setting up Cosmovisor

```
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
mv $GOPATH/bin/zetavisor /usr/local/bin/cosmovisor
mv $GOPATH/bin/cosmovisor /usr/local/bin/cosmovisor
```

### Download Cosmovisor Binary
Expand All @@ -30,148 +30,5 @@ wget https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.5.0/
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

```

## 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://zetachain-external-files.s3.amazonaws.com/binaries/athens3/latest/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.

## Cosmovisor Environment Variables

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

- `DAEMON_NAME`

- The name of the binary itself (e.g. gaiad, regend, simd, etc.).

- `DAEMON_ALLOW_DOWNLOAD_BINARIES` (optional)

- If set to true, enables auto-downloading of new binaries (for security
reasons, this is intended for full nodes rather than validators). By
default, Cosmovisor will not auto-download new binaries.

- `DAEMON_RESTART_AFTER_UPGRADE` (optional, default = true)

- If true, restarts the subprocess with the same command-line arguments and
flags (but with the new binary) after a successful upgrade. Otherwise
(false), Cosmovisor stops running after an upgrade and requires the system
administrator to manually restart it. Note that restart is only after the
upgrade and does not auto-restart the subprocess after an error occurs.

- `DAEMON_DATA_BACKUP_DIR`

- Option to set a custom backup directory. If not set, DAEMON_HOME is used.

- `UNSAFE_SKIP_BACKUP` (defaults to false)
- If set to true, upgrades directly without performing a backup. Otherwise
(false, default), backs up the data before trying the upgrade. The default
value of false is useful and recommended in case of failures and when a
backup is needed to rollback. We recommend using the default backup option
UNSAFE_SKIP_BACKUP=false.
- `CLIENT_DAEMON_NAME`
- Top level config for name of core binary
- `AllowDownloadBinaries`
- True : Top level config to allow download during an upgrade
- False : Top Level config to stop the above
- `CLIENT_SKIP_UPGRADE`
- True :
- Skips upgrade for the client (Does not replace binary)
- Note Upgrade includes download also
- Does not kill the client process at upgrade height
- Does not start the client after upgrade
- Use this to completely ignore zetaclient .
- False: Replaces the client binary at the correct height
- `CLIENT_START_PROCESS`
- True : Starts zetaclientd
- False : Does not start zetaclientd
- Note
- Both `RestartAfterUpgrade` and `StartClientProcess` need to be `true`
for this to work
- `SkipClientUpgrade` needs to be `false` and `StartClientProcess` needs
to be `true` for this to work
- Use this to tune upgrade process
- Example : `SkipClientUpgrade` : false && `StartClientProcess` false
- Will do the upgrade , replace binaries etc but starting the client
needs to be handled separately
- Note the client will still be killed at the upgrade height , and
new binaries will be copied to the correct location (Dowloaded if
allowed)
## 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)

0 comments on commit a509543

Please sign in to comment.