server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MPL-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodePortEth1Http is the http port for the eth1 node.
	NodePortEth1Http = "eth1.http"

	// NodePortP2P is the p2p port for an eth2 node.
	NodePortP2P = "eth2.p2p"

	// NodePortHttp is the http port for an eth2 node.
	NodePortHttp = "eth2.http"

	// NodePortPrysmGrpc is the specific prysm port for its Grpc server
	NodePortPrysmGrpc = "eth2.prysm.grpc"
)

Variables

This section is empty.

Functions

func NewEth1Server

func NewEth1Server() []nodeOption

NewEth1Server creates a new eth1 server with go-ethereum

func NewLighthouseBeacon

func NewLighthouseBeacon(config *BeaconConfig) ([]nodeOption, error)

NewLighthouseBeacon creates a new prysm server

func NewLighthouseValidator

func NewLighthouseValidator(config *ValidatorConfig) ([]nodeOption, error)

func NewPrysmBeacon

func NewPrysmBeacon(config *BeaconConfig) ([]nodeOption, error)

NewPrysmBeacon creates a new prysm server

func NewPrysmValidator

func NewPrysmValidator(config *ValidatorConfig) ([]nodeOption, error)

func NewTekuBeacon

func NewTekuBeacon(config *BeaconConfig) ([]nodeOption, error)

NewTekuBeacon creates a new teku server

func NewTekuValidator

func NewTekuValidator(config *ValidatorConfig) ([]nodeOption, error)

func WithCmd

func WithCmd(cmd []string) nodeOption

func WithContainer

func WithContainer(repository string) nodeOption

func WithFile

func WithFile(path string, obj interface{}) nodeOption

func WithLabels

func WithLabels(m map[string]string) nodeOption

func WithMount

func WithMount(mount string) nodeOption

func WithName

func WithName(name string) nodeOption

func WithNodeClient

func WithNodeClient(nodeClient proto.NodeClient) nodeOption

func WithNodeType

func WithNodeType(nodeType proto.NodeType) nodeOption

func WithOutput

func WithOutput(output io.Writer) nodeOption

func WithRetry

func WithRetry(retry func(n *node) error) nodeOption

func WithTag

func WithTag(tag string) nodeOption

func WithUser

func WithUser(user string) nodeOption

Types

type BeaconConfig

type BeaconConfig struct {
	Spec       *Eth2Spec
	Eth1       string
	Bootnode   string
	GenesisSSZ []byte
}

type Bootnode

type Bootnode struct {
	Enr string
	// contains filtered or unexported fields
}

func NewBootnode

func NewBootnode() (*Bootnode, error)

func (Bootnode) GetAddr

func (n Bootnode) GetAddr(port NodePort) string

func (Bootnode) GetLogs

func (n Bootnode) GetLogs() (string, error)

func (Bootnode) IP

func (n Bootnode) IP() string

func (Bootnode) Stop

func (n Bootnode) Stop() error

func (Bootnode) Type

func (n Bootnode) Type() proto.NodeClient

func (Bootnode) WaitCh

func (n Bootnode) WaitCh() <-chan struct{}

type Config

type Config struct {
	Name string
	Spec *Eth2Spec
}

func DefaultConfig

func DefaultConfig() *Config

type CreateBeacon

type CreateBeacon func(cfg *BeaconConfig) (*node, error)

CreateBeacon is a factory method to create beacon nodes

type CreateBeacon2

type CreateBeacon2 func(cfg *BeaconConfig) ([]nodeOption, error)

type CreateValidator

type CreateValidator func(cfg *ValidatorConfig) (*node, error)

CreateValidator is a factory method to create validator nodes

type CreateValidator2

type CreateValidator2 func(cfg *ValidatorConfig) ([]nodeOption, error)

type Eth2Spec

type Eth2Spec struct {
	GenesisValidatorCount     int
	GenesisDelay              int
	MinGenesisTime            int
	EthFollowDistance         int
	SecondsPerEth1Block       int
	EpochsPerEth1VotingPeriod int
	ShardCommitteePeriod      int
	SlotsPerEpoch             int
	SecondsPerSlot            int
	DepositContract           string
	Forks                     Forks
}

Eth2Spec is the config of the Eth2.0 node

func (*Eth2Spec) MarshalText

func (e *Eth2Spec) MarshalText() ([]byte, error)

type Forks

type Forks struct {
	Altair    *int
	Bellatrix *int
}

type NodePort

type NodePort string

type Server

type Server struct {
	proto.UnimplementedE2EServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logger hclog.Logger, config *Config) (*Server, error)

func (*Server) DeployNode

func (*Server) DeployValidator

func (*Server) Stop

func (s *Server) Stop()

type ValidatorConfig

type ValidatorConfig struct {
	Spec     *Eth2Spec
	Accounts []*proto.Account
	Beacon   *node
}

Directories

Path Synopsis
Code generated by fastssz.
Code generated by fastssz.

Jump to

Keyboard shortcuts

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