Start Operator
You are ready to run the Operator Service using the start command, passing your Vault address and consensus and execution endpoints as flags.
Prerequisites
If you did not use Operator Service to generate validator keys, you will need to add the following flag:
--keystores-dir- The directory with validator keys in the EIP-2335 ↗ standard. The folder must contain either a singlepassword.txtpassword file for all keystores or separate password files for each keystore with the same name as keystore, but ending with.txt(e.g.,keystore1.json,keystore1.txt)
If you did not use Operator Service to generate the hot wallet, you will need to add the following flags:
--hot-wallet-file- Path to the password-protected.txtfile containing your hot wallet private key--hot-wallet-password-file- Path to a.txtfile containing the password to open the protected hot wallet private key file
If you did not use Operator Service to generate deposit data file, or you use combined deposit data file from multiple operators, you will need to add the following flag:
--deposit-data-file- Path to the deposit data file (Vault directory is default)
There are several ways to run the Operator Service, depending on how you store private keys.
Running Options
Depending on your installation method, use the appropriate command format:
- Binary
- Docker
- Source Files
Using Binary
./operator start \
--vault=0xf27...10ad9 \
--consensus-endpoints=https://consensus-node \
--execution-endpoints=https://execution-node
Using Docker
For Docker, you first need to mount the folder containing validator keystores and include the --data-dir flag alongside the start command:
docker run --restart on-failure:10 \
-u $(id -u):$(id -g) \
-v ~/.stakewise/:/data \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v4.0.14 \
src/main.py start-local \
--vault=0xf27...10ad9 \
--data-dir=/data \
--consensus-endpoints=http://localhost:5052 \
--execution-endpoints=http://localhost:8545
Using Source Files
PYTHONPATH=. poetry run python src/main.py start-local \
--vault=0xf27...10ad9 \
--consensus-endpoints=http://localhost:5052 \
--execution-endpoints=http://localhost:8545
Setup Complete
Congratulations 🎉! Your Operator Service is now running and ready to trigger validator registrations within your Vault. Monitor the logs to ensure validators are being registered successfully.
Optional Flags
| Flag | Description |
|---|---|
--min-validators-registration | Minimum number of validators required to start registration |
--pool-size | Number of processes in a pool |
--log-level | The log level. Options: fatal, error, warning, info, debug |
--log-format | The log record format. Options: plain or json |
--hashi-vault-parallelism | How many requests to K/V secrets engine to do in parallel |
--hashi-vault-key-prefix | Key prefix(es) in the K/V secret engine under which validator signing keys are stored |
--hashi-vault-key-path | Key path(s) in the K/V secret engine where validator signing keys are stored |
--hashi-vault-token | Authentication token for accessing HashiCorp Vault |
--hashi-vault-url | The base URL of the vault service (e.g., http://vault:8200) |
--remote-signer-url | The base URL of the remote signer (e.g., http://signer:9000) |
--vault | Address of the Vault to register validators for |
--consensus-endpoints | Comma separated list of API endpoints for consensus nodes |
--execution-jwt-secret | JWT secret key used for signing and verifying JSON Web Tokens when connecting to execution nodes |
--execution-endpoints | Comma separated list of API endpoints for execution nodes |
--harvest-vault | Whether to submit vault harvest transactions. Default: false |
-v, --verbose | Enable debug mode. Default: false |
--metrics-port | The Prometheus metrics port. Default: 9100 |
--metrics-prefix | The Prometheus metrics prefix. Default: sw_operator |
--metrics-host | The Prometheus metrics host. Default: 127.0.0.1 |
--enable-metrics | Whether to enable metrics server. Default: disabled |
--network | The network of the Vault. Options: mainnet, hoodi, gnosis, chiado. Default: network specified at init command |
--deposit-data-file | Path to the deposit_data.json file. Default: file generated with create-keys command |
--keystores-dir | Absolute path to the directory with all the encrypted keystores. Default: directory generated with create-keys command |
--keystores-password-file | Absolute path to the password file for decrypting keystores. Default: file generated with create-keys command |
--hot-wallet-file | Absolute path to the hot wallet. Default: file generated with create-wallet command |
--hot-wallet-password-file | Absolute path to the hot wallet password file. Default: file generated with create-wallet command |
--max-fee-per-gas-gwei | Maximum fee per gas for transactions. Default: 10 Gwei for Ethereum, 2 Gwei for Gnosis |
--database-dir | The directory where the database will be created or read from. Default: ~/.stakewise/<vault> |
--data-dir | Path where the vault data will be placed. Default: ~/.stakewise |
Reduce CPU Load
The --pool-size flag can be passed with both start and create-keys commands. This flag defines the number of CPU cores used to load and create keystores. By default, Operator Service will use 100% of the CPU cores.
Setting --pool-size to (number of CPU cores) / 2 is a safe way to ensure that Operator Service does not take up too much CPU load and impact node performance during the creation and loading of keystores.
Environment Variables
Operator Service can be configured via environment variables instead of CLI flags. Copy this example file ↗ and save it as .env. Adjust as necessary based on your node configuration.
Load environment variables before running Operator Service:
export $(grep -v '^#' .env | xargs)
You can check the environment variables are set and loaded correctly by running env.
Next Steps
Continue to Additional Actions → to explore optional configurations and integrations to enhance your Operator Service setup, including validator performance tracking with Rated Network.