Installing and Running Starknet Validator Attestation

This guide describes how to build, configure, and run the Starknet Validator Attestation service — which performs validator attestations for the Starknet Mainnet.

Requirements

Before starting, make sure you have:

  • A running Starknet node (e.g., Pathfinder) with support for the JSON-RPC v0.9.0 API.
  • Staking contracts properly set up and registered with Staking v2.
  • Sufficient STRK balance in the operational account to pay for attestation transactions.
  • Linux host with at least:
  • 2+ CPU cores
  • 4 GB RAM
  • 20 GB free disk space

Install Rust

Rust is required to build the attestation binary from source.
The following commands install Rust, enable it in your shell, and add the rustfmt component (for code formatting and compatibility).

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup component add rustfmt

Build Binary

Check the latest release tag on the official Equilibrium Labs repository: 👉 https://github.com/eqlabs/starknet-validator-attestation

Set the desired tag (replace with the latest stable release):

export TAG=v0.5.1

Clone the repository:

git clone https://github.com/eqlabs/starknet-validator-attestation.git
cd starknet-validator-attestation

Checkout the specified version:

git checkout $TAG

Compile the binary with CPU optimizations for your machine. This may take several minutes depending on your hardware.

export RUSTFLAGS='-C target-cpu=native'; cargo build --release

Create directories for versioned releases and copy the compiled binary:

mkdir -p $HOME/.starknet-validator-attestation/releases/$TAG/bin
cp $HOME/starknet-validator-attestation/target/release/starknet-validator-attestation \
   $HOME/.starknet-validator-attestation/releases/$TAG/bin
ln -sf $HOME/.starknet-validator-attestation/releases/$TAG \
   $HOME/.starknet-validator-attestation/active-release

Create a systemd Service

Set up a systemd unit file to run the attestation service in the background. This ensures automatic restart and log integration. ⚠️ Important: Fill in the environment variables:

  • VALIDATOR_ATTESTATION_OPERATIONAL_PRIVATE_KEY — private key of your operational account
  • VALIDATOR_ATTESTATION_STAKER_OPERATIONAL_ADDRESS — corresponding account address
tee /etc/systemd/system/starknet-validator-attestation.service > /dev/null <<EOF
[Unit]
Description=Starknet Mainnet Validator Attestation
After=network-online.target
Wants=network-online.target

[Service]
User=root
Group=root
WorkingDirectory=/root/.pathfinder
Environment="VALIDATOR_ATTESTATION_OPERATIONAL_PRIVATE_KEY="
Environment="VALIDATOR_ATTESTATION_STAKER_OPERATIONAL_ADDRESS="

ExecStart=/root/.starknet-validator-attestation/active-release/bin/starknet-validator-attestation \
  --local-signer \
  --staking-contract-address 0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 \
  --attestation-contract-address 0x10398fe631af9ab2311840432d507bf7ef4b959ae967f1507928f5afe888a99 \
  --node-url http://localhost:9545/rpc/v0_9 \
  --metrics-address 127.0.0.1:9091

Restart=on-failure
RestartSec=5
StartLimitInterval=60
StartLimitBurst=3
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target
EOF

The attestation service exposes a Prometheus monitoring endpoint at:

http://127.0.0.1:9091/metrics

Start Attestation Service

Enable the service to start automatically on boot and start it immediately:

systemctl enable starknet-validator-attestation.service
systemctl start starknet-validator-attestation.service

Monitor logs to confirm successful startup:

journalctl -o cat -fu starknet-validator-attestation.service

Expected output should indicate successful attestation rounds and RPC connections.

Prometheus Metrics

The service exposes a /metrics endpoint compatible with Prometheus. It provides live data about:

  • Attestation success/failure counts
  • RPC latency and health
  • Process uptime and status

Example configuration for your Prometheus prometheus.yml:

scrape_configs:
  - job_name: 'starknet-attestation'
    static_configs:
      - targets: ['127.0.0.1:9091']