Sidecar Setup
Step 1: Clone zenrock-validators repository
cd $HOME
rm -rf zenrock-validators
git clone https://github.com/zenrocklabs/zenrock-validators
Step 2: Generate keys
# Set key password
read -p "Enter password for the keys: " key_pass
# Create sidecar directories
mkdir -p $HOME/.zrchain/sidecar/bin
mkdir -p $HOME/.zrchain/sidecar/keys
# 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 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"
Step 3: Top up your wallet address
Please fund your wallet addresses with Holesky $ETH before proceeding further.
Step 4: Set operator configuration
Ensure that you have configured TESTNET_HOLESKY_ENDPOINT, MAINNET_ENDPOINT, ETH_RPC_URL, ETH_WS_URL with your specific values.
# Declare variables
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"
sed -i "s|/root-data|$HOME/.zrchain|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"
# Set grpc endpoint in eigen_operator_config.yaml
sed -i "s|localhost:9790|localhost:18290|g" "$HOME/.zrchain/sidecar/eigen_operator_config.yaml"
Step 5: Download sidecar binary
wget -O $HOME/.zrchain/sidecar/bin/validator_sidecar https://github.com/zenrocklabs/zrchain/releases/download/v5.16.9/validator_sidecar
chmod +x $HOME/.zrchain/sidecar/bin/validator_sidecar
Step 6: Create and run sidecar service
Create service
sudo tee /etc/systemd/system/zenrock-sidecar.service > /dev/null <<EOF
[Unit]
Description=Validator Sidecar
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/.zrchain/sidecar/bin/validator_sidecar
WorkingDirectory=$HOME/.zrchain/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
Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable zenrock-sidecar.service
sudo systemctl start zenrock-sidecar.service
Step 7: Check the service logs
To check service logs use command below:
journalctl -fu zenrock-sidecar.service -o cat
Successfull Log examples:
{"level":"info","ts":1740170221.3904564,"caller":"operator/operator.go:271","msg":"Starting operator."}
{"level":"info","ts":1740170221.3904843,"caller":"nodeapi/nodeapi.go:104","msg":"Starting node api server at address 0.0.0.0:29591"}
{"level":"info","ts":1740170221.39056,"caller":"metrics/eigenmetrics.go:81","msg":"Starting metrics server at port 0.0.0.0:29592"}
{"level":"info","ts":1740170221.390627,"caller":"nodeapi/nodeapi.go:238","msg":"node api server running","addr":"0.0.0.0:29591"}
{"level":"info","ts":1740170221.4404917,"caller":"chainio/avs_subscriber.go:63","msg":"Subscribed to new TaskManager tasks"}
2025/02/22 02:07:40 INFO Received AVS contract state for network="Holešky Ethereum Testnet" block=3399867
2025/02/22 02:07:40 INFO Received prices ROCK/USD=0.038290000000000000 BTC/USD=95234.680000000000000000 ETH/USD=2646.125000000000000000
2025/02/22 02:08:14 INFO Received AVS contract state for network="Holešky Ethereum Testnet" block=3399869
2025/02/22 02:08:14 INFO Received prices ROCK/USD=0.038290000000000000 BTC/USD=95234.680000000000000000 ETH/USD=2646.125000000000000000
2025/02/22 02:08:45 INFO Received AVS contract state for network="Holešky Ethereum Testnet" block=3399871
2025/02/22 02:08:45 INFO Received prices ROCK/USD=0.038290000000000000 BTC/USD=95234.680000000000000000 ETH/USD=2646.125000000000000000
2025/02/22 02:09:08 INFO Received AVS contract state for network="Holešky Ethereum Testnet" block=3399874
2025/02/22 02:09:08 INFO Received prices ROCK/USD=0.038290000000000000 BTC/USD=95234.680000000000000000 ETH/USD=2646.125000000000000000
2025-02-22 02:09:08.800 [ERR] Neutrino_mainnet: Unable to parse IP network for peer cji3k7mree3l2oxskftt4lw7nmpuvojjagzgnkkdrj557gshqupzqryd.onion:8333: unsupported IP type
Step 8: Backup operator config and keys
To back up your sidecar configuration and keys, ensure you have a copy of the $HOME/.zrchain/sidecar
directory.
Last updated