Useful commands

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

WALLET MANAGEMENT

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

#Add new wallet
regen keys add wallet

#Recover Wallet
regen keys add wallet --recover

#List Wallet
regen keys list

#Delete Wallet
regen keys delete wallet

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

VALIDATOR MANAGEMENT

Please adjust , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUR_WEBSITE_URL

#Create Validator
regen tx staking create-validator \
--amount=10000000uregen \
--pubkey=$(regen tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$REGEN_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=10uregen\ 
-y

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

#Unjail Validator
regen tx slashing unjail --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

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

TOKEN MANAGEMENT

#Withdraw Rewards
regen tx distribution withdraw-all-rewards --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

#Withdraw Rewards with Comission
regen tx distribution withdraw-rewards $(regen keys show wallet --bech val -a) --commission --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

#Delegate Token to your own validator
regen tx staking delegate $(regen keys show wallet --bech val -a) 1000000uregen --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

#Delegate Token to other validator
regen tx staking redelegate $(regen keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uregen --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

#Unbond Token from your validator
regen tx staking unbond $(regen keys show wallet --bech val -a) 1000000uregen --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

#Send Token to another wallet
regen tx bank send wallet <TO_WALLET_ADDRESS> 1000000uregen --from wallet --chain-id $REGEN_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uregen -y

GOVERNANCE

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

#List all proposals
regen query gov proposals

#Create new text proposal
regen tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=100000000uregen \
--type="Text" \
--from=wallet \
--gas-adjustment 1.5 \
--gas "auto" \
--gas-prices=10uregen\ 
-y

SERVICES MANAGEMENT

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable regen

# Disable Service
sudo systemctl disable regen

# Start Service
sudo systemctl start regen

# Stop Service
sudo systemctl stop regen

# Restart Service
sudo systemctl restart regen

# Check Service Status
sudo systemctl status regen

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

UTILITY

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

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

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

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

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

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

DELETE NODE

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

Last updated