Testnet

Mantra Chain

Installation Guide
Node CLI
State Sync
Snapshot
Public Endpoint
Custom Explorers
Decentralization Maps
Installation Guide
Installation Guide
Node CLI
State Sync
Snapshot
Public Endpoint
Custom Explorers
Decentralization Maps

State Sync

sudo systemctl stop mantrachaind

cp $HOME/.mantrachain/data/priv_validator_state.json $HOME/.mantrachain/priv_validator_state.json.backup
mantrachaind tendermint unsafe-reset-all --home $HOME/.mantrachain --keep-addr-book

SNAP_RPC="https://testnet-mantra-rpc.konsortech.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.mantrachain/config/config.toml

mv $HOME/.mantrachain/priv_validator_state.json.backup $HOME/.mantrachain/data/priv_validator_state.json

sudo systemctl restart mantrachaind
sudo journalctl -u mantrachaind -f --no-hostname -o cat
Embed Iframe

Mantra Decentralization Maps

How To Install Full Node Mantra Chain Testnet

Setting up vars

Your Nodename (validator) that will shows in explorer

NODENAME=<Your_Nodename_Moniker>

Save variables to system

echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
    echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export MANTRA_CHAIN_ID=mantra-hongbai-1" >> $HOME/.bash_profile
source $HOME/.bash_profile

Update packages

sudo apt update && sudo apt upgrade -y

Install dependencies

sudo apt install curl build-essential git wget jq make gcc tmux net-tools ccze -y

Install go

if ! [ -x "$(command -v go)" ]; then
  ver="1.20.2"
  cd $HOME
  wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
  sudo rm -rf /usr/local/go
  sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
  rm "go$ver.linux-amd64.tar.gz"
  echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile
  source ~/.bash_profile
fi

Download and build binaries

cd $HOME
wget https://snapshot3.konsortech.xyz/mantra-testnet/mantrachaind-linux-amd64.zip
unzip mantrachaind-linux-amd64.zip
rm mantrachaind-linux-amd64.zip
mv mantrachaind $HOME/go/bin/
sudo wget -P /usr/lib https://github.com/CosmWasm/wasmvm/releases/download/v1.3.1/libwasmvm.x86_64.so
mantrachaind version

Config app

mantrachaind config chain-id $MANTRA_CHAIN_ID

Init app

mantrachaind init $NODENAME --chain-id $MANTRA_CHAIN_ID

Download configuration

cd $HOME
curl -Ls https://snapshot.konsortech.xyz/mantra-testnet/genesis.json > $HOME/.mantrachain/config/genesis.json
curl -Ls https://snapshot.konsortech.xyz/mantra-testnet/addrbook.json > $HOME/.mantrachain/config/addrbook.json

Disable indexing

indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.mantrachain/config/config.toml

Config pruning

sed -i 's|pruning = "default"|pruning = "custom"|g' $HOME/.mantrachain/config/app.toml
sed -i 's|pruning-keep-recent = "0"|pruning-keep-recent = "100"|g' $HOME/.mantrachain/config/app.toml
sed -i 's|pruning-interval = "0"|pruning-interval = "10"|g' $HOME/.mantrachain/config/app.toml

Set minimum gas price

sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0002uom"|g' $HOME/.mantrachain/config/app.toml

Create service

sudo tee /etc/systemd/system/mantrachaind.service > /dev/null << EOF
[Unit]
Description=Mantra Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which mantrachaind) start
Restart=on-failure
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF

Register and start service

sudo systemctl daemon-reload
sudo systemctl enable mantrachaind
sudo systemctl restart mantrachaind && sudo journalctl -u mantrachaind -f -o cat

Guidence for create validator

Create wallet

To create new wallet you can use command below. Don’t forget to save the mnemonic

mantrachaind keys add $WALLET

To recover your wallet using seed phrase

mantrachaind keys add $WALLET --recover

Show your wallet list

mantrachaind keys list

Save wallet info

Add wallet and validator address into variables

MANTRA_WALLET_ADDRESS=$(mantrachaind keys show $WALLET -a)
MANTRA_VALOPER_ADDRESS=$(mantrachaind keys show $WALLET --bech val -a)
echo 'export MANTRA_WALLET_ADDRESS='${MANTRA_WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export MANTRA_VALOPER_ADDRESS='${MANTRA_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

Fund your wallet

Faucet available on website

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

Create validator

check your wallet balance:

mantrachaind query bank balances $MANTRA_WALLET_ADDRESS

To create your validator run command below

mantrachaind tx staking create-validator \
  --amount 10000000uom \
  --from $WALLET \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey $(mantrachaind tendermint show-validator) \
  --moniker $NODENAME \
  --chain-id $MANTRA_CHAIN_ID
  --gas="auto" \
  --gas-adjustment 2 

Check your validator key

[[ $(mantrachaind q staking validator $MANTRA_VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(mantrachaind status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"

Get list of validators

mantrachaind q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl

Usefull commands

Service management

Check logs

journalctl -fu mantrachaind -o cat

Start service

sudo systemctl start mantrachaind

Stop service

sudo systemctl stop mantrachaind

Restart service

sudo systemctl restart mantrachaind

Node info

Synchronization info

mantrachaind status 2>&1 | jq .SyncInfo

Validator info

mantrachaind status 2>&1 | jq .ValidatorInfo

Node info

mantrachaind status 2>&1 | jq .NodeInfo

Show node id

mantrachaind tendermint show-node-id

Wallet operations

List of wallets

mantrachaind keys list

Recover wallet

mantrachaind keys add $WALLET --recover

Delete wallet

mantrachaind keys delete $WALLET

Get wallet balance

mantrachaind query bank balances $MANTRA_WALLET_ADDRESS

Transfer funds

mantrachaind tx bank send $MANTRA_WALLET_ADDRESS <TO_MANTRA_WALLET_ADDRESS> 10000000uom

Voting

mantrachaind tx gov vote 1 yes --from $WALLET --chain-id=$MANTRA_CHAIN_ID

Staking, Delegation and Rewards

Delegate stake

mantrachaind tx staking delegate $MANTRA_VALOPER_ADDRESS 10000000uom --from=$WALLET --chain-id=$MANTRA_CHAIN_ID --gas=auto

Redelegate stake from validator to another validator

mantrachaind tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 10000000uom --from=$WALLET --chain-id=$MANTRA_CHAIN_ID --gas=auto

Withdraw all rewards

mantrachaind tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$MANTRA_CHAIN_ID --gas=auto

Withdraw rewards with commision

mantrachaind tx distribution withdraw-rewards $MANTRA_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$MANTRA_CHAIN_ID

Validator management

Edit validator

mantrachaind tx staking edit-validator \
  --moniker=$NODENAME \
  --identity=<your_keybase_id> \
  --website="<your_website>" \
  --details="<your_validator_description>" \
  --chain-id=$MANTRA_CHAIN_ID \
  --from=$WALLET

Unjail validator

mantrachaind tx slashing unjail \
  --broadcast-mode=block \
  --from=$WALLET \
  --chain-id=$MANTRA_CHAIN_ID \
  --gas=auto

Public Endpoints

RPC

https://testnet-mantra-rpc.konsortech.xyz

API

https://testnet-mantra-api.konsortech.xyz

gRPC

testnet-mantra.konsortech.xyz:32090

Persistence Peers

f8352e2f7d9e6f71a431a77cefe9a84bcab3bbac@testnet-mantra.konsortech.xyz:32656

Seeds

55de3d1b55fc8455df2dbc1c34883c370aa40648@testnet-seed.konsortech.xyz:32165

Snapshot

sudo apt install lz4
sudo systemctl stop mantrachaind
cp $HOME/.mantrachain/data/priv_validator_state.json $HOME/.mantrachain/priv_validator_state.json.backup
rm -rf $HOME/.mantrachain/data

SNAP_NAME=$(curl -s https://snapshot.konsortech.xyz/mantra-testnet/ | egrep -o "> mantra-snapshot.*\.tar.lz4" | tr -d ">")
curl https://snapshot.konsortech.xyz/mantra-testnet/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.mantrachain
mv $HOME/.mantrachain/priv_validator_state.json.backup $HOME/.mantrachain/data/priv_validator_state.json

sudo systemctl restart mantrachaind && journalctl -u mantrachaind -f --no-hostname -o cat