Skip to main content

Setup

The Starknet Staking v2 validator can be configured using several methods, with the following order of precedence:

  1. Command line parameters
  2. Environment variables
  3. Configuration file
Protocol Context

For detailed information about validator roles, address types, and security practices in Starknet's staking protocol, see the official Starknet staking documentation.

Configuration Methods​

Each tab configures the same validator, so you can compare the methods side by side. The Docker examples use --network host, so localhost reaches the node and the signer running on the host.

The validator can be configured directly on the command line:

docker run --network host nethermind/starknet-staking-v2 \
--provider-http "http://localhost:6060/rpc/v0_10" \
--provider-ws "ws://localhost:6061/rpc/v0_10" \
--signer-op-address "0x123" \
--signer-url "http://localhost:8080"
tip

Command line parameters override environment variables and configuration file.

Mixed Configuration​

You can combine multiple configuration methods. Values set by command line flags will override environment variables, and environment variables will override configuration file settings.

PROVIDER_HTTP_URL="http://localhost:6060/rpc/v0_10" ./validator \
--config config.json \
--provider-ws "ws://localhost:6061/rpc/v0_10" \
--signer-url "http://localhost:8080" \
--log-level debug

Signing Methods​

The validator supports two signing approaches:

  1. Internal signing where you provide your private key to the validator and it signs on your behalf.
  2. External signing where the validator requests a remote service for your signature. Read more about the remote signer's HTTP protocol.
docker run --network host nethermind/starknet-staking-v2 \
--provider-http "http://localhost:6060/rpc/v0_10" \
--provider-ws "ws://localhost:6061/rpc/v0_10" \
--signer-op-address "0x123" \
--signer-priv-key "0x456"
Signing Method Required

You must provide exactly one signing method: either a private key for internal signing (--signer-priv-key, SIGNER_PRIVATE_KEY or privateKey) or an external signer URL (--signer-url, SIGNER_EXTERNAL_URL or url). If both are provided, the validator won't start.

What's Next?​