🆗Mantra Chain

Website: https://www.mantrachain.io/

Faucet: https://faucet.hongbai.mantrachain.io/

Twitter: https://twitter.com/MANTRA_Chain

Discord: https://discord.gg/gfks4TwAJV

Faucet: https://faucet.hongbai.mantrachain.io/

Explorer: https://explorer.hongbai.mantrachain.io/mantrachain

Operating System

This guide will provide detailed instructions for Ubuntu 22.04.

Node Hardware requirements

System requirements

Operating System: Ubuntu 22.04 LTS

Minimum

CPU: 2vCPU (1 core)
Memory: 4 GB
Storage: 200 - 500 GB

Recommended

CPU: 4vCPU (2 cores)
Memory: 8 - 16GB
Storage: 500 - 1000 GB

Setup and Deploy a 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 "https://raw.githubusercontent.com/MANTRA-Finance/public/main/go_install.sh")
source .bash_profile

Install binary.

mkdir bin
cd bin
source ~/.profile

wget https://github.com/MANTRA-Finance/public/raw/main/mantrachain-hongbai/mantrachaind-linux-amd64.zip
unzip mantrachaind-linux-amd64.zip
rm -rf mantrachaind-linux-amd64.zip
cp mantrachaind /usr/local/bin

Install cosmwasm library

More information can be found in here: https://github.com/CosmWasm/wasmvm

sudo wget -P /usr/lib https://github.com/CosmWasm/wasmvm/releases/download/v1.3.1/libwasmvm.x86_64

Initialise node

Change your moniker

mantrachaind init <your-moniker> --chain-id mantra-hongbai-1

Download "genesis.json" - HONGBAI

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

curl -Ls https://github.com/MANTRA-Finance/public/raw/main/mantrachain-hongbai/genesis.json > $HOME/.mantrachain/config/genesis.json

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

CONFIG_TOML="$HOME/.mantrachain/config/config.toml"
SEEDS="d6016af7cb20cf1905bd61468f6a61decb3fd7c0@34.72.142.50:26656"
PEERS="da061f404690c5b6b19dd85d40fefde1fecf406c@34.68.19.19:26656,20db08acbcac9b7114839e63539da2802b848982@34.72.148.3:26656"
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- eth0.me)
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.

Copy

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.4.0
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 https://systemd.io for more information.)

sudo tee /etc/systemd/system/mantrachaind.service > /dev/null << EOF
[Unit]
Description=Mantra Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=3
LimitNOFILE=10000
Environment="DAEMON_NAME=mantrachaind"
Environment="DAEMON_HOME=$HOME/.mantrachain"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF

Starting, stoping and restarting service

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

#stop
sudo systemctl stop mantrachaind

#restart
sudo systemctl restart mantrachaind

#logs
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. Upon Node synced, we can start to create validator

Create a MANTRA Chain account

Create your mantrachain account if you don't have one already. It will be used to operate your validator node. You can, either, create a new account or import an existing account.

Create keys

Create a key file.

mantrachaind config keyring-backend file

Generate a new public key with mnemonic phrase.

mantrachaind keys add wallet

Check balance:

mantrachaind q bank balances $(mantrachaind keys show wallet -a)

KEEP THE MNEMONIC PHRASE IN A SAFE PLACE!

Execute "create-validator" transaction.

You can create new validator from the public key of your node with the following command:

Change your Moniker

Remember: validator's self delegation must be greater than their minimum self delegation

mantrachaind tx staking create-validator \
  --amount=1000000uom \
  --pubkey=$(mantrachaind tendermint show-validator) \
  --moniker=<MONIKER> \
  --chain-id=mantra-hongbai-1 \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1000000" \
  --gas="auto" \
  --gas-adjustment 2 \
  --gas-prices="0.0002uom" \
  --from=wallet

Execute "edit-validator" transaction.

mantrachaind tx staking edit-validator \
  --new-moniker=<NEW-MONIKER> \
  --website="https://your-website.com" \
  --details="Some impressive info about your validator." \
  --chain-id=mantra-hongbai-1 \
  --commission-rate="0.10" \
  --gas="auto" \
  --gas-adjustment 2 \
  --gas-prices="0.0002uom" \
  --from=wallet

Unjail Vailidator

mantrachaind tx slashing unjail \ 
 --chain-id=mantra-hongbai-1 \ 
 --gas="auto" \ 
 --gas-adjustment 2 \ 
 --gas-prices="0.0002uom" \ 
 --from=wallet

Last updated