Useful commands
List of commands used to manage the validator and node
Wallet interaction
Create Wallet
selfchaind keys add <WALLET_NAME>
Restore wallet
selfchaind keys add <WALLET_NAME> --recover
Show all wallets
Delete wallet
selfchaind keys delete <WALLET_NAME>
Export wallet
selfchaind keys export <WALLET_NAME>
Import wallet
selfchaind keys import <WALLET_NAME> <WALLET_NAME>.backup
Show balance
selfchaind query <WALLET_NAME> balance
Validator control
Create a validator
selfchaind tx staking create-validator \
--amount=1000000uself \
--pubkey=$(selfchaind tendermint show-validator) \
--moniker=<YOUR_MONIKER> \
--details="<YOUR_DETAILS>" \
--identity="<YOUR_KEYBASE_ID>" \
--website="<YOUR_WEBSITE>" \
--chain-id="self-dev-1" \
--commission-rate="0.10" \
--commission-max-rate="0.50" \
--commission-max-change-rate="0.2" \
--min-self-delegation="1" \
--from=<WALLET_NAME> -y
Edit validator
selfchaind tx staking edit-validator \
--new-moniker="<YOUR_MONIKER_NAME>" \
--identity="<YOUR_KEYBASE_ID>" \
--details="<YOUR_DETAILS>" \
--website="<YOUR_WEBSITE_URL>"
--chain-id self-dev-1 \
--commission-rate="0.10" \
--from=<WALLET_NAME> -y
Unjail
selfchaind tx slashing unjail --from <WALLET_NAME> chain-id self-dev-1 -y
Jail reason
selfchaind query slashing signing-info $(selfchaind tendermint show-validator)
Active validators
selfchaind 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
selfchaind 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
selfchaind q staking validator $(selfchaind keys show <WALLET_NAME> --bech val -a)
Balance management
Withdrawal of all rewards
selfchaind tx distribution withdraw-all-rewards --from <WALLET_NAME> chain-id self-dev-1 -y
Withdrawal of rewards and commissions
selfchaind tx distribution withdraw-rewards $(selfchaind keys show <WALLET_NAME> --bech val -a) --commission --from <WALLET_NAME> chain-id self-dev-1 -y
Self-delegation
selfchaind tx staking delegate $(selfchaind keys show <WALLET_NAME> --bech val -a) 1000000uself --from <WALLET_NAME> chain-id self-dev-1 -y
Delegation to validator
selfchaind tx staking delegate <TO_VALOPER_ADDRESS> 1000000uself --from <WALLET_NAME> chain-id self-dev-1 -y
Redelegation to another validator
selfchaind tx staking redelegate $(selfchaind keys show <WALLET_NAME> --bech val -a) <TO_VALOPER_ADDRESS> 1000000uself --from <WALLET_NAME> chain-id self-dev-1 -y
Unbond tokens
selfchaind tx staking unbond $(selfchaind keys show <WALLET_NAME> --bech val -a) 1000000uself --from <WALLET_NAME> chain-id self-dev-1 -y
Sending tokens to a wallet
selfchaind tx bank send <WALLET_NAME> <TO_<WALLET_ADDRESS> 1000000uself --from <WALLET_NAME> chain-id self-dev-1
Governance
All proposals
selfchaind query gov proposals
All proposals by ID
selfchaind query gov proposal 1
Vote "YES"
selfchaind tx gov vote 1 yes --from <WALLET_NAME> chain-id self-dev-1 -y
Vote "NO"
selfchaind tx gov vote 1 no --from <WALLET_NAME> chain-id self-dev-1 -y
Vote "Abstain"
selfchaind tx gov vote 1 abstain --from <WALLET_NAME> chain-id self-dev-1 -y
Vote "NoWithVeto"
selfchaind tx gov vote 1 nowithveto --from <WALLET_NAME> chain-id self-dev-1 -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/.selfchain/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/.selfchain/config/app.toml
Disable Indexer
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.selfchain/config/config.toml
Enable Indexer
sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.selfchain/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/.selfchain/config/app.toml
Node support
Validator Info
selfchaind status 2>&1 | jq .ValidatorInfo
Sync info
selfchaind status 2>&1 | jq .SyncInfo
Deleting a node
Before deleting a node make sure you save priv_validator_key.json
systemctl stop selfchaind
systemctl disable selfchaind
rm /etc/systemd/system/selfchaind.service
systemctl daemon-reload
cd $HOME
rm -rf .selfchain
rm -rf $(which selfchaind)
Service setup
Reload service configuration
sudo systemctl daemon-reload
Enable service
sudo systemctl enable selfchaind
Disable service
sudo systemctl disable selfchaind
Start service
sudo systemctl start selfchaind
Stop service
sudo systemctl stop selfchaind
Restart service
sudo systemctl restart selfchaind
Check service status
sudo systemctl status selfchaind
Check service logs
sudo journalctl -u selfchaind -f --no-hostname -o cat
Last updated