Initia (Closed Testnet)
  • Reminder
    • ⛔Confidentiality Disclaimer
  • WELCOME TO CLOSED TESTNET
    • Welcome to Closed Testnet
  • About Initia
    • What is the Initia Platform?
      • Architecture
        • Layer 1
        • Layer 2
      • Aligning Initia (coming soon!)
    • InitiaDEX
    • Enshrined Liquidity and Staking
  • Developers
    • Initiad
      • Download Initiad
      • Using Initiad
    • Get INIT token
    • Build your own Minitia
      • Simple Minitia Setup
      • Connect Minitia to L1
        • OPinit Stack
          • OPinit Module
          • OPinit Bots
        • Relayer
          • Fetching Oracle Prices
    • Virtual Machines
      • MoveVM
        • Interact with CLI
      • WasmVM
    • Contracts
      • Move Contracts
      • CosmWasm Contracts
      • EVM Contracts (Coming Soon)
    • Oracles
  • Initia Developer Tutorials
    • 1. Create account
    • 2. Send Move coin
    • 3. Interchain Message
    • 4. Create your own Move coin
    • 5. Create your own Move NFT
    • 6. Build and Publish Contracts
      • Move Module
      • CosmWasm Contract
  • Core Applications
    • Core Applications
      • Wallet
      • Initia App
      • Usernames
      • Initia Scan
  • Node Operators
    • Running Initia Node
      • Prerequisites
      • Oracle
      • Boot an Initia Node
      • Connect to Initia Network
      • Cosmovisor Guide
    • Configuring Initia Validator
  • References and Tools
    • Move Language
    • Rust Language (CosmWasm)
    • Closed Testnet Chain Information
    • Chain Parameters
    • Initia.js
    • API Docs
    • API Docs (minimove)
    • API Docs (miniwasm)
    • Whitelisted Tokens and Pairs
Powered by GitBook
On this page
  • Set up Cosmovisor
  • Install initiad Locally
  • Using a Prebuilt Binary of initiad
  1. Node Operators
  2. Running Initia Node

Cosmovisor Guide

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.

Set up Cosmovisor

To set up Cosmovisor, you may follow different steps depending on your specific environment. There are two main paths:

  1. Install initiad Locally: This involves installing initiad directly onto your local machine.

  2. Using a Prebuilt Binary of the initiad Program: This involves using a prebuilt binary of the initiad Program. This can be particularly useful if you want to avoid the hassle of building initiad from source.

Please ensure to follow the correct instructions for your specific environment to avoid any issues during setup.

Install initiad Locally

1. Set up Cosmovisor

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/ \
)

2. Update System Service File

[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=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"

[Install]
WantedBy=multi-user.target

3. Restart initiad

sudo systemctl daemon-reload
sudo systemctl restart initiad

Using a Prebuilt Binary of initiad

1. Set up Cosmovisor

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

export DAEMON_HOME=~/.initia
export DAEMON_NAME=initiad

cosmovisor init `<path-to-executable>`
cp `<shared-library-path>` $DAEMON_HOME/current/bin/

# 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 $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin
wget https://initia.s3.ap-southeast-1.amazonaws.com/mahalo-1/initia_$UPGRADE_VERSION_$(uname)_$(uname -m).tar.gz
tar -xzvf initia_$UPGRADE_VERSION_$(uname)_$(uname -m).tar.gz
rm initia_$UPGRADE_VERSION_$(uname)_$(uname -m).tar.gz

2. Update System Service File

[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=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="LD_LIBRARY_PATH=/home/ubuntu/.initia/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target

3. Restart initiad

sudo systemctl daemon-reload
sudo systemctl stop initiad 
rm `<shared-library-path>` # to prevent loading wrong shared library
sudo systemctl start initiad
PreviousConnect to Initia NetworkNextConfiguring Initia Validator

Last updated 1 year ago