Maintenance & Utility

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

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

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

#Check validator keys
[[ $(alignedlayerd q staking validator $(alignedlayerd keys show wallet --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(alignedlayerd 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.0025stake\"/" $HOME/.alignedlayer/config/app.toml

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

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

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

Last updated