Node ValidatorZenrock Node Update Zenrock Node Zenrock Node Maintenance Guide
This guide provides step-by-step instructions on essential tasks for managing and updating your Zenrock Node, covering core topics such as stopping services, resetting data, downloading snapshots, and maintaining validator and node security.
📌 Stop the Service
To begin, stop the node service before performing updates or maintenance tasks:
Copy sudo systemctl stop zenrock-testnet.service
📌 Reset Data and Backup Validator State
To reset the data while ensuring the validator state is retained, follow these steps:
Copy cp $HOME/.zrchain/data/priv_validator_state.json $HOME/.zrchain/priv_validator_state.json.backup
rm -rf $HOME/.zrchain/data
Snapshot Recovery
Retrieve the latest snapshot for quick restoration:
Copy curl -L https://snapshots.kjnodes.com/zenrock-testnet/snapshot_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.zrchain
mv $HOME/.zrchain/priv_validator_state.json.backup $HOME/.zrchain/data/priv_validator_state.json
Restart Service and Monitor Logs
Restart the service and review log outputs:
Copy sudo systemctl start zenrock-testnet.service && sudo journalctl -fu zenrock-testnet.service -o cat
📡 State Sync Configuration
State Sync allows for faster synchronization by using a recent snapshot of application state.
Stop Service and Reset Data :
Copy sudo systemctl stop zenrock-testnet.service
cp $HOME/.zrchain/data/priv_validator_state.json $HOME/.zrchain/priv_validator_state.json.backup
zenrockd comet unsafe-reset-all --keep-addr-book --home $HOME/.zrchain
Set State Sync Variables :
Copy STATE_SYNC_RPC=https://zenrock-testnet.rpc.kjnodes.com:443
STATE_SYNC_PEER=d5519e378247dfb61dfe90652d1fe3e2b3005a5b@zenrock-testnet.rpc.kjnodes.com:18256
LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(echo "$LATEST_HEIGHT" | awk '{printf "%d000\n", $0 / 1000}')
SYNC_BLOCK_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)
Configure config.toml
:
Copy sed -i \
-e "s|^enable *=.*|enable = true|" \
-e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
-e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
-e "s|^trust_hash *=.*|trust_hash = \"$SYNC_BLOCK_HASH\"|" \
-e "s|^persistent_peers *=.*|persistent_peers = \"$STATE_SYNC_PEER\"|" \
$HOME/.zrchain/config/config.toml
Restore Validator State :
Copy mv $HOME/.zrchain/priv_validator_state.json.backup $HOME/.zrchain/data/priv_validator_state.json
(Optional) Download WASM :
Copy curl -L https://snapshots.kjnodes.com/zenrock-testnet/wasm_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.zrchain
Restart Service and Review Logs :
Copy sudo systemctl start zenrock-testnet.service && sudo journalctl -u zenrock-testnet.service -f --no-hostname -o cat
🗝 Key Management
Easily manage your wallet and keys with the following commands:
Add New Key :
Copy zenrockd keys add wallet
Recover Existing Key :
Copy zenrockd keys add wallet --recover
👷 Validator Management
Ensure your validator is properly configured and operational:
Create New Validator :
Copy zenrockd tx validation create-validator <validator_config> --from wallet --chain-id gardia-2 --gas auto --gas-prices 0urock -y
Edit Validator Information :
Copy zenrockd tx validation edit-validator --new-moniker "YOUR_MONIKER" --from wallet --chain-id gardia-2 --gas auto --gas-prices 0urock -y
💲 Token Management
Manage tokens efficiently with these commands:
Withdraw All Rewards :
Copy zenrockd tx distribution withdraw-all-rewards --from wallet --chain-id gardia-2 --gas auto --gas-prices 0urock -y
🗳 Governance Participation
Stay active in governance decisions:
Vote 'Yes' :
Copy zenrockd tx gov vote <proposal_id> yes --from wallet --chain-id gardia-2 --gas auto --gas-prices 0urock -y
⚡️ Utility Commands
Adjust node settings for optimized performance:
Update Ports :
Copy sed -i -e "s|PORT_VARIABLE|NEW_PORT|" $HOME/.zrchain/config/config.toml
Enable Prometheus Monitoring :
Copy sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.zrchain/config/config.toml
🚨 Maintenance Tasks
Get Validator Info :
Copy zenrockd status 2>&1 | jq .ValidatorInfo
List Live Peers :
Copy curl -sS http://localhost:18257/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"'
Last updated 4 months ago