Chain ID: cosmoshub-4 | Node Version: v27.6.0
note
First You Need Set Variabels
MONIKER=<YOUR_MONIKER_NAME>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export COSMOSHUB_CHAIN_ID="cosmoshub-4"" >> $HOME/.bash_profile
source $HOME/.bash_profile
- Wallet
- Validator
- Token
- Service
- Governance
- Utility
- Delete
Wallet
Create Wallet
gaiad keys add wallet
Recovery Wallet
gaiad keys add wallet --recover
List All Wallet
gaiad keys list
Delete Wallet
gaiad keys delete wallet
Check Wallet Balance
gaiad q bank balances $(gaiad keys show wallet -a)
Validator
note
Make sure you have adjust YOUR_KEYBASE_ID, YOUR_DETAILS, YOUR_WEBSITE_URL
Create Validator
gaiad tx staking create-validator \
--amount=1000000uatom \
--pubkey=$(gaiad tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$COSMOSHUB_CHAIN_ID \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000 \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=0.005uatom
Edit Validator
gaiad tx staking edit-validator \
--new-moniker="YOUR MONIKER" \
--identity="IDENTITY KEYBASE" \
--details="DETAILS VALIDATOR" \
--website="LINK WEBSITE" \
--chain-id=$COSMOSHUB_CHAIN_ID \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=0.005uatom
Check Jailed Reason
gaiad query slashing signing-info $(gaiad tendermint show-validator)
Unjail Validator
gaiad tx slashing unjail --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Token
Withdraw Rewards
gaiad tx distribution withdraw-all-rewards --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Withdraw Rewards with Comission
gaiad tx distribution withdraw-rewards $(gaiad keys show wallet --bech val -a) --commission --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Delegate Tokens to Your Validator
gaiad tx staking delegate $(gaiad keys show wallet --bech val -a) 1000000uatom --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Redelegate Tokens to Another Validator
gaiad tx staking redelegate $(gaiad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uatom --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Unbond Tokens from Your Validator
gaiad tx staking unbond $(gaiad keys show wallet --bech val -a) 1000000uatom --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Send Tokens to Any Wallet
gaiad tx bank send wallet <TO_WALLET_ADDRESS> 1000000uatom --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Service
Reload Service
sudo systemctl daemon-reload
Enable Service
sudo systemctl enable gaiad
Disable Service
sudo systemctl disable gaiad
Start Service
sudo systemctl start gaiad
Stop Service
sudo systemctl stop gaiad
Restart Service
sudo systemctl restart gaiad
Check Service Status
sudo systemctl status gaiad
Check Service Logs
sudo journalctl -u gaiad -f --no-hostname -o cat
Governance
tip
For Vote, You can change the value of yes to no, abstain, no_with_veto
Vote
gaiad tx gov vote 1 yes --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
List all Proposals
gaiad query gov proposals
Check Vote
gaiad tx gov vote PROPOSAL_NUMBER VOTE_OPTION --from wallet --chain-id $COSMOSHUB_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 0.005uatom -y
Create new Proposal
gaiad tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=10000000uatom \
--type="Text" \
--from=wallet \
--gas-adjustment 1.5 \
--gas "auto" \
--gas-prices=0.005uatom \
-y
Utility
Set Indexer null / kv
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.gaia/config/config.toml
Get Validator Info
gaiad status 2>&1 | jq .ValidatorInfo
Get Denom Info
gaiad q bank denom-metadata -oj | jq
Get Sync Status
gaiad status 2>&1 | jq .SyncInfo.catching_up
Get Latest Height
gaiad status 2>&1 | jq .SyncInfo.latest_block_height
Get Node Peer
echo $(gaiad tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.gaia/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Set Minimum Gas Price
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.005uatom\"/" $HOME/.gaia/config/app.toml
Enable Prometheus
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.gaia/config/config.toml
Reset Chain Data
gaiad tendermint unsafe-reset-all --home $HOME/.gaia --keep-addr-book
Delete
WARNING!!! Please, before you advance to the following step! The entire chain data will be gone! Make sure you have a backup of your priv_validator_key.json!
Delete Node
sudo systemctl stop gaiad && sudo systemctl disable gaiad && sudo rm /etc/systemd/system/gaiad.service && sudo systemctl daemon-reload && sudo rm -rf $(which gaiad) && rm -rf $HOME/.gaia