Useful commands

# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export XENROCK_CHAIN_ID="gardia-2"" >> $HOME/.bash_profile
source $HOME/.bash_profile

WALLET MANAGEMENT

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

#Add new wallet
zenrockd keys add wallet

#Recover Wallet
zenrockd keys add wallet --recover

#List Wallet
zenrockd keys list

#Delete Wallet
zenrockd keys delete wallet

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

VALIDATOR MANAGEMENT

Please adjust , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUR_WEBSITE_URL

#check pubkey 
zenrockd tendermint show-validator

#Make file validator.json
tee $HOME/.zrchain/validator.json > /dev/null << EOF
{
    "pubkey": YOUR_PUBKEY,
    "amount": "1000000urock",
    "moniker": "MONIKER",
    "identity": "YOUR_KEYBASE_ID",
    "website": "YOUR_WEBSITE_URL",
    "details": "YOUR_DETAILS.",
    "commission-rate": "0.1",
    "commission-max-rate": "0.2",
    "commission-max-change-rate": "0.01",
    "min-self-delegation": "1"
}
EOF

#Create Validator
zenrockd --home $HOME/.zrchain tx staking create-validator $HOME/.zrchain/validator.json --from wallet --chain-id $XENROCK_CHAIN_ID --gas 220000 --gas-prices 1urock

#Unjail Validator
zenrockd tx slashing unjail --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

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

TOKEN MANAGEMENT

#Withdraw Rewards
zenrockd tx distribution withdraw-all-rewards --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

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

#Delegate Token to your own validator
zenrockd tx staking delegate $(zenrockd keys show wallet --bech val -a) 100000urock --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

#Delegate Token to other validator
zenrockd tx staking redelegate $(zenrockd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 100000urock --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

#Unbond Token from your validator
zenrockd tx staking unbond $(zenrockd keys show wallet --bech val -a) 100000urock --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

#Send Token to another wallet
zenrockd tx bank send wallet <TO_WALLET_ADDRESS> 100000urock --from wallet --chain-id $XENROCK_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1urock 

GOVERNANCE

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

#List all proposals
zenrockd query gov proposals

#Create new text proposal
zenrockd tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=10000000urock \
--type="Text" \
--from=wallet \
--gas-adjustment 1.5 \
--gas "auto" \
--gas-prices=1urock

SERVICES MANAGEMENT

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable zenrockd

# Disable Service
sudo systemctl disable zenrockd

# Start Service
sudo systemctl start zenrockd

# Stop Service
sudo systemctl stop zenrockd

# Restart Service
sudo systemctl restart zenrockd

# Check Service Status
sudo systemctl status zenrockd

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

UTILITY

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

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

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

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

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

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

DELETE NODE

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

Last updated