Useful commands

# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export INITIA_CHAIN_ID="initiation-1"" >> $HOME/.bash_profile
source $HOME/.bash_profile

WALLET MANAGEMENT

Add Wallet Specify the value <wallet> with your own wallet name

#Create Wallet
initiad keys add wallet

#Recover Wallet
initiad keys add wallet --recover

#List Wallet
initiad keys list

#Delete Wallet
initiad keys delete wallet

#Check Wallet Balance
initiad q bank balances $(initiad keys show wallet -a)

VALIDATOR MANAGEMENT

Please adjust , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUR_WEBSITE_URL

#Create Validator
initiad tx mstaking create-validator \
--amount=100000000000uinit \
--pubkey=$(initiad tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$INITIA_CHAIN_ID \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=1uinit \
-y

#Edit Validator
initiad tx mstaking edit-validator \
--new-moniker="YOUR MONIKER" \
--identity="IDENTITY KEYBASE" \
--details="DETAILS VALIDATOR" \
--website="LINK WEBSITE" \
--chain-id=$INITIA_CHAIN_ID \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=1uinit \
-y

#Unjail Validator
initiad tx slashing unjail --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Check Jailed Reason
initiad query slashing signing-info $(initiad tendermint show-validator)

TOKEN MANAGEMENT

#Withdraw Rewards
initiad tx distribution withdraw-all-rewards --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Withdraw Rewards with Comission
initiad tx distribution withdraw-rewards $(initiad keys show wallet --bech val -a) --commission --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Delegate Token to your own validator
initiad tx staking delegate $(initiad keys show wallet --bech val -a) 100000000uinit --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Delegate Token to other validator
initiad tx staking redelegate $(initiad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uaum --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Unbond Token from your validator
initiad tx staking unbond $(initiad keys show wallet --bech val -a) 1000000000uinit --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#Send Token to another wallet
initiad tx bank send wallet <TO_WALLET_ADDRESS> 100000000uinit --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

GOVERNANCE

#Vote, You can change the value of yes to no,abstain,nowithveto
initiad tx gov vote 1 yes --from wallet --chain-id $INITIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uinit -y

#List all proposals
initiad query gov proposals

#Create new text proposal
initiad tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=1000000000uinit \
--type="Text" \
--from=wallet \
--gas-prices=1uinit\ 
--gas-adjustment=1.5 \
--gas="auto" \
-y 

SERVICES MANAGEMENT

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable initiad

# Disable Service
sudo systemctl disable initiad

# Start Service
sudo systemctl start initiad

# Stop Service
sudo systemctl stop initiad

# Restart Service
sudo systemctl restart initiad

# Check Service Status
sudo systemctl status initiad

# Check Service Logs
sudo journalctl -u initiad -f --no-hostname -o cat

UTILITY

#Set Indexer NULL / KV
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.initia/config/config.toml

#Get Validator info
initiad status 2>&1 | jq .ValidatorInfo

#Get denom info
initiad q bank denom-metadata -oj | jq

#Get sync status
initiad status 2>&1 | jq .sync_info.catching_up

#Get latest height
initiad status 2>&1 | jq .sync_info.latest_block_height

#Reset Node
initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-book

DELETE NODE

sudo systemctl stop initiad && sudo systemctl disable initiad && sudo rm /etc/systemd/system/initiad.service && sudo systemctl daemon-reload && sudo rm -rf $(which initiad) && rm -rf $HOME/.initia && rm -rf $HOME/initia

Last updated