[NODERS]TEAM
Search
K

Useful commands

List of commands used to manage the validator and node

Wallet interaction

Create Wallet

desmos keys add <WALLET_NAME>

Restore wallet

desmos keys add <WALLET_NAME> --recover

Show all wallets

desmos keys list

Delete wallet

desmos keys delete <WALLET_NAME>

Export wallet to the file

desmos keys export <WALLET_NAME>

Import wallet from the file

desmos keys import <WALLET_NAME> <WALLET_NAME>.backup

Show balance

desmos q bank balances $(desmos keys show <WALLET_NAME> -a)

Validator control

Create a validator

desmos tx staking create-validator \
--amount=1000000udsm \
--pubkey=$(desmos tendermint show-validator) \
--moniker="<YOUR MONIKER>" \
--chain-id=desmos-mainnet \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--fees 200udsm \
--from=<WALLET_NAME> -y

Edit validator

desmos tx staking edit-validator \
--new-moniker="<YOUR_MONIKER>" \
--identity="<YOUR_KEYBASE_ID>" \
--details="<YOUR_DETAILS>" \
--website="<YOUR_WEBSITE_URL>"
--chain-id=desmos-mainnet \
--commission-rate=0.05 \
--from=<WALLET_NAME> \
--fees 200udsm \
-y

Unjail

desmos tx slashing unjail --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Jail reason

desmos query slashing signing-info $(desmos tendermint show-validator)

Active validators

desmos 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

Inactive validators

desmos 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

Information about the validator

desmos q staking validator $(desmos keys show <WALLET_NAME> --bech val -a)

Balance management

Withdrawal of all rewards

desmos tx distribution withdraw-all-rewards --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Withdrawal of rewards and commissions

desmos tx distribution withdraw-rewards <VALOPER> --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Self-delegation

desmos tx staking delegate $(desmos keys show <WALLET_NAME> --bech val -a) --commission --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Delegation to validator

desmos tx staking delegate $(desmos keys show <WALLET_NAME> --bech val -a) 1000000udsm --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Redelegation to another validator

desmos tx staking redelegate $(desmos keys show <WALLET_NAME> --bech val -a) <TO_VALOPER_ADDRESS> 1000000udsm --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Unbond tokens

desmos tx staking unbond $(desmos keys show <WALLET_NAME> --bech val -a) 1000000udsm --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Sending tokens to a wallet

desmos tx bank send <WALLET_NAME> <TO_WALLET_ADDRESS> 1000000udsm --from <WALLET_NAME> --fees 200udsm --chain-id desmos-mainnet

Governance

All proposals

desmos query gov proposals

All proposals by ID

desmos query gov proposal 1

Vote "YES"

desmos tx gov vote 1 yes --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Vote "NO"

desmos tx gov vote 1 no --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Vote "Abstain"

desmos tx gov vote 1 abstain --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Vote "NoWithVeto"

desmos tx gov vote 1 nowithveto --from <WALLET_NAME> --chain-id desmos-mainnet --fees 200udsm -y

Utility

Update ports

CUSTOM_PORT=10
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}660\"%" $HOME/.desmos/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}317\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}091\"%" $HOME/.desmos/config/app.toml

Disable Indexer

sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.desmos/config/config.toml

Enable Indexer

sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.desmos/config/config.toml

Update pruning

sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.desmos/config/app.toml

Node support

Validator Info

desmos status 2>&1 | jq .ValidatorInfo

Sync info

desmos status 2>&1 | jq .SyncInfo

Get peers

echo $(desmos tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.desmosdesmos/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Validator key check

[[ $(desmos q staking validator $(desmos keys show <WALLET_NAME> --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(desmos 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 live peers

curl -sS http://localhost:26657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

Setting the minimum commission

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0udsm\"/" $HOME/.desmos/config/app.toml

Enable prometheus

sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.desmos/config/config.toml

Reset chain data

desmos tendermint unsafe-reset-all --home $HOME/.desmos --keep-addr-book

Deleting a node

Before deleting a node make sure you save priv_validator_key.json
cd $HOME
sudo systemctl stop desmos
sudo systemctl disable desmos
sudo rm /etc/systemd/system/desmos.service
sudo systemctl daemon-reload
rm -rf $(which desmos)
rm -rf $HOME/.desmos
rm -rf $HOME/rebus.core

Service setup

Reload service configuration

sudo systemctl daemon-reload

Enable service

sudo systemctl enable desmos

Disable service

sudo systemctl disable desmos

Start service

sudo systemctl start desmos

Stop service

sudo systemctl stop desmos

Restart service

sudo systemctl restart desmos

Check service status

sudo systemctl status desmos

Check service logs

sudo journalctl -u desmos -f --no-hostname -o cat