Start DKG Node
We recommend running the tool with docker compose. It is the simplest option and only requires Docker. A Docker image is published with every release.
SSV Stack
If you chose to set up your SSV Node with the SSV Stack repository, you can start the DKG node in three steps:
-
Edit configuration file
./dkg-data/operator.yamloperatorID- the ID of your operatorethEndpointURL- HTTP Address of your Execution node endpoint
-
Run the command
docker compose --profile dkg up -d- Make sure you're running from
ssv-stackdirectory
- Make sure you're running from
-
Go to Final Steps
Manual Configuration
All of the necessary configuration information can be provided via command line parameters, but a YAML config file is often the most convenient way, thus it's what this documentation page will be discussing.
A simple approach is to keep all required files in one folder, for example ssv-dkg-data, together with operator.yaml.
The final result should look like so:
ssv@localhost:~/# tree ssv-dkg-data
ssv-dkg-data
├── encrypted_private_key.json
├── operator.yaml
└── password
1 directories, 3 files
An example operator.yaml file is shown below. Update the highlighted values before you use it:
privKey: ./data/encrypted_private_key.jsonprivKeyPassword: ./data/passwordoperatorID: YOUR_OPERATOR_IDport: 3030logLevel: infologFormat: jsonlogLevelFormat: capitalColorlogFilePath: ./data/debug.logoutputPath: ./data/outputethEndpointURL: http://ethnodeURL:8545 #HTTP Address of Execution Node, needed for Multisig validator owner addresses# serverTLSCertPath: ./data/ssl/tls.crt #Only enable if manually generated TLS certificate# serverTLSKeyPath: ./data/ssl/tls.key #Only enable if manually generated TLS keyIn the config above, ./data/ refers to the container's shared volume created by Docker through -v or volumes. You do not need to create the data directory yourself.
Start SSV-DKG Node
- docker compose
- docker run
- Build from source
To start and manage the DKG tool, we recommend docker compose.
This section assumes that all the necessary files (encrypted_private_key.json, operator.yaml, password) are under the same folder. Edit the highlighted value with the actual path:
services: ssv-dkg: image: ssvlabs/ssv-dkg:latest pull_policy: always restart: "unless-stopped" container_name: ssv-dkg volumes: - ./folder_with_config_file:/ssv-dkg/data ports: - 3030:3030/tcp command: ["start-operator", "--configPath", "./data/operator.yaml"] networks: - [local-docker]You can, of course, change the configuration above to one that suits you better, just be mindful about changing the path references in the docker command and in the operator.yaml file as well. The two need to be consistent with each other.
To launch the container, run:
docker compose up
- This keeps the terminal attached so you can review logs during startup.
- If everything looks good, use
docker compose up -d.
If all required files (encrypted_private_key.json, operator.yaml, password) are in the same folder, replace the path below with the real one:
docker run --restart unless-stopped --name ssv-dkg -p 3030:3030 -v ./path_to_config_file:/ssv-dkg/data -it "ssvlabs/ssv-dkg:latest" start-operator --configPath ./data/operator.yamlYou can, of course, change the configuration above to one that suits you better, just be mindful about changing the path references in the docker command and in the operator.yaml file as well. The two need to be consistent with each other.
This keeps the terminal attached so you can review logs during startup.
If everything looks good, add -d right after docker run.
A prerequisite for this is to have go version 1.22 installed on the system, and an optional requirement is to have the make tool installed as well (alternatively you could run the corresponding command defined in the Makefile).
Clone repository
Clone the ssv-dkg repository in your local machine:
git clone git@github.com:ssvlabs/ssv-dkg.git
Build
From the project's root folder, run the following command:
make install
SSL certificate
Running the DKG tool as a Docker container automatically creates and manages the TLS certificate. If you build from source, you need to do this yourself.
But don't worry, the entry-point.sh script in the repository is what is used by the Docker container, you could use that as an example for how to create an SSL certificate for your DKG node. For example:
mkdir ssl
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "tls.key" -out "tls.crt" -subj "/C=CN/ST=GD/L=SZ/O=localhost, Inc./CN=localhost"
Launch with command line parameters
To run the DKG tool as an operator, you can launch the following command with the appropriate values to each parameter:
ssv-dkg start-operator --privKey ./operator-config/encrypted_private_key.json --privKeyPassword ./operator-config/password --operatorID YOUR_OPERATOR_ID --port 3030 --logLevel info --logFormat json --logLevelFormat capitalColor --logFilePath ./operator-config/debug.log --outputPath ./operator-config/output --serverTLSCertPath ./operator-config/ssl/tls.crt --serverTLSKeyPath ./operator-config/ssl/tls.key --ethEndpointURL http://ethnodeURL:8545Parameter reference:
| Argument | Type | Description |
|---|---|---|
--privKey | string | Path to private key of ssv operator |
--port | int | Port for listening messages (default: 3030) |
--privKeyPassword | string | Path to password file to decrypt the key |
--operatorID | int | An integer, representing the ID of the operator, registered on the SSV network |
--logLevel | debug | info | warning | error | critical | Logger's log level (default: debug) |
--logFormat | json | console | Logger's encoding (default: json) |
--logLevelFormat | capitalColor | capital | lowercase | Logger's level format (default: capitalColor) |
--logFilePath | string | Path to file where logs should be written (default: ./data/debug.log) |
--outputPath | string | Path to store results (default ./output) |
--serverTLSCertPath | string | Path to server TLS certificate (default: ./ssl/tls.crt) |
--serverTLSKeyPath | string | Path to server TLS private key (default: ./ssl/tls.key) |
--ethEndpointURL | string | Ethereum node endpoint URL (default: http://127.0.0.1:8545) |
Launch with YAML config file
It is also possible to use YAML configuration file, just as it was shown in the Configuration section above.
Then the tool can be launched from the root folder, by running this command:
ssv-dkg start-operator --configPath ./operator-config/operator.yaml
If the --configPath parameter is not provided, ssv-dkg will be looking for a file named config.yaml in ./config/ folder at the same root as the binary (i.e. ./config/config.yaml)
What's next?
Once you finish this page, go to Final Steps.