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