components

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Package components defines utilities to spin up actual beacon node and validator processes as needed by end to end tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendAndMineDeposits

func SendAndMineDeposits(keystorePath string, validatorNum, offset int, partial bool) error

SendAndMineDeposits sends the requested amount of deposits and mines the chain after to ensure the deposits are seen.

Types

type BeaconNode

type BeaconNode struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

BeaconNode represents beacon node.

func NewBeaconNode

func NewBeaconNode(config *e2etypes.E2EConfig, index int, enr string) *BeaconNode

NewBeaconNode creates and returns a beacon node.

func (*BeaconNode) Start

func (node *BeaconNode) Start(ctx context.Context) error

Start starts a fresh beacon node, connecting to all passed in beacon nodes.

func (*BeaconNode) Started

func (node *BeaconNode) Started() <-chan struct{}

Started checks whether beacon node is started and ready to be queried.

type BeaconNodeSet

type BeaconNodeSet struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

BeaconNodeSet represents set of beacon nodes.

func NewBeaconNodes

func NewBeaconNodes(config *e2etypes.E2EConfig) *BeaconNodeSet

NewBeaconNodes creates and returns a set of beacon nodes.

func (*BeaconNodeSet) SetENR

func (s *BeaconNodeSet) SetENR(enr string)

SetENR assigns ENR to the set of beacon nodes.

func (*BeaconNodeSet) Start

func (s *BeaconNodeSet) Start(ctx context.Context) error

Start starts all the beacon nodes in set.

func (*BeaconNodeSet) Started

func (s *BeaconNodeSet) Started() <-chan struct{}

Started checks whether beacon node set is started and all nodes are ready to be queried.

type BootNode

type BootNode struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

BootNode represents boot node.

func NewBootNode

func NewBootNode() *BootNode

NewBootNode creates and returns boot node.

func (*BootNode) ENR

func (node *BootNode) ENR() string

ENR exposes node's ENR.

func (*BootNode) Start

func (node *BootNode) Start(ctx context.Context) error

Start starts a bootnode blocks up until ctx is cancelled.

func (*BootNode) Started

func (node *BootNode) Started() <-chan struct{}

Started checks whether a boot node is started and ready to be queried.

type Eth1Node

type Eth1Node struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

Eth1Node represents ETH1 node.

func NewEth1Node

func NewEth1Node() *Eth1Node

NewEth1Node creates and returns ETH1 node.

func (*Eth1Node) KeystorePath

func (node *Eth1Node) KeystorePath() string

KeystorePath exposes node's keystore path.

func (*Eth1Node) Start

func (node *Eth1Node) Start(ctx context.Context) error

Start starts an ETH1 local dev chain and deploys a deposit contract.

func (*Eth1Node) Started

func (node *Eth1Node) Started() <-chan struct{}

Started checks whether ETH1 node is started and ready to be queried.

type TracingSink

type TracingSink struct {
	// contains filtered or unexported fields
}

TracingSink to capture HTTP requests from opentracing pushes. This is meant to capture all opentracing spans from Prysm during an end-to-end test. Spans are normally sent to a jaeger (https://www.jaegertracing.io/docs/1.25/getting-started/) endpoint, but here we instead replace that with our own http request sink. The request sink receives any requests, raw marshals them and base64-encodes them, then writes them newline-delimited into a file.

The output file from this component can then be used by tools/replay-http in the Prysm repository to replay requests to a jaeger collector endpoint. This can then be used to visualize the spans themselves in the jaeger UI.

func NewTracingSink

func NewTracingSink(endpoint string) *TracingSink

NewTracingSink initializes the tracing sink component.

func (*TracingSink) Start

func (ts *TracingSink) Start(_ context.Context) error

Start the tracing sink.

func (*TracingSink) Started

func (ts *TracingSink) Started() <-chan struct{}

Started checks whether a tracing sink is started and ready to be queried.

type ValidatorNode

type ValidatorNode struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

ValidatorNode represents a validator node.

func NewValidatorNode

func NewValidatorNode(config *e2etypes.E2EConfig, validatorNum, index, offset int) *ValidatorNode

NewValidatorNode creates and returns a validator node.

func (*ValidatorNode) Start

func (v *ValidatorNode) Start(ctx context.Context) error

Start starts a validator client.

func (*ValidatorNode) Started

func (v *ValidatorNode) Started() <-chan struct{}

Started checks whether validator node is started and ready to be queried.

type ValidatorNodeSet

type ValidatorNodeSet struct {
	e2etypes.ComponentRunner
	// contains filtered or unexported fields
}

ValidatorNodeSet represents set of validator nodes.

func NewValidatorNodeSet

func NewValidatorNodeSet(config *e2etypes.E2EConfig) *ValidatorNodeSet

NewValidatorNodeSet creates and returns a set of validator nodes.

func (*ValidatorNodeSet) Start

func (s *ValidatorNodeSet) Start(ctx context.Context) error

Start starts the configured amount of validators, also sending and mining their deposits.

func (*ValidatorNodeSet) Started

func (s *ValidatorNodeSet) Started() <-chan struct{}

Started checks whether validator node set is started and all nodes are ready to be queried.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL