diff --git a/developers/running-nodes/manual-setup/cosmovisor.mdx b/developers/running-nodes/manual-setup/cosmovisor.mdx deleted file mode 100644 index 2cb48ce3..00000000 --- a/developers/running-nodes/manual-setup/cosmovisor.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Cosmovisor (Optional) ---- - -To help simplify the process of automatically switching the `initiad` application binary versions during chain upgrades, we recommend using the [Cosmovisor](https://docs.cosmos.network/main/tooling/cosmovisor) tool. - -To install Cosmovisor, follow the instructions on the [Cosmovisor Cosmos SDK documentation](https://docs.cosmos.network/v0.45/run-node/cosmovisor.html). \ No newline at end of file diff --git a/docs.json b/docs.json index 91bbbc3a..79ef1089 100644 --- a/docs.json +++ b/docs.json @@ -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", diff --git a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx new file mode 100644 index 00000000..c7ac3cb2 --- /dev/null +++ b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx @@ -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. + + + + ```sh + go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest + + export DAEMON_HOME=~/.initia + export DAEMON_NAME=initiad + + cosmovisor init ~/go/bin/initiad # + + # only if there is planned upgrade + export UPGRADE_NAME= + export 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/ \ + ) + ``` + + + ```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 + ``` + + + 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. + + + + ```sh + sudo systemctl daemon-reload + sudo systemctl restart initiad + ``` + + \ No newline at end of file