Attestation Setup
Guide to Set Up Starknet Validator Attestation with starknet-staking-v2
This guide walks through installing the attestation validator component using the starknet-staking-v2 tool from Nethermind. You will compile the binary, configure the validator, and create a systemd service to run it continuously.
1. Clone the repository and checkout tag v0.2.5
git clone https://github.com/NethermindEth/starknet-staking-v2.git
cd starknet-staking-v2
git fetch --tags
git checkout v0.2.5
2. Compile the validator binary
make validator
./build/validator --version
3. Create the validator config.json
cat > /home/(user)/starknet-staking-v2/config.json <<EOF
{
"provider": {
"http": "http://127.0.0.1:6062/v0_8",
"ws": "ws://127.0.0.1:6069/v0_8"
},
"signer": {
"operationalAddress": "0x0...",
"privateKey": "0x0..."
}
}
EOF
4. Secure config file permissions
sudo chown (user):(user) /home/(user)/starknet-staking-v2/config.json
chmod 600 /home/(user)/starknet-staking-v2/config.json
5. Make config file immutable (optional)
sudo chattr +i /home/(user)/starknet-staking-v2/config.json
# To remove immutability later:
sudo chattr -i /home/(user)/starknet-staking-v2/config.json
6. Create systemd service
sudo tee /etc/systemd/system/starknet-validator.service > /dev/null <<EOF
[Unit]
Description=Starknet Attestation Validator
After=network-online.target
[Service]
User=(user)
WorkingDirectory=/home/(user)/starknet-staking-v2
ExecStart=/home/(user)/starknet-staking-v2/build/validator \
--metrics --metrics-host "0.0.0.0" --metrics-port "9096" \
--config /home/(user)/starknet-staking-v2/config.json
Restart=always
RestartSec=5
LimitNOFILE=50000
[Install]
WantedBy=multi-user.target
EOF
7. Start the validator service
sudo systemctl daemon-reload
sudo systemctl enable --now starknet-validator
sudo journalctl -fu starknet-validator
8. Check exposed metrics (optional)
http://<your-server-ip>:9096/metrics
http://<your-server-ip>:9096/health