CLI Cheatsheet
Key management
Add New Key
sourced keys add wallet
Recover Existing Key
sourced keys add wallet --recover
List All Keys
sourced keys list
Delete Key
sourced keys delete wallet
Export Key to File
sourced keys export wallet
Import Key From File
sourced keys import wallet wallet.backup
Query Wallet Balance
sourced q bank balances $(sourced keys show wallet -a)
Validator management
Please make sure you have adjusted moniker, identity, details and website to match your values.
Edit Existing Validator
sourced tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id source-1 \
--commission-rate 0.10 \
--from wallet_name \
--gas="auto" \
--gas-prices="0.025usource" \
--gas-adjustment="1.15" \
-y
Unjail Validator
sourced tx slashing unjail --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto" -y
View Validator Details
sourced q staking validator $(sourced keys show wallet --bech val -a)
Token management
Withdraw Rewards From All Validator
sourced tx distribution withdraw-all-rewards --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Withdraw Commission and Rewards From Your Validator
sourced tx distribution withdraw-rewards $(sourced keys show wallet --bech val -a) --commission --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Delegate Tokens to Yorself
sourced tx staking delegate $(sourced keys show wallet --bech val -a) 1000000usource --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Delegate Elegate Tokens to Validator
sourced tx staking delegate TO_VALOPER_ADDRESS 1000000usource --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Redelegate Tokens to Another Validator
sourced tx staking redelegate $(sourced keys show wallet --bech val -a) TO_VALOPER_ADDRESS 1000000usource --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Unbound Tokens From Your Validator
sourced tx staking unbond $(sourced keys show wallet --bech val -a) 1000000usource --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto" -y
Governance
List all proposals
sourced query gov proposals
Vote Proposal
Vote YES / NO / ABSTAIN / NO_WITH_VETO
sourced tx gov vote 1 yes --from wallet --chain-id source-1 --gas-prices "0.025usource" --gas-adjustment 1.5 --gas "auto"
Create new text proposal
sourced tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=100000000usource \
--type="Text" \
--from=wallet \
--gas-prices 0usource\
--gas-adjustment 1.5 \
--gas "auto"
Utility
Update Ports
CUSTOM_PORT=53
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}66\"%" $HOME/.haqqd/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}17\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}80\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}91\"%" $HOME/.haqqd/config/app.toml
Update Indexer
Disable indexer
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.haqqd/config/config.toml
Enable indexer
sed -i -e 's|^indexer *=.*|indexer = "kv"|' $HOME/.haqqd/config/config.toml
Update Pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.haqqd/config/app.toml
Maintenance
Get validator Info
haqqd status 2>&1 | jq .ValidatorInfo
Get Sync Info
haqqd status 2>&1 | jq .SyncInfo
Get Node Peer
echo $(haqqd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.haqqd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Get Live Peers
curl -sS http://localhost:14657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
Set Minimum Gas Price
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025aISLM\"/" $HOME/.haqqd/config/app.toml
Enable Prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.haqqd/config/config.toml
Reset Chain Data
haqqd tendermint unsafe-reset-all --keep-addr-book --home $HOME/.haqqd --keep-addr-book
Check Service Logs
sudo journalctl -u haqqd -f --no-hostname -o cat
Remove Node
Please, before proceeding with the next step! All chain data will be lost! Make sure you have backed up your priv_validator_key.json!
cd $HOME
sudo systemctl stop haqqd
sudo systemctl disable haqqd
sudo rm /etc/systemd/system/haqqd.service
sudo systemctl daemon-reload
rm -f $(which haqqd)
rm -rf $HOME/.haqqd
rm -rf $HOME/haqq