βοΈ Service Commands
Check Logs
Copy sudo journalctl -u zenrockd -f -o cat
Start service
Copy sudo systemctl start zenrockd
Stop service
Copy sudo systemctl stop zenrockd
Restart service
Copy sudo systmctl restart zenrockd
Check status
Copy sudo systemctl status zenrockd
Enable Service
Copy sudo systemctl enable zenrockd
Reload service
Copy sudo systemctl daemon-reload
Disable service
Copy sudo systemctl disable zenrockd
Check synchronization status
Copy while true ; do
local_height = $( zenrockd status | jq -r .sync_info.latest_block_height )
network_height=$(curl -s https://rpc.zenrock-testnet.unitynodes.com/status | jq -r '.result.sync_info.latest_block_height')
blocks_left = $(( network_height - local_height ))
echo -e "\033[1;33m[Sync Status]\033[0m \033[1;32mNode Height:\033[0m \033[1;37m$local_height\033[0m | \033[1;32mNetwork Height:\033[0m \033[1;37m$network_height\033[0m | \033[1;32mBlocks Left:\033[0m \033[1;31m$blocks_left\033[0m"
sleep 5
done
If "Block left - 0" - synchronized
Check the latest block of your validator
Copy zenrockd status | jq '.SyncInfo.latest_block_height // .sync_info.latest_block_height'
View the ports used node
Copy ss -tulpn | grep zenrockd
βοΈ Key Command
Create new wallet
Copy zenrockd keys add wallet
Recovery wallet
Copy zenrockd keys add wallet --recover
List all wallet
Delete wallet
Copy zenrockd keys delete wallet
Export wallet
Copy zenrockd keys export wallet
Import wallet
Copy zenrockd keys import wallet wallet.backup
Check wallet balance
Your balance Balance another wallet
Copy zenrockd q bank balances $( zenrockd keys show wallet -a )
Copy zenrockd q bank balances "Any other or your wallet"
βοΈ Validator Commands
Create a validator.json file
Copy touch $HOME /.zrchain/config/validator.json
To find out your pubkey, use the command (Save your Pubkey)
Copy zenrockd comet show-validator
Output Example:
The output will be similar to this (with a different key):
Copy { "@type" : "/cosmos.crypto.ed25519.PubKey" , "key" : "+vMHVm134I+Rh4kNqLG/YwvQqDy+YqcZqWtgp7ABUop0=" }
Open a validator.json file
Copy nano $HOME /.zrchain/config/validator.json
Paste this into the open validator.json
file, pre-replacing all values ββthat start with $
(you can do it in any convenient editor, not directly in nano mode)
Copy {
"pubkey" : {
"@type" : "/cosmos.crypto.ed25519.PubKey" ,
"key" : ""
},
"amount" : "1000000urock" ,
"moniker" : "Oliver" ,
"identity" : "" ,
"website" : "" ,
"security" : "" ,
"details" : "Trusted Blockchain validator" ,
"commission-rate" : "0.05" ,
"commission-max-rate" : "0.2" ,
"commission-max-change-rate" : "0.2" ,
"min-self-delegation" : "1"
}
β½ Replace the following values with your own:
WALLET - usually it's 'wallet', or your wallet's name.
MONIKER - any convenient name for your validator, displayed in the explorer.
IDENTITY - validator's avatar, displayed in the explorer. Create a KeyBase ID following the instructions or leave it empty, and it will default to a standard one.
DETAILS - details about your validator, also displayed in the explorer.
WEBSITE - your website/github/twitter, etc., if you don't want to specify anything - leave it blank
Replace all necessary values indicated above with the $ sign to successfully create your validator.
β½ Example:
Copy {
"pubkey" : {
"@type" : "/cosmos.crypto.ed25519.PubKey" ,
"key" : "+vMHVm134I+Rh4kNqLG/YwvQqDy+YqcZqWtgp7ABUop0="
},
"amount" : "1000000uttnt" ,
"moniker" : "Oliver" ,
"identity" : "" , #if you have your identifier, replace it, or leave it blank
"website" : "" , #if you have your website, replace it, or leave it blank
"security" : "" ,
"details" : "Trusted Blockchain validator" ,
"commission-rate" : "0.05" ,
"commission-max-rate" : "0.2" ,
"commission-max-change-rate" : "0.2" ,
"min-self-delegation" : "1"
}
After entering and changing all values, save the file with the key combination Ctrl + X and press Enter
After creating the validator.json and entering all the necessary information, as well as provided that there are tokens in the wallet, run the create command:
Copy zenrockd tx staking create-validator $HOME /.zrchain/config/validator.json \
--chain-id gardia-2 \
--gas-adjustment= "1.5" \
--fees 500urock \
--from wallet
After entering the command, you will receive hash transactions, check the status in the explorer if the status is successful - you have created a validator.
You can find your validator here: explorer In the Active / Inactive lists.
Update validator information
Copy zenrockd tx staking edit-validator \
--new-moniker "" \
--identity "" \
--details "" \
--website "" \
--chain-id gardia-2 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices \
-y
Validator details
Copy zenrockd q staking validator $( zenrockd keys show wallet --bech val -a )
Jailing info
Copy zenrockd q staking validator $( zenrockd keys show wallet --bech val -a ) | grep -E "jailed"
If "true" - your validator is jailed // "false" - your validator is not jailed
Jail reason
Copy zenrockd q slashing signing-info $( zenrockd tendermint show-validator )
Unjail command
Copy zenrockd tx slashing unjail --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Information about delegation at your validator
Copy zenrockd q staking validator $( zenrockd keys show wallet --bech val -a ) | grep -E "tokens"
Active Validators list
Copy zenrockd q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " " + .description.moniker' | sort -gr | nl
Inactive Validator list
Copy zenrockd q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED" or .status=="BOND_STATUS_UNBONDING")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Signing Info
Copy zenrockd query slashing signing-info $( zenrockd tendermint show-validator )
βοΈ Tokens Commands
Delegate to yourself
Copy zenrockd tx staking delegate $(zenrockd keys show wallet --bech val -a) --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Delegate to another validator
Copy zenrockd tx staking redelegate $(zenrockd keys show wallet --bech val -a) TO_VALOPER_ADDRESS --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Redelegate your stake to other validator
Copy zenrockd tx staking redelegate $(zenrockd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Unbond stake
Copy zenrockd tx staking unbond $(zenrockd keys show wallet --bech val -a) --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Send tokens
Copy zenrockd tx bank send wallet <TO_WALLET_ADDRESS> --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Check wallet balance
Copy zenrockd q bank balances $( zenrockd keys show wallet -a )
Transaction details
Copy zenrockd query tx HASH_TX
Withdraw all rewards
Copy zenrockd tx distribution withdraw-all-rewards --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Withdraw rewards and commission from your validator
Copy zenrockd tx distribution withdraw-rewards $(zenrockd keys show wallet --bech val -a) --commission --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
βοΈ Governance
List All Proposals
Copy zenrockd query gov proposals
View proposal by ID
Copy zenrockd query gov proposal ID
Vote "YES"
Copy zenrockd tx gov vote 1 yes --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Vote "NO"
Copy zenrockd tx gov vote 1 no --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Vote "NO_WITH_VETO"
Copy zenrockd tx gov vote 1 NoWithVeto --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Vote "ABSTAIN"
Copy zenrockd tx gov vote 1 abstain --from wallet --chain-id gardia-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.025urock -y
Create new text proposal
Copy zenrockd tx gov submit-proposal \
--title="Title" \ #Change Title
--description="Description" \
--deposit=1000000urock \
--type="Text" \ #Change text proposal
--from=wallet \ #Change name wallet
--fees 500urock
-y
βοΈ Utility
Set Custom Port
Copy #PORT 35
sed -i.bak -e "s%:1317%:2217%g;
s%:8080%:8980%g;
s%:9090%:9990%g;
s%:9091%:9991%g;
s%:8545%:9445%g;
s%:8546%:9446%g;
s%:6065%:6965%g" $HOME/.zrchain/config/app.toml
sed -i.bak -e "s%:26658%:35658%g;
s%:26657%:35657%g;
s%:6060%:6960%g;
s%tcp://0.0.0.0:26656%tcp://0.0.0.0:35656%g;
s%:26660%:35660%g" $HOME/.zrchain/config/config.toml
sed -i.bak -e "s%:26657%:35657%g" $HOME/.zrchain/config/client.toml
sudo systemctl restart zenrockd && sudo journalctl -u zenrockd -f -o cat
Set Indexer
null kv
Copy sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.zrchain/config/config.toml
Copy sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.zrchain/config/config.toml
Update Pruning
Copy sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.zrchain/config/app.toml
Reset node
Copy zenrockd tendermint unsafe-reset-all --home $HOME/.zrchain --keep-addr-book
Get denom info
Copy zenrockd q bank denom-metadata -oj | jq
Get Node Peer
Copy echo $(zenrockd tendermint show-node-id)'@'$(curl -4 -s ifconfig.me)':'$(cat $HOME/.zrchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Update server name
Copy sudo hostnamectl set-hostname server_name
How much SSD use node (currently)
Copy du -sh $HOME/.zrchain/
How much RAM use node (currently)
Copy sudo systemctl status zenrockd | grep "Memory:"
How much CPU use node (currently)
Copy ps -C zenrockd -o %cpu --no-headers | awk '{print $1"% CPU"}'
Delete node
Copy sudo systemctl stop zenrockd
sudo systemctl disable zenrockd
sudo rm -rf /etc/systemd/system/zenrockd.service
sudo rm $(which zenrockd)
sudo rm -rf $HOME/.zrchain
sudo rm -rf $HOME/zenrock