Skip to content

Latest commit

 

History

History
172 lines (120 loc) · 4.45 KB

DEV_GUIDE.md

File metadata and controls

172 lines (120 loc) · 4.45 KB



SSV - Development Guide

Usage

Common Commands

Build

$ make build

Test

$ make full-test

Lint

$ make lint-prepare
$ make lint

Specify Version

$ ./bin/ssvnode version

Splitting a Validator Key

We split an eth2 BLS validator key into shares via Shamir-Secret-Sharing(SSS) to be used between the SSV nodes.

# Extract Private keys from mnemonic (optional, skip if you have the public/private keys ) 
$ ./bin/ssvnode export-keys --mnemonic="<mnemonic>" --index={keyIndex}

# Generate threshold keys
$ ./bin/ssvnode create-threshold --count <number of ssv nodes> --private-key <privateKey>

Generating an Operator Key

$ ./bin/ssvnode generate-operator-keys

Config Files

Config files are located in ./config directory:

Node Config

Specifies general configuration regards the current node.
Example yaml - config.yaml

Shares Config

For a 4 node SSV network, 4 share.yaml files need to be created, based on the template file.
E.g. ./config/share1.yaml, ./config/share2.yaml, etc.

Running a Local Network of Operators

This section details the steps to run a local network of operator nodes.

Install

Prerequisites

In order to run a local environment, install the following:

  • git
  • go (1.15)
  • docker
  • make

Clone Repository

$ git clone https://github.com/bloxapp/ssv.git

Build Binary

$ make build

Configuration

Split Validator Key

Split a validator key to distribute to the nodes in your network.
See Splitting a Validator Key.

Create Config Files

Node Config

Fill the required fields in config.yaml file.
Note - there's no need to fill the OperatorPrivateKey field.

Shares Config

Create 4 .yaml files with the corresponding configuration, based on the template file.
The files should be placed in the ./config directory (./config/share1.yaml, ./config/share2.yaml, etc.)

Run

Run a local network using docker

Local network with 4 nodes with Docker Compose

$ make docker-all 

Local network with 4 nodes for debugging with Docker Compose

$ make docker-debug 

Prometheus and Grafana for local network

In order to spin up local prometheus and grafana use:

$ make docker-monitor

For a grafana dashboard, use the SSV Operator dashboard as explained in monitoring/README.md#grafana

Coding Standards

Please make sure your contributions adhere to our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Pull requests need to be based on and opened against the stage branch, and its commits should be squashed on merge.