Home

Awesome

Viewpoint

End-to-end framework to test Ethereum network clients.

Build

$ go build -o viewpoint cmd/main.go

Quickstart

Start the server:

$ viewpoint server --name test [--genesis-time 1m] [--num-genesis-validators 10] [--min-genesis-validator-count 10] [--num-tranches 1]
2022-07-15T20:48:31.093+0200 [INFO]  viewpoint: eth1 server deployed: addr=http://127.0.0.1:8001
2022-07-15T20:48:31.093+0200 [INFO]  viewpoint: deposit contract deployed: addr=0xB96198679b67b455FD654aEfC91bF31DC9C0886D
2022-07-15T20:48:35.017+0200 [INFO]  viewpoint: GRPC Server started: addr=localhost:5555

The server command starts the Viewpoint agent which handles the lifecycle of an Ethereum (post-merge) network. At startup, it generates an initial set of validator accounts (num-genesis-validators), splits them in tranches (num-tranches) and creates a genesis.ssz file. Each validator client will own a single tranche of accounts.

The deployment of the nodes is done using Docker containers which are stopped once the server process is over. The agent creates an e2e-<name> folder in the root directory where all the metadata, specs and node logs are stored.

Now, lets deploy a validator client for the network.

$ viewpoint node deploy validator --type [prysm|lighthouse|teku] --tranche 0 --beacon --beacon-count 2

The validator will use the accounts in the tranche 0 (the only one created), which is enough to start the network once the genesis time is reached.

The node deploy validator command includes the --beacon and --beacon-count flags as a convenience method to pre-deploy a set of beacon nodes (with the same consensus client) to which the validator can connect to join the network.

At any point we can deploy another beacon node with:

$ viewpoint node deploy beacon --type [prysm|lighthouse|teku]

Commands

Server

$ viewpoint server

The server command starts the Viewpoint agent.

Flags:

Deposit create

$ viewpoint deposit create

The deposit create command creates a new tranche with num-validators. For each one, it sends a deposit transaction to the deposit smart contract on the execution node (Geth). Eventually, those accounts will be active on the consensus layer.

Flags:

Deposit list

$ viewpoint deposit list

The deposit list command lists all the tranches.

Node deploy beacon

$ viewpoint deploy beacon

The deploy beacon command deploys multiple beacon node clients. The nodes use a bootnode to discover each other.

Flags:

Node deploy validator

$ viewpoint deploy validator

The deploy validator command deploys a validator client.

Flags:

Node list

$ viewpoint node list

The node list command lists all the running nodes.

Node status

$ viewpoint node status <name>

The node status command queries the state of a specific node name.