Maintenance & Utility
#Get validator information
sided status 2>&1 | jq .ValidatorInfo
#Get sync information
sided status 2>&1 | jq .SyncInfo
#Get node peer
echo $(sided tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.sided/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
#Check validator keys
[[ $(sided q staking validator $(sided keys show wallet --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(sided 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/.sided/config/app.toml
#Enable prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.sided/config/config.toml
#Reset chain data
sudo systemctl stop sided
cp $HOME/.sided/data/priv_validator_state.json $HOME/.sided/priv_validator_state.json.backup
sided tendermint unsafe-reset-all --keep-addr-book --home $HOME/.sided
#Remove node
cd $HOME
sudo systemctl stop sided
sudo systemctl disable sided
sudo rm /etc/systemd/system/sided.service
sudo systemctl daemon-reload
sudo rm -f $(which sided)
sudo rm -rf $HOME/.side
sudo rm -rf $HOME/side
sudo rm -rf $HOME/go
#Enable indexer
sed -i -e 's|^indexer *=.*|indexer = "kv"|' $HOME/.side/config/config.toml
#Disable indexer
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.side/config/config.toml
#Pruning update
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.side/config/app.toml
#Custom port
CUSTOM_PORT=111
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}66\"%" $HOME/.side/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}17\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}80\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}91\"%" $HOME/.side/config/app.toml
Last updated