RPC Endpoint
URL:
Description: This endpoint is used for connecting to the blockchain network via RPC (Remote Procedure Call).
API Endpoint
URL:
Description: This endpoint provides access to the REST API for interacting with the blockchain network.
GRPC Endpoint
Description: This endpoint is used for connecting to the blockchain network via gRPC (Google Remote Procedure Call).
Stop the service and reset the data
sudo systemctl stop {{appName}} && \
{{appName}} tendermint unsafe-reset-all --home /root/.{{dirName}} --keep-addr-book
Configure state sync information
SNAP_RPC="https://rpc.{{chainName}}.stakeup.tech:443" && \
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) && \
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && \
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.{{appName}}/config/config.toml
Restart the service and check the log
sudo systemctl restart {{appName}} && journalctl -u {{appName}} -f -o cat
Block |
Size |
Snapshot Time |
Download |
Install lz4 if needed
sudo apt install lz4
Stop service
sudo systemctl stop {{appName}}.service
Backup priv_validator_state.json
cp $HOME/.{{dirName}}/data/priv_validator_state.json $HOME/priv_validator_state.json
Remove old data
rm -rf ~/.{{dirName}}/data
Download snapshot
wget https://snapshots.stakeup.tech/{{chainName}}/{{chainId}}_latest.tar.lz4
lz4 -d -c {{chainId}}_latest.tar.lz4 | tar -xf - -C $HOME/.{{dirName}}
Return your priv_validator_state.json
mv $HOME/priv_validator_state.json $HOME/.{{dirName}}/data/priv_validator_state.json
Download addrbook
wget -O $HOME/.{{dirName}}/config/addrbook.json "https://snapshots.stakeup.tech/{{chainName}}/addrbook.json"
Start service and check logs
sudo systemctl restart {{appName}} && journalctl -u {{appName}} -f -o cat
Peers:
PEERS={{peersChain}}
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" ~/.{{dirName}}/config/config.toml
Seed:
SEED=6b0ffcce9b59b91ceb8eea5d4599e27707e3604a@seeds.stakeup.tech:10220
sed -i.bak -e "s/^seeds =.*/seeds = \"$SEED\"/" ~/.{{dirName}}/config/config.toml
Addrbook:
wget -O $HOME/.{{dirName}}/config/addrbook.json https://snapshots.stakeup.tech/{{chainName}}/addrbook.json
Clone zenrock-validators repository
cd $HOME
rm -rf zenrock-validators
git clone https://github.com/zenrocklabs/zenrock-validators
Build ecdsa binary
cd $HOME/zenrock-validators/utils/keygen/ecdsa && go build
Build bls binary
cd $HOME/zenrock-validators/utils/keygen/bls && go build
Generate keys
read -p "Enter password for the keys: " key_pass
Create sidecar directories
mkdir -p $HOME/.zrchain/sidecar/bin
mkdir -p $HOME/.zrchain/sidecar/keys
Generate ecdsa key
ecdsa_output_file=$HOME/.zrchain/sidecar/keys/ecdsa.key.json
ecdsa_creation=$($HOME/zenrock-validators/utils/keygen/ecdsa/ecdsa --password $key_pass -output-file $ecdsa_output_file)
ecdsa_address=$(echo "$ecdsa_creation" | grep "Public address" | cut -d: -f2)
Generate bls key
bls_output_file=$HOME/.zrchain/sidecar/keys/bls.key.json
$HOME/zenrock-validators/utils/keygen/bls/bls --password $key_pass -output-file $bls_output_file
Output
echo "ecdsa address: $ecdsa_address"
Important: Please ensure your wallet addresses are funded with Holesky $ETH before proceeding.
You can use the Stakely Faucet to acquire testnet ETH for Holesky.
Declare and Configure Variables
Important: To configure the variables, you will need Mainnet ETH and Holesky endpoints.
You can obtain these endpoints from platforms such as
Infura,
QuickNode, or
Ankr.
EIGEN_OPERATOR_CONFIG="$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
TESTNET_HOLESKY_ENDPOINT="YOUR_TESTNET_HOLESKY_ENDPOINT"
MAINNET_ENDPOINT="YOUR_ETH_MAINNET_ENDPOINT"
OPERATOR_VALIDATOR_ADDRESS=$(zenrockd keys show wallet --bech val -a)
OPERATOR_ADDRESS=$ecdsa_address
ETH_RPC_URL="YOUR_TESTNET_HOLESKY_RPC"
ETH_WS_URL="YOUR_TESTNET_HOLESKY_WS"
ECDSA_KEY_PATH=$ecdsa_output_file
BLS_KEY_PATH=$bls_output_file
Copy initial configuration files
cp $HOME/zenrock-validators/scaffold_setup/configs_testnet/eigen_operator_config.yaml $HOME/.zrchain/sidecar/
cp $HOME/zenrock-validators/scaffold_setup/configs_testnet/config.yaml $HOME/.zrchain/sidecar/
Replace variables in config.yaml
sed -i "s|EIGEN_OPERATOR_CONFIG|$EIGEN_OPERATOR_CONFIG|g" "$HOME/.zrchain/sidecar/config.yaml"
sed -i "s|TESTNET_HOLESKY_ENDPOINT|$TESTNET_HOLESKY_ENDPOINT|g" "$HOME/.zrchain/sidecar/config.yaml"
sed -i "s|MAINNET_ENDPOINT|$MAINNET_ENDPOINT|g" "$HOME/.zrchain/sidecar/config.yaml"
Replace variables in eigen_operator_config.yaml
sed -i "s|OPERATOR_VALIDATOR_ADDRESS|$OPERATOR_VALIDATOR_ADDRESS|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
sed -i "s|OPERATOR_ADDRESS|$OPERATOR_ADDRESS|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
sed -i "s|ETH_RPC_URL|$ETH_RPC_URL|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
sed -i "s|ETH_WS_URL|$ETH_WS_URL|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
sed -i "s|ECDSA_KEY_PATH|$ECDSA_KEY_PATH|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
sed -i "s|BLS_KEY_PATH|$BLS_KEY_PATH|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
Change grpc port (or you custom)
sed -i "s|localhost:9790|localhost:9090|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
Download sidecar binary
wget -O $HOME/.zrchain/sidecar/bin/validator_sidecar https://github.com/zenrocklabs/zrchain/releases/download/v5.3.10/validator_sidecar
chmod +x $HOME/.zrchain/sidecar/bin/validator_sidecar
Create and run sidecar service
sudo tee /etc/systemd/system/zenrock-testnet-sidecar.service > /dev/null <<EOF
[Unit]
Description=Validator Sidecar
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/.zrchain/sidecar/bin/validator_sidecar
Restart=on-failure
RestartSec=30
LimitNOFILE=65535
Environment="OPERATOR_BLS_KEY_PASSWORD=$key_pass"
Environment="OPERATOR_ECDSA_KEY_PASSWORD=$key_pass"
Environment="SIDECAR_CONFIG_FILE=$HOME/.zrchain/sidecar/config.yaml"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable zenrock-testnet-sidecar.service
sudo systemctl restart zenrock-testnet-sidecar.service
Check the service logs
journalctl -fu zenrock-testnet-sidecar.service -o cat
Add new wallet
{{appName}} keys add wallet
Recover wallet
{{appName}} keys add wallet --recover
List all wallets
{{appName}} keys list
Delete wallet
{{appName}} keys delete wallet
Export wallet as file
{{appName}} keys export wallet
Import wallet from a file
{{appName}} keys import wallet wallet.backup
Wallet balances
{{appName}} q bank balances $({{appName}} keys show wallet -a)
Validator operations
New validator
{{appName}} tx validation create-validator <(cat <<EOF
{
"pubkey": $({{appName}} comet show-validator),
"amount": "1000000{{tokenName}}",
"moniker": "YOUR_MONIKER",
"identity": "YOUR_KEYBASE",
"website": "YOUR_WEBSITE",
"security": "YOUR_SECURITY_EMAIL",
"details": "YOUR_DETAILS",
"commission-rate": "0.05",
"commission-max-rate": "0.20",
"commission-max-change-rate": "0.05",
"min-self-delegation": "1"
}
EOF
) \
--chain-id {{chainId}} \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices {{feesChain}}{{tokenName}} \
-y
Edit validator
{{appName}} tx staking edit-validator \
--new-moniker "NEW_MONIKER" \
--identity "YOUR_KEYBASE" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE" \
--chain-id {{chainId}} \
--commission-rate 0.05 \
--from wallet \
--gas auto \
--fees {{feesChain}}{{tokenName}} -y
Unjail validator
{{appName}} tx slashing unjail --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Reason a jail
{{appName}} query slashing signing-info $({{appName}} tendermint show-validator)
List all active validators
{{appName}} q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
List all inactive validators
{{appName}} q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Validator details
{{appName}} q staking validator $({{appName}} keys show wallet --bech val -a)
Token operations
Withdraw-all-rewards from validators
{{appName}} tx distribution withdraw-all-rewards --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Withdraw commission and reward from validator
{{appName}} tx distribution withdraw-rewards $({{appName}} keys show wallet --bech val -a) --commission --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Delegate to self validator
{{appName}} tx staking delegate $({{appName}} keys show wallet --bech val -a) 1000000{{tokenName}} --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Delegate to validator
{{appName}} tx staking delegate TO_VALOPER_ADDRESS 1000000{{tokenName}} --from wallet --chain-id {{chainId}} --gas auto --fees {{tokenName}} -y
Redelegate to other validator
{{appName}} tx staking redelegate $({{appName}} keys show wallet --bech val -a) TO_VALOPER_ADDRESS 1000000{{tokenName}} --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Unbond from self validator
{{appName}} tx staking unbond $({{appName}} keys show wallet --bech val -a) 1000000{{tokenName}} --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Transfer tokens
{{appName}} tx bank send wallet TO_WALLET_ADDRESS 1000000{{tokenName}} --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Governance
List all proposals
{{appName}} query gov proposals
Details for proposal
{{appName}} query gov proposal 1
Vote yes for proposal
{{appName}} tx gov vote 1 yes --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Vote no for proposal
{{appName}} tx gov vote 1 no --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Vote abstain for proposal
{{appName}} tx gov vote 1 abstain --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Vote veto for proposal
{{appName}} tx gov vote 1 NoWithVeto --from wallet --chain-id {{chainId}} --gas auto --fees {{feesChain}}{{tokenName}} -y
Node operations
Validator info
{{appName}} status 2>&1 | jq .ValidatorInfo
Sync info
{{appName}} status 2>&1 | jq .SyncInfo
Node peer
echo $({{appName}} tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.{{dirName}}/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Check correct privkey validator
[[ $({{appName}} q staking validator $({{appName}} keys show wallet --bech val -a) -oj | jq -r .consensus_pubkey.key) = $({{appName}} 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:26657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
Reset database
{{appName}} tendermint unsafe-reset-all --keep-addr-book --home $HOME/.{{dirName}} --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!
cd $HOME
sudo systemctl stop {{appName}}.service
sudo systemctl disable {{appName}}.service
sudo rm /etc/systemd/system/{{appName}}.service
sudo systemctl daemon-reload
rm -f $(which {{appName}})
rm -rf $HOME/.{{dirName}}
rm -rf $HOME/{{dirName}}
Service operations
Reload all services
sudo systemctl daemon-reload
Enable service
sudo systemctl enable {{appName}}.service
Disable service
sudo systemctl disable {{appName}}.service
Start service
sudo systemctl start {{appName}}.service
Stop service
sudo systemctl stop {{appName}}.service
Restart Service
sudo systemctl restart {{appName}}.service
Check service status
sudo systemctl status {{appName}}.service
Check service logs
sudo journalctl -u {{appName}}.service -f --no-hostname -o cat