πŸ’‘ Useful commands

βš™οΈ Service Commands

Check Logs

sudo journalctl -u wardend -f -o cat

Start service

sudo systemctl start wardend

Stop service

sudo systemctl stop wardend

Restart service

sudo systmctl restart wardend

Check status

sudo systemctl status wardend

Enable Service

sudo systemctl enable wardend

Reload service

sudo systemctl daemon-reload

Disable service

sudo systemctl disable wardend

Check synchronization status

wardend status | jq | grep "catching_up"

If "true" - not synchronized // "false" - synchronized

Check the latest block of your validator and the last block of the network

while true; do 
  local_height=$(wardend status | jq -r .sync_info.latest_block_height)
  network_height=$(curl -s https://rpc.warden-testnet.unitynodes.com/status | jq -r '.result.sync_info.latest_block_height')
  blocks_left=$((network_height - local_height))

  echo -e "\033[1;33m[Sync Status]\033[0m \033[1;32mNode Height:\033[0m \033[1;37m$local_height\033[0m | \033[1;32mNetwork Height:\033[0m \033[1;37m$network_height\033[0m | \033[1;32mBlocks Left:\033[0m \033[1;31m$blocks_left\033[0m"

  sleep 5
done

Example:

View the ports used node

ss -tulpn | grep wardend

βš™οΈ Key Command

Create new wallet

wardend keys add wallet

Recovery wallet

wardend keys add wallet --recover

List all wallet

wardend keys list

Delete wallet

wardend keys delete wallet

Export wallet

wardend keys export wallet

Import wallet

wardend keys import wallet wallet.backup 

Check wallet balance

wardend q bank balances $(wardend keys show wallet -a) 

βš™οΈ Validator Commands

Create a validator.json file

touch $HOME/.warden/config/validator.json

Open a validator.json file

nano $HOME/.warden/config/validator.json

Paste this into the open validator.json file, pre-replacing all values ​​that start with $ (you can do it in any convenient editor, not directly in nano mode)

To find out your pubkey, use the command

wardend comet show-validator

Output Example:

The output will be similar to this (with a different key):

{"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="}
{
        "pubkey": {$PUBKEY},
        "amount": "1000000uward",
        "moniker": "$MONIKER",
        "identity": "$IDENTITY",
        "website": "$WEBSITE",
        "security": "$EMAIL",
        "details": "$DETAILS",
        "commission-rate": "0.1",
        "commission-max-rate": "0.2",
        "commission-max-change-rate": "0.01",
        "min-self-delegation": "1"
}

β—½ Replace the following values with your own: WALLET - usually it's 'wallet', or your wallet's name. MONIKER - any convenient name for your validator, displayed in the explorer. IDENTITY - validator's avatar, displayed in the explorer. Create a KeyBase ID following the instructions or leave it empty, and it will default to a standard one. DETAILS - details about your validator, also displayed in the explorer.

Replace all necessary values indicated above with the $ sign to successfully create your validator. β—½ Example:

{
        "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="},
        "amount": "1000000uward",
        "moniker": "Oliver",
        "identity": "", #if you have your identifier, replace it, or leave it blank
        "website": "", #if you have your website, replace it, or leave it blank
        "security": "qwerty@gmail.com",
        "details": "A reliable validator", 
        "commission-rate": "0.1",
        "commission-max-rate": "0.2",
        "commission-max-change-rate": "0.01",
        "min-self-delegation": "1"
}

After creating the validator.json and entering all the necessary information, as well as provided that there are tokens in the wallet, run the create command:

wardend tx staking create-validator $HOME/.warden/config/validator.json \
--chain-id buenavista-1 \
--gas-adjustment="1.5" \
 --node https://rpc.warden.unitynodes.com:443 --fees 3000uward \
--from wallet

Update validator information

wardend tx staking edit-validator $HOME/.warden/config/validator.json \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "$NEW_DETAILS" \
--from $WALLET \
--chain-id buenavista-1 \
--fees 2000uward \
-y

Validator details

wardend q staking validator $(wardend keys show wallet --bech val -a)

Jailing info

wardend q staking validator $(wardend keys show wallet --bech val -a) | grep -E "jailed"

If "true" - your validator is jailed // "false" - your validator is not jailed

Jail reason

wardend  q slashing signing-info $(wardend tendermint show-validator)

Unjail command

wardend tx slashing unjail \
--chain-id buenavista-1 \
--gas-prices 0.005uward \
--gas-adjustment 1.5 \
--from wallet \ # Or another wallet name
-y 

Information about delegation at your validator

wardend q staking validator $(wardend keys show wallet --bech val -a) | grep -E "tokens"

Active Validators list

wardend q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl

Inactive Validator list

wardend q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED" or .status=="BOND_STATUS_UNBONDING")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl 

Signing Info

wardend query slashing signing-info $(wardend tendermint show-validator) 

βš™οΈ Tokens Commands

Delegate to yourself

wardend tx staking delegate $(wardend keys show wallet --bech val -a) 1000000uward --from wallet --chain-id buenavista-1 --fees 2000uward -y 

Delegate to another validator

wardend tx staking delegate <TO_VALOPER_ADDRESS> 1000000uward --from $WALLET --chain-id buenavista-1 --fees 2000uward -y

Redelegate your stake to other validator

wardend tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000uward --from $WALLET --chain-id buenavista-1 --fees 2000uward -y

Unbond stake

wardend tx staking unbond $(wardend keys show $WALLET --bech val -a) 1000000uward --from $WALLET --chain-id buenavista-1 --fees 2000uward -y

Send tokens

wardend tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000uward --fees 2000uward -y

Check wallet balance

wardend q bank balances $(wardend keys show wallet -a)

Transaction details

wardend query tx HASH_TX

Withdraw all rewards

wardend tx distribution withdraw-all-rewards --from $WALLET --chain-id buenavista-1 --fees 2000uward

Withdraw rewards and commission from your validator

wardend tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id buenavista-1 --fees 2000uward -y

βš™οΈ Governance

List All Proposals

wardend query gov proposals

View proposal by ID

wardend query gov proposal ID

Vote "YES"

wardend tx gov vote PROPOSAL_ID yes --from wallet --chain-id buenavista-1 --fees 2000uward  -y

Vote "NO"

wardend tx gov vote PROPOSAL_ID no --from wallet --chain-id buenavista-1 --fees 2000uward  -y

Vote "NO_WITH_VETO"

wardend tx gov vote PROPOSAL_ID no_with_veto --from wallet --chain-id buenavista-1 --fees 2000uward  -y

Vote "ABSTAIN"

wardend tx gov vote PROPOSAL_ID abstain --from wallet --chain-id buenavista-1 --fees 2000uward  -y

Create new text proposal

wardend tx gov submit-proposal \
--title="Title" \ #Change Title
--description="Description" \
--deposit=1000000uward \
--type="Text" \   #Change text proposal
--from=wallet \   #Change name wallet
--gas-prices=0.000001uward \
--gas-adjustment=1.5 \
-y 

βš™οΈ Utility

Set Custom Port

# Change CUSTOM_PORT to any other value, or leave it as is.
CUSTOM_PORT=28
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%; s%:26657%:${CUSTOM_PORT}657%; s%:6060%:${CUSTOM_PORT}060%; s%:26656%:${CUSTOM_PORT}656%; s%:26660%:${CUSTOM_PORT}660%" $HOME/.warden/config/config.toml && sed -i.bak -e "s%:9090%:${CUSTOM_PORT}090%; s%:9091%:${CUSTOM_PORT}091%; s%:1317%:${CUSTOM_PORT}317%; s%:8545%:${CUSTOM_PORT}545%; s%:8546%:${CUSTOM_PORT}546%; s%:6065%:${CUSTOM_PORT}065%" $HOME/.warden/config/app.toml && sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%" $HOME/.warden/config/client.toml
sudo systemctl restart wardend
journalctl -u wardend -f -o cat

Set Indexer

sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.warden/config/config.toml

Update Pruning

sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "17"|' $HOME/.warden/config/app.toml

Reset node

wardend tendermint unsafe-reset-all --home $HOME/.warden --keep-addr-book

Get denom info

wardend q bank denom-metadata -oj | jq

Get Node Peer

echo $(wardend tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.warden/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//') 

Update server name

 sudo hostnamectl set-hostname server_name

How much SSD use node (currently)

du -sh $HOME/.warden/

How much RAM use node (currently)

ps -p $(pgrep wardend) -o rss= | awk '{printf("The process uses memory:: %.2f MB\n", $1/1024)}'

How much CPU use node (currently)

ps -C wardend -o %cpu --no-headers | awk '{print $1"% CPU"}'

Delete node

sudo systemctl stop wardend
sudo systemctl disable wardend
sudo rm -rf /etc/systemd/system/wardend.service
sudo rm $(which wardend)
sudo rm -rf $HOME/warden
sudo rm -rf $HOME/.warden

Last updated