Node9X Service
  • 🍄MAINNET
    • đŸŸĸKopi Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade (V11)
      • đŸĒĸCosmovisor
      • đŸ›°ī¸Command
  • 🚀Testnet
    • đŸ§ŦExplorer
    • đŸŸĸNative
      • âš™ī¸Installation
    • đŸŸĸXRPL EVM
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • đŸ•šī¸Command
    • đŸŸĸPipe Network
      • Installation
      • Upgrade
    • đŸŸĸPell
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade (v1.1.1)
      • đŸ•šī¸Command
    • đŸŸĸStructs
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • đŸ•šī¸Command
    • đŸŸĸPrysm
      • đŸ›°ī¸Service & Snapshot
      • âš™ī¸Installation
      • 💾Command
    • đŸŸĸZenrock
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade ( v6.3.3)
      • đŸ•šī¸Cosmovisor
      • đŸ›°ī¸Command
      • âš™ī¸Sidecar (âœ”ī¸Oracle)
        • 🔗Upgrade
    • đŸŸĸStory Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation (Odyssey)
      • â›“ī¸Upgrade (v0.13.1)
        • đŸĒĸUpgrade (v0.13.0)
      • â›“ī¸Cosmovisor
      • đŸ›°ī¸Command
    • đŸŸĸ0G Chain
      • Service & Snapshot
      • Installation
        • Cosmovisor
      • Commands
      • â˜‘ī¸0G Storage Node
        • Upgrade (v0.7.3)
      • â˜‘ī¸0G Storage KV
      • â˜‘ī¸0G DA Node
        • Update
      • â˜‘ī¸0G DA Client
    • đŸŸĸAirchains
      • 💾Service & Snapshot
      • âš™ī¸Installation
        • đŸĒĸCosmovisor
        • đŸ”ēEVM ZK Rollup
      • đŸ•šī¸Commands
      • â›“ī¸Upgrade
    • đŸŸĸAllora
      • đŸ”ēWorkers
        • Create tool and worker wallet
        • Install Worker 1
        • Install Worker 2
        • Troubleshooting
        • Script for checking worker
      • Another method
      • Service
      • Installation By Dock (Recommend)
      • Installation
      • Snapshot & State sync
      • Useful commands
    • đŸŸĸHedge Block
      • Service
      • Installation
      • Commands
    • đŸŸĸDill Chain
      • Usage Commands
    • đŸŸĸFiamma Chain
      • đŸĨĻServices & Snapshot
      • âš™ī¸Installation
      • đŸ›°ī¸Usage Command
    • đŸŸĸElixir Testnet
      • âš™ī¸Installation
    • đŸŸĸChainbase
      • â›“ī¸Installation
    • 🔘AXONE Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation
    • 🔘Symphony
      • 🔌Installation
      • đŸĨĻFresh Peer
    • 🔘Empeiria
      • Installation
      • Usage Command
Powered by GitBook
On this page

Was this helpful?

  1. Testnet
  2. 0G Chain
  3. Installation

Cosmovisor

PreviousInstallationNextCommands

Last updated 8 months ago

Was this helpful?

1. Stop node

sudo systemctl stop 0gd.service

2. Download cosmovisor script to install

wget https://raw.githubusercontent.com/0glabs/0g-chain/dev/networks/testnet/init-cosmovisor.sh

Check Script content nano init-cosmovisor.sh

#!/bin/bash

if [ -z "$1" ]; then
    echo "Usage: $0 <0G Home>"
    exit 1
fi

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

export DAEMON_NAME=0gchaind
echo "export DAEMON_NAME=0gchaind" >> ~/.profile
export DAEMON_HOME=$1
echo "export DAEMON_HOME=$1" >> ~/.profile
cosmovisor init $(whereis -b 0gchaind | awk '{print $2}')
mkdir $DAEMON_HOME/cosmovisor/backup
echo "export DAEMON_DATA_BACKUP_DIR=$DAEMON_HOME/cosmovisor/backup" >> ~/.profile
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> ~/.profile

3. Run script

Before running this script, make sure Go is loaded in your current shell session. If you haven't loaded Go yet, please run the following command:

source ~/.profile
chmod +x init-cosmovisor.sh
./init-cosmovisor.sh /root/.0gchain

Reload profile

source ~/.profile

4. Edit service file to run with Cosmovisor

nano /etc/systemd/system/0gd.service
[Unit]
Description=Cosmovisor 0G Node
After=network.target

[Service]
User=root
Type=simple
ExecStart=/root/go/bin/cosmovisor run start
Restart=on-failure
LimitNOFILE=65535
Environment="DAEMON_NAME=0gchaind"
Environment="DAEMON_HOME=/root/.0gchain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_DATA_BACKUP_DIR=/root/.0gchain/cosmovisor/backup"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload && \
sudo systemctl enable 0gd && \
sudo systemctl restart 0gd && sudo systemctl status 0gd
tail -f /root/.0gchain/log/chain.log
🚀
đŸŸĸ