Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions developers/running-nodes/manual-setup/cosmovisor.mdx

This file was deleted.

6 changes: 5 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@
"pages": [
{
"group": "Running Initia L1 Nodes",
"pages": ["nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave","nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad"]
"pages": [
"nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad",
"nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave",
"nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor"
]
},
{
"group": "Running a Validator",
Expand Down
66 changes: 66 additions & 0 deletions nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Cosmovisor (Optional)
---

[Cosmovisor](https://docs.cosmos.network/v0.52/build/tooling/cosmovisor) is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval.

<Steps>
<Step title="Install Cosmovisor">
```sh
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

export DAEMON_HOME=~/.initia
export DAEMON_NAME=initiad

cosmovisor init ~/go/bin/initiad # <path-to-executable>

# only if there is planned upgrade
export UPGRADE_NAME=<upgrade-name>
export UPGRADE_VERSION=<upgrade-version>
mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin
( \
cd initia && \
git fetch --all --tags && \
git checkout $UPGRADE_VERSION && \
make build && \
mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \
)
```
</Step>
<Step title="Update System Service File">
```sh
[Unit]
Description=initiad

[Service]
Type=simple
User=ubuntu
ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia
WorkingDirectory=/home/ubuntu/.initia
Restart=on-abort
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=initiad
LimitNOFILE=4096
Environment="DAEMON_NAME=initiad"
Environment="DAEMON_HOME=/home/ubuntu/.initia"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_RESTART_DELAY=5s"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
```

<Note>
To update the node manually, set the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES=false`. This disables automatic binary downloads. Afterward, download the required binary yourself and place it in the designated installation directory.
</Note>
</Step>
<Step title="Restart initiad">
```sh
sudo systemctl daemon-reload
sudo systemctl restart initiad
```
</Step>
</Steps>