Maintenance & Utility

#Get validator information
wardend status 2>&1 | jq .ValidatorInfo

#Get sync information
wardend status 2>&1 | jq .SyncInfo

#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/".*//')

#Check validator keys
[[ $(wardend q staking validator $(wardend keys show wallet --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(selfchaind status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"

#Get live peers
curl -sS http://localhost:24257/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

#Configure minimum gas prices
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025side\"/" $HOME/.warden/config/app.toml

#Enable prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.warden/config/config.toml

#Reset chain data
sudo systemctl stop wardend
cp $HOME/.warden/data/priv_validator_state.json $HOME/.warden/priv_validator_state.json.backup
wardend tendermint unsafe-reset-all --keep-addr-book --home $HOME/.warden

#Remove node
cd $HOME
sudo systemctl stop wardend
sudo systemctl disable wardend
sudo rm /etc/systemd/system/wardend.service
sudo systemctl daemon-reload
sudo rm -f $(which wardend)
sudo rm -rf $HOME/.warden
sudo rm -rf $HOME/warden
sudo rm -rf $HOME/go

Last updated