Cosmovisor and Systemd
Cosmovisor is a supervisor for the chain binary. It watches governance proposals for chain upgrades. In the case of a chain upgrade it automatically stops the current progress and launches the new binary.
We strongly recommend using Cosmovisor.
The source code for Cosmovisor can be found in the Cosmos-SDK monorepo.
Assuming you have Go installed you can either clone the directory and build
the binary using make, or using the
go install command to directly install
it to your machine.
Here, we use the
go install command:
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
export PATH=$PATH:$(go env GOPATH)/bin
Before running cosmovisor export the following environement variables:
export DAEMON_HOME=/home/kyve-user/.kyve # Change this to your node home
Assuming the chain binary (
./kyved) lies in the current directory, run:
cosmovisor init kyved
The binary can then be started using
cosmovisor run start
For more detailed instructions please visit https://github.com/cosmos/cosmos-sdk/blob/main/tools/cosmovisor/README.md
One can also build the binary on a local system and just ship the binary to the server.
The command then changes to
Setting up Systemd
For Linux systems we recommend using systemd as system supervisor. Others are very likely to work as well, but we have not tested them and do not provide official support.
For the following configuration we assume that the binary is running as the user
/home/chain/ and that the cosmovisor binary is located at
Create a file
/etc/systemd/system/kyved.service with the following contents:
Description=KYVED deamon supervising the cosmos-sdk chain binary
ExecStart=/home/chain/cosmovisor run start
The settings for
depend on your requirements. Please visit https://github.com/cosmos/cosmos-sdk/blob/main/tools/cosmovisor/README.md#setup
for more information.
Start the daemon
sudo systemctl enable kyved
sudo systemctl start kyved
It can be stopped using
sudo systemctl stop kyved
You can see its logs with
sudo journalctl -u kyved -f