UPDATE PORTS
set custom ports in config.toml file
Copy sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%g;
s%:26657%:${CUSTOM_PORT}657%g;
s%:6060%:${CUSTOM_PORT}060%g;
s%:26656%:${CUSTOM_PORT}656%g;
s%:26660%:${CUSTOM_PORT}660%g" $HOME /.0gchain/config/config.toml
set custom ports in app.toml
Copy sed -i.bak -e "s%:1317%:${CUSTOM_PORT}317%g;
s%:8080%:${CUSTOM_PORT}080%g;
s%:9090%:${CUSTOM_PORT}090%g;
s%:9091%:${CUSTOM_PORT}091%g;
s%:8545%:${CUSTOM_PORT}545%g;
s%:8546%:${CUSTOM_PORT}546%g;
s%:6065%:${CUSTOM_PORT}065%g" $HOME /.0gchain/config/app.toml
set custom ports in client.toml file
Copy sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%g" $HOME /.0gchain/config/client.toml
UPDATE INDEXER
Disable indexer
Copy sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME /.0gchain/config/config.toml
Enable indexer
Copy sed -i -e 's|^indexer *=.*|indexer = "kv"|' $HOME /.0gchain/config/config.toml
UPDATE PRUNING
Copy 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 /.0gchain/config/app.toml
GET VALIDATOR INFO
Copy 0gchaind status 2>&1 | jq .ValidatorInfo
GET SYNC INFO
Copy 0gchaind status 2>&1 | jq .SyncInfo
GET NODE PEER
Copy echo $( 0gchaind tendermint show-node-id ) '@' $( curl -s ifconfig.me ) ':' $( cat $HOME /.0gchain/config/config.toml \
| sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//' )
CHECK IF VALIDATOR KEY IS CORRECT
Copy [[ $( 0gchaind q staking validator $( 0gchaind keys show wallet --bech val -a ) -oj \
| jq -r .consensus_pubkey.key ) = $( 0gchaind 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
Copy curl -sS http://localhost:15657/net_info \
| jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' \
| awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||'
SET MINIMUM GAS PRICE
Copy sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ua0gi\"/" $HOME /.0gchain/config/app.toml
ENABLE PROMETHEUS
Copy sed -i -e "s/prometheus = false/prometheus = true/" $HOME /.0gchain/config/config.toml
RESET CHAIN DATA - !!!BE CAREFUL HERE!!!
Copy 0gchaind tendermint unsafe-reset-all --keep-addr-book --home $HOME /.0gchain --keep-addr-book
REMOVE NODE
Please, before proceeding with the next step! All chain data will be lost! Make sure you have backed up your priv_validator_key.json!
Copy cd $HOME
sudo systemctl stop 0gchaind.service
sudo systemctl disable 0gchaind.service
sudo rm /etc/systemd/system/0gchaind.service
sudo systemctl daemon-reload
rm -f $( which 0gchaind )
rm -rf $HOME /.0gchain
rm -rf $HOME /0gchaind
RELOAD SERVICE CONFIGURATION
Copy sudo systemctl daemon-reload
ENABLE SERVICE
Copy sudo systemctl enable 0gchaind.service
DISABLE SERVICE
Copy sudo systemctl disable 0gchaind.service
START SERVICE
Copy sudo systemctl start 0gchaind.service
STOP SERVICE
Copy sudo systemctl stop 0gchaind.service
RESTART SERVICE
Copy sudo systemctl restart 0gchaind.service
CHECK SERVICE STATUS
Copy sudo systemctl status 0gchaind.service
CHECK SERVICE LOGS
Copy sudo journalctl -u 0gchaind.service -f --no-hostname -o cat --since 1h
Last updated 4 months ago