Skip to main content

Useful Commands

Cheat Sheet

Wallet

Add New Wallet Key

wardend keys add wallet

Recover existing key

wardend keys add wallet --recover

List All Keys

wardend keys list

Query Wallet Balance

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

Check sync status

wardend status 2>&1 | jq .sync_info

Create Validator

Obtain your validator public key by running the following command:

wardend tendermint show-validator

The output will be similar to this (with a different key): {"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="} Then, create a file named validator.json with the following content: Change your info, from "pubkey" to "details" and Save them

{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="},
"amount": "5000000000000000000award",
"moniker": "your-node-moniker",
"identity": "eqlab testnet validator",
"website": "optional website for your validator",
"security": "optional security contact for your validator",
"details": "optional details for your validator",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}

Finally, we're ready to submit the transaction to create the validator:

wardend tx staking create-validator $HOME/validator.json \
--from=wallet \
--fees=250000000000000award \
--chain-id=barra_9191-1 \
--node=https://rpc.chiado.wardenprotocol.org \
--gas=auto \
--gas-adjustment=1.6 -y

Delegate Token to your own validator

wardend tx staking delegate $(wardend keys show wallet --bech val -a) 5000000000000000000award \
--from=wallet \
--fees=250000000000000award \
--chain-id=barra_9191-1 \
--node=https://rpc.chiado.wardenprotocol.org \
--gas=auto \
--gas-adjustment=1.6 -y

Withdraw rewards and commission from your validator

wardend tx distribution withdraw-rewards $(wardend keys show wallet --bech val -a) --from wallet --commission --chain-id barra_9191-1 --gas auto --gas-adjustment 1.6 --fees 250000000000000award -y

Withdraw all rewards

wardend tx distribution withdraw-rewards $(wardend keys show wallet --bech val -a) \
--from=wallet \
--fees=250000000000000award \
--chain-id=barra_9191-1 \
--node=https://rpc.chiado.wardenprotocol.org \
--gas=auto \
--gas-adjustment=1.6 -y

Unjail validator

wardend tx slashing unjail \
--from=wallet \
--fees=250000000000000award \
--chain-id=barra_9191-1 \
--node=https://rpc.chiado.wardenprotocol.org \
--gas=auto \
--gas-adjustment=1.6 -y

Services Management

# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable wardend

# Disable Service
sudo systemctl disable wardend

# Start Service
sudo systemctl start wardend

# Stop Service
sudo systemctl stop wardend

# Restart Service
sudo systemctl restart wardend

# Check Service Status
sudo systemctl status wardend

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

Backup Validator

cat $HOME/.warden/config/priv_validator_key.json

State Sync

sudo systemctl stop wardend

cp $HOME/.warden/data/priv_validator_state.json $HOME/.warden/priv_validator_state.json.backup

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

SNAP_RPC="https://warden-testnet-rpc.validrop.xyz:443"

PEERS="f8fd5c186c01f568b3620d3554d0235b81770339@185.233.107.75:18656,84376de171068c766d55f4cbc6dc9c5ddbfbd367@45.9.63.55:18656,c489c003b7c72298840bd4411ffc98ce13e07c27@54.194.136.183:26656,837d8748b4d5f6bd21f58a87fb5c5bcf9d60d0c7@65.108.121.227:13556,879983e2505beb7a7de601b0cd83218e12b6ed31@144.76.112.58:38656,957ffac6023cee86adacbae225896a2221c28d0d@195.26.252.175:37656,698dba7dfae4495b2f0ddc552451c0654e679dda@95.216.13.161:18656,4f0c7c817e1a964a04b8bb490050669909fd2153@135.181.232.241:64656,d301d25b48ebebd1257d4944e31c3a9f11835f39@152.53.137.213:29656,9c7564f341a9ac63217b7bc8f1de65cbecb09f55@188.40.66.173:27356,da8ea8a131db1c9ade0b9e1089adfd9330e3246f@65.109.78.246:22656,9dd2caead4b41af780256da0c2282a0c84c8d7fa@193.26.157.178:18656,7345881034f09a7b6e621bed6f803168139a9a62@167.235.14.83:13656,abd2849ba845fa044bf4756e6f03c55699f41e13@65.109.111.234:18656,acfdadaa26e0d31448df70c1f35792f00081b3bf@144.76.70.103:13656,c0b2b0e7a5e2b7787856f22908b16eeb69f14e77@89.233.108.37:18656,6ac41e45f21c43edc92f836be96cae60438f6960@136.243.74.81:18656,67d40ecbbeb648afb411ef440bc0634de2cdfa4f@156.67.216.175:37656,7b4a217429f859deacdbe725f4fd6bdf989db5e0@193.203.15.135:26656,85807889c06713452d5a330f7660bbf3106aa598@152.53.136.97:18656,cc5cee5fb9629072a7ef1127f16d87124adc1e34@207.244.239.234:31656,41a3a66993696c5e5d44945de2036227a4578fb3@195.201.241.107:56296,0f5133bc1b50edc13b7ddc850e39507bc220f559@157.180.52.245:31656,2852653cacde1c1235967c8efb5b8a134ac0178d@167.86.90.163:18656,5bae3d352b52a83fde25f04bccb0d4d937a32e23@62.210.101.39:30856,a416f0a5a925a3cd40ceb166aeab43e71748c1dc@95.217.109.206:11956,36428c56eef63eecab8ccc7800ce2e3f3d7a321b@167.235.115.23:27356,dad0ee83e8040133e1b08b89385f36ac7a67fc58@185.218.125.146:18656,142aa404c688ae2b8bf745d82ca6782d7ec6c35e@65.21.221.110:19656,fb3c995373c0feee597dd3ed32e56cb5e0f0d1c2@65.108.120.161:26726,6f1ba284e755d26ba3a28631ec6fb1d0c2e44847@152.53.138.77:18656,b5fa185e73936f8cf8adeed7c81e78348056ef82@152.53.151.237:18656,a796f2982d26ea5d91bc6eabd8762834ac8cdca5@38.242.154.120:18656,2ac42aa25005bcb06e63a07abb37e252fccc46b5@144.91.79.28:37656,c06eefafade8141218c7f59d467cbaccfb79b98c@65.21.10.115:27356,ff37394693e96769342c1710c46704293c109c61@46.4.91.76:32056,4efbc056eeefdb3d07c51a056af63d2b16426375@148.72.141.64:26652,da55db59030869772dc439ffe9daf04a3a279b03@185.232.70.33:21656,30b1384f9f4ae8a1644dabb92ad4715a8b155404@51.79.78.121:26656,f3d4c4f5f7cb8482f9ebda096732a2190cef4cbb@168.119.10.134:24346,130ecc3bd7dcd99d0daa9216f760c5f804872ffc@167.235.178.134:27356,b57831096e4dbfb4899f4f02237da94145a36835@31.215.174.35:17104,baf98d88fdb1f6e8df1455fa04179aecdef7223a@23.88.5.169:10056,4065947bcfb852616732f9ca5bea9693a949eabb@84.247.184.122:27656,77b1370e4c14496f44d9893e5b74ba5efba14d6b@162.55.224.194:27656,80213d13021c2b55d1efae520065473e8b51199a@142.132.194.124:17104,43848deb8584befc4b07d72d3ad80818962069ae@123.17.118.218:18656,8663a786148a713e380b8b352cf050a581d6b322@195.3.221.75:38656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.warden/config/config.toml

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height);
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000));
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && sleep 2

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ;
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ;
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ;
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.warden/config/config.toml

mv $HOME/.warden/priv_validator_state.json.backup $HOME/.warden/data/priv_validator_state.json

sudo systemctl restart wardend && sudo journalctl -u wardend -f --no-hostname -o cat

Snapshot

sudo systemctl stop wardend

cp $HOME/.warden/data/priv_validator_state.json $HOME/.warden/priv_validator_state.json.backup

rm -rf $HOME/.warden/data $HOME/.warden/wasmPath

curl https://storage.validrop.xyz/Testnet/Warden/warden_snap.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.warden

mv $HOME/.warden/priv_validator_state.json.backup $HOME/.warden/data/priv_validator_state.json

sudo systemctl restart wardend && sudo journalctl -u wardend -f --no-hostname -o cat

Remove node

sudo systemctl stop wardend && sudo systemctl disable wardend && \
sudo rm /etc/systemd/system/wardend.service && sudo systemctl daemon-reload && \
rm -rf $HOME/.warden && \
rm -rf $HOME/wardenprotocol && \
rm -rf $HOME/warden_auto && \
rm -f $(which wardend) && \
rm -rf $HOME/warden