Setup and Deploy a Node

Setting up a generic node

Update system & install prerequisites.

sudo apt update
sudo apt upgrade
sudo apt install -y curl git jq lz4 build-essential unzip
bash <(curl -s "")
source .bash_profile

Install binary.

mkdir bin
cd bin
source ~/.profile

rm -rf

Install cosmwasm library

More information can be found in here:

sudo wget -P /usr/lib

Initialise node

mantrachaind init <your-moniker> --chain-id mantra-hongbai-1
  • where <your-moniker>is the moniker and can be any valid string name (e.g. val-01),

  • and mantra-hongbai-1 is the Chain ID and must be exactly as specified.

Download "genesis.json" - HONGBAI

Obtain the genesis.json for the MANTRA Hongbai Chain (Testnet).

curl -Ls > $HOME/.mantrachain/config/genesis.json

Update the config.toml with the seed node and the peers for the MANTRA Hongbai Chain (Testnet).

sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $CONFIG_TOML
sed -i.bak -e "s/^seeds =.*/seeds = \"$SEEDS\"/" $CONFIG_TOML
external_address=$(wget -qO-
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $CONFIG_TOML
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0002uom"|g' $CONFIG_TOML
sed -i 's|^prometheus *=.*|prometheus = true|' $CONFIG_TOML
sed -i -e "s/^filter_peers *=.*/filter_peers = \"true\"/" $CONFIG_TOML

Install Cosmovisor

cosmovisor is a process manager for Cosmos SDK application binaries that automates application binary switch at chain upgrades.

It polls the upgrade-info.json file that is created by the x/upgrade module at upgrade height, and then can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.

go install
mkdir -p ~/.mantrachain/cosmovisor/genesis/bin
mkdir -p ~/.mantrachain/cosmovisor/upgrades
cp ~/bin/mantrachaind ~/.mantrachain/cosmovisor/genesis/bin

Configure "mantrachaind" as a Service

The systemd service manager allows the mantrachaind binary to run as a service, instead of as a command-line application. (See for more information.)

sudo tee /etc/systemd/system/mantrachaind.service > /dev/null << EOF
Description=Mantra Node
ExecStart=$(which cosmovisor) run start

Starting, stoping and restarting service

#reload, enable and start
sudo systemctl daemon-reload
sudo systemctl enable mantrachaind
sudo systemctl start mantrachaind

sudo systemctl stop mantrachaind

sudo systemctl restart mantrachaind

sudo journalctl -xefu mantrachaind

#logs - filtered on block height lines
sudo journalctl -xefu mantrachaind -g ".*txindex"

Once started, the node will take some time to sync with the blockchain.

Visit to see the current height of the blockchain. Use the journalctl command to check on the node's progress.

Last updated