components

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: GPL-3.0 Imports: 44 Imported by: 1

Documentation

Overview

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

Index

Constants

View Source
const DefaultFeeRecipientAddress = "0x099FB65722e7b2455043bfebF6177f1D2E9738d9"
View Source
const Web3RemoteSignerPort = 9000

Variables

This section is empty.

Functions

func FeeRecipientFromPubkey added in v3.2.1

func FeeRecipientFromPubkey(key string) string

FeeRecipientFromPubkey slices, from the beginning of the hex-encoded pubkey string, the 2 character 0x preamble plus enough hex chars to fill out the fee_recipient byte value.

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) Pause

func (node *BeaconNode) Pause() error

Pause pauses the component and its underlying process.

func (*BeaconNode) Resume

func (node *BeaconNode) Resume() error

Resume resumes the component and its underlying process.

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.

func (*BeaconNode) Stop

func (node *BeaconNode) Stop() error

Stop stops the component and its underlying process.

func (*BeaconNode) UnderlyingProcess added in v3.2.1

func (node *BeaconNode) UnderlyingProcess() *os.Process

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) ComponentAtIndex

func (s *BeaconNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*BeaconNodeSet) Pause

func (s *BeaconNodeSet) Pause() error

Pause pauses the component and its underlying process.

func (*BeaconNodeSet) PauseAtIndex

func (s *BeaconNodeSet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*BeaconNodeSet) Resume

func (s *BeaconNodeSet) Resume() error

Resume resumes the component and its underlying process.

func (*BeaconNodeSet) ResumeAtIndex

func (s *BeaconNodeSet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

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.

func (*BeaconNodeSet) Stop

func (s *BeaconNodeSet) Stop() error

Stop stops the component and its underlying process.

func (*BeaconNodeSet) StopAtIndex

func (s *BeaconNodeSet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

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) Pause

func (node *BootNode) Pause() error

Pause pauses the component and its underlying process.

func (*BootNode) Resume

func (node *BootNode) Resume() error

Resume resumes the component and its underlying process.

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.

func (*BootNode) Stop

func (node *BootNode) Stop() error

Stop stops the component and its underlying process.

type KeystoreGenerator

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

func NewKeystoreGenerator

func NewKeystoreGenerator() *KeystoreGenerator

func (*KeystoreGenerator) Pause

func (k *KeystoreGenerator) Pause() error

Pause pauses the component and its underlying process.

func (*KeystoreGenerator) Resume

func (k *KeystoreGenerator) Resume() error

Resume resumes the component and its underlying process.

func (*KeystoreGenerator) Start

func (k *KeystoreGenerator) Start(_ context.Context) error

func (*KeystoreGenerator) Started

func (k *KeystoreGenerator) Started() <-chan struct{}

func (*KeystoreGenerator) Stop

func (k *KeystoreGenerator) Stop() error

Stop stops the component and its underlying process.

func (*KeystoreGenerator) UnderlyingProcess added in v3.2.1

func (k *KeystoreGenerator) UnderlyingProcess() *os.Process

type LighthouseBeaconNode

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

LighthouseBeaconNode represents a lighthouse beacon node.

func NewLighthouseBeaconNode

func NewLighthouseBeaconNode(config *e2etypes.E2EConfig, index int, enr string) *LighthouseBeaconNode

NewLighthouseBeaconNode creates and returns a lighthouse beacon node.

func (*LighthouseBeaconNode) Pause

func (node *LighthouseBeaconNode) Pause() error

Pause pauses the component and its underlying process.

func (*LighthouseBeaconNode) Resume

func (node *LighthouseBeaconNode) Resume() error

Resume resumes the component and its underlying process.

func (*LighthouseBeaconNode) Start

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

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

func (*LighthouseBeaconNode) Started

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

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

func (*LighthouseBeaconNode) Stop

func (node *LighthouseBeaconNode) Stop() error

Stop stops the component and its underlying process.

type LighthouseBeaconNodeSet

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

LighthouseBeaconNodeSet represents set of lighthouse beacon nodes.

func NewLighthouseBeaconNodes

func NewLighthouseBeaconNodes(config *e2etypes.E2EConfig) *LighthouseBeaconNodeSet

NewLighthouseBeaconNodes creates and returns a set of lighthouse beacon nodes.

func (*LighthouseBeaconNodeSet) ComponentAtIndex

func (s *LighthouseBeaconNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*LighthouseBeaconNodeSet) Pause

func (s *LighthouseBeaconNodeSet) Pause() error

Pause pauses the component and its underlying process.

func (*LighthouseBeaconNodeSet) PauseAtIndex

func (s *LighthouseBeaconNodeSet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*LighthouseBeaconNodeSet) Resume

func (s *LighthouseBeaconNodeSet) Resume() error

Resume resumes the component and its underlying process.

func (*LighthouseBeaconNodeSet) ResumeAtIndex

func (s *LighthouseBeaconNodeSet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

func (*LighthouseBeaconNodeSet) SetENR

func (s *LighthouseBeaconNodeSet) SetENR(enr string)

SetENR assigns ENR to the set of beacon nodes.

func (*LighthouseBeaconNodeSet) Start

Start starts all the beacon nodes in set.

func (*LighthouseBeaconNodeSet) Started

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

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

func (*LighthouseBeaconNodeSet) Stop

func (s *LighthouseBeaconNodeSet) Stop() error

Stop stops the component and its underlying process.

func (*LighthouseBeaconNodeSet) StopAtIndex

func (s *LighthouseBeaconNodeSet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

type LighthouseValidatorNode

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

LighthouseValidatorNode represents a lighthouse validator node.

func NewLighthouseValidatorNode

func NewLighthouseValidatorNode(config *e2etypes.E2EConfig, validatorNum, index, offset int) *LighthouseValidatorNode

NewLighthouseValidatorNode creates and returns a lighthouse validator node.

func (*LighthouseValidatorNode) Pause

func (v *LighthouseValidatorNode) Pause() error

Pause pauses the component and its underlying process.

func (*LighthouseValidatorNode) Resume

func (v *LighthouseValidatorNode) Resume() error

Resume resumes the component and its underlying process.

func (*LighthouseValidatorNode) Start

Start starts a validator client.

func (*LighthouseValidatorNode) Started

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

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

func (*LighthouseValidatorNode) Stop

func (v *LighthouseValidatorNode) Stop() error

Stop stops the component and its underlying process.

type LighthouseValidatorNodeSet

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

LighthouseValidatorNodeSet represents set of lighthouse validator nodes.

func NewLighthouseValidatorNodeSet

func NewLighthouseValidatorNodeSet(config *e2etypes.E2EConfig) *LighthouseValidatorNodeSet

NewLighthouseValidatorNodeSet creates and returns a set of lighthouse validator nodes.

func (*LighthouseValidatorNodeSet) ComponentAtIndex

func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*LighthouseValidatorNodeSet) Pause

func (s *LighthouseValidatorNodeSet) Pause() error

Pause pauses the component and its underlying process.

func (*LighthouseValidatorNodeSet) PauseAtIndex

func (s *LighthouseValidatorNodeSet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*LighthouseValidatorNodeSet) Resume

func (s *LighthouseValidatorNodeSet) Resume() error

Resume resumes the component and its underlying process.

func (*LighthouseValidatorNodeSet) ResumeAtIndex

func (s *LighthouseValidatorNodeSet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

func (*LighthouseValidatorNodeSet) Start

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

func (*LighthouseValidatorNodeSet) Started

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

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

func (*LighthouseValidatorNodeSet) Stop

Stop stops the component and its underlying process.

func (*LighthouseValidatorNodeSet) StopAtIndex

func (s *LighthouseValidatorNodeSet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

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) Pause

func (ts *TracingSink) Pause() error

Pause pauses the component and its underlying process.

func (*TracingSink) Resume

func (ts *TracingSink) Resume() error

Resume resumes the component and its underlying process.

func (*TracingSink) Start

func (ts *TracingSink) Start(ctx 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.

func (*TracingSink) Stop

func (ts *TracingSink) Stop() error

Stop stops the component and its underlying process.

func (*TracingSink) UnderlyingProcess added in v3.2.1

func (ts *TracingSink) UnderlyingProcess() *os.Process

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) Pause

func (v *ValidatorNode) Pause() error

Pause pauses the component and its underlying process.

func (*ValidatorNode) Resume

func (v *ValidatorNode) Resume() error

Resume resumes the component and its underlying process.

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.

func (*ValidatorNode) Stop

func (v *ValidatorNode) Stop() error

Stop stops the component and its underlying process.

func (*ValidatorNode) UnderlyingProcess added in v3.2.1

func (v *ValidatorNode) UnderlyingProcess() *os.Process

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) ComponentAtIndex

func (s *ValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error)

ComponentAtIndex returns the component at the provided index.

func (*ValidatorNodeSet) Pause

func (s *ValidatorNodeSet) Pause() error

Pause pauses the component and its underlying process.

func (*ValidatorNodeSet) PauseAtIndex

func (s *ValidatorNodeSet) PauseAtIndex(i int) error

PauseAtIndex pauses the component and its underlying process at the desired index.

func (*ValidatorNodeSet) Resume

func (s *ValidatorNodeSet) Resume() error

Resume resumes the component and its underlying process.

func (*ValidatorNodeSet) ResumeAtIndex

func (s *ValidatorNodeSet) ResumeAtIndex(i int) error

ResumeAtIndex resumes the component and its underlying process at the desired index.

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.

func (*ValidatorNodeSet) Stop

func (s *ValidatorNodeSet) Stop() error

Stop stops the component and its underlying process.

func (*ValidatorNodeSet) StopAtIndex

func (s *ValidatorNodeSet) StopAtIndex(i int) error

StopAtIndex stops the component and its underlying process at the desired index.

type Web3RemoteSigner

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

func NewWeb3RemoteSigner

func NewWeb3RemoteSigner() *Web3RemoteSigner

func (*Web3RemoteSigner) Pause

func (w *Web3RemoteSigner) Pause() error

Pause pauses the component and its underlying process.

func (*Web3RemoteSigner) PublicKeys

func (w *Web3RemoteSigner) PublicKeys(ctx context.Context) ([]bls.PublicKey, error)

PublicKeys queries the web3signer and returns the response keys.

func (*Web3RemoteSigner) Resume

func (w *Web3RemoteSigner) Resume() error

Resume resumes the component and its underlying process.

func (*Web3RemoteSigner) Start

func (w *Web3RemoteSigner) Start(ctx context.Context) error

Start the web3remotesigner component with a keystore populated with the deterministic validator keys.

func (*Web3RemoteSigner) Started

func (w *Web3RemoteSigner) Started() <-chan struct{}

func (*Web3RemoteSigner) Stop

func (w *Web3RemoteSigner) Stop() error

Stop stops the component and its underlying process.

func (*Web3RemoteSigner) UnderlyingProcess added in v3.2.1

func (w *Web3RemoteSigner) UnderlyingProcess() *os.Process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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