Useful commands

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

WALLET MANAGEMENT

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

#Add new wallet
c4ed keys add wallet

#Recover Wallet
c4ed keys add wallet --recover

#List Wallet
c4ed keys list

#Delete Wallet
c4ed keys delete wallet

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

VALIDATOR MANAGEMENT

Please adjust , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUR_WEBSITE_URL

#Create Validator
c4ed tx staking create-validator \
--amount=1000000uc4e \
--pubkey=$(c4ed tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$C4E_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=1uc4e \ 
-y

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

#Unjail Validator
c4ed tx slashing unjail --from wallet --chain-id $C4E_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uc4e -y

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

TOKEN MANAGEMENT

#Withdraw Rewards
c4ed tx distribution withdraw-all-rewards --from wallet --chain-id $C4E_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uc4e -y

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

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

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

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

#Send Token to another wallet
c4ed tx bank send wallet <TO_WALLET_ADDRESS> 100000uc4e --from wallet --chain-id $C4E_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 1uc4e -y

GOVERNANCE

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

#List all proposals
c4ed query gov proposals

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

SERVICES MANAGEMENT

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable c4ed

# Disable Service
sudo systemctl disable c4ed

# Start Service
sudo systemctl start c4ed

# Stop Service
sudo systemctl stop c4ed

# Restart Service
sudo systemctl restart c4ed

# Check Service Status
sudo systemctl status c4ed

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

UTILITY

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

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

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

#Get sync status
c4ed status 2>&1 | jq .SyncInfo.catching_up

#Get latest height
c4ed status 2>&1 | jq .SyncInfo.latest_block_height

#Reset Node
c4ed tendermint unsafe-reset-all --home $HOME/.c4e-chain --keep-addr-book

DELETE NODE

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

Last updated