Cheat Sheet

Cheat Sheet

A Tendermint cheat sheet is a quick reference for essential commands to control Tendermint blockchains.

Service Operations

to start, stop, restart, reload, enable, or disable the mantrachaind service, use the following commands:

command services
// start service
sudo systemctl start mantrachaind
 
// stop service
sudo systemctl stop mantrachaind
 
// restart service
sudo systemctl restart mantrachaind
 
// reload service
sudo systemctl daemon-reload
 
// enable service
sudo systemctl enable mantrachaind
 
// disable service
sudo systemctl disable mantrachaind
 

to check the status of the mantrachaind service, use the following command:

command services
// Check logs
sudo journalctl -u mantrachaind -f
 
// Check service status
sudo systemctl status mantrachaind
 
// Sync info
mantrachaind status 2>&1 | jq .SyncInfo
 
// Node info
mantrachaind status 2>&1 | jq .NodeInfo
 
 

Managing Keys

Add New Wallet

command
mantrachaind keys add $WALLET

Add New Wallet

command dependencies
mantrachaind keys add $WALLET --recover

Restore executing wallet

command dependencies
mantrachaind keys add $WALLET --recover

List All Wallets

command dependencies
mantrachaind keys list

Delete wallet

command
mantrachaind keys delete $WALLET

Check Balance

command
mantrachaind q bank balances $(mantrachaind keys show $WALLET -a)

Export Key (save to wallet.backup)

command
mantrachaind keys export $WALLET

View EVM Prived Key

command
mantrachaind keys unsafe-export-eth-key $WALLET

Import Key (restore from wallet.backup)

command
mantrachaind keys import $WALLET wallet.backup

Validator Operation

Create Validator (replace the values with your own)

command
mantrachaind tx staking create-validator \
--amount 1000000uside \
--pubkey $(mantrachaind tendermint show-validator) \
--moniker "your-moniker-name" \
--identity "your-keybase-id" \
--details "your-details" \
--website "your-website" \
--security-contact "your-email" \
--chain-id side-testnet-2 \
--commission-rate 0.05 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.005uside \
-y

Edit validator (replace the values with your own)

command
mantrachaind tx staking edit-validator \
--new-moniker "your-moniker-name" \
--identity "your-keybase-id" \
--details "your-details" \
--website "your-website" \
--security-contact "your-email" \
--chain-id side-testnet-2 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.005uside \
-y

View validator details

command
mantrachaind q staking validator $(mantrachaind keys show wallet --bech val -a)

Unjail validator

command
mantrachaind tx slashing unjail --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Validator jail reason

command
mantrachaind q slashing signing-info $(mantrachaind tendermint show-validator)

List active validator

command
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

List inactive validator

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

Managing Token

Withdraw reward from all validator

command
mantrachaind tx distribution withdraw-all-rewards --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Withdraw reward and commission

command
mantrachaind tx distribution withdraw-rewards $(mantrachaind keys show wallet --bech val -a) --commission --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Delegate tokens to your validator

command
mantrachaind tx staking delegate $(mantrachaind keys show wallet --bech val -a) 1000000uside --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Delegate token to other validator, change <to-valoper-address> as you like

command
mantrachaind tx staking delegate `<to-valoper-address>` 1000000uside --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Redelegate to another validator

command
mantrachaind tx staking redelegate $(mantrachaind keys show wallet --bech val -a) `<to-valoper-address>` 1000000uside --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Unbond token from your own validator

command
mantrachaind tx staking unbond $(mantrachaind keys show wallet --bech val -a) 1000000uside --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y
 

Send token to the wallet

command
mantrachaind tx bank send wallet <to-wallet-address> 1000000uside --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Governance

Query list proposal

command
mantrachaind query gov proposals

View proposal by ID

command
mantrachaind query gov proposal 1

Vote option yes

command
mantrachaind tx gov vote 1 yes --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Vote option no

command
mantrachaind tx gov vote 1 no --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Vote option asbtain

command
mantrachaind tx gov vote 1 abstain --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.005uside -y

Vote option NoWithVeto

command
mantrachaind tx gov vote 1 NoWithVeto --from wallet --chain-id side-testnet-2 --gas-adjustment 1.4 --gas auto --gas