node

package
v4.0.0-...-b8b0360 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 65 Imported by: 0

Documentation

Overview

Package node is the main service which launches a beacon node and manages the lifecycle of all its associated services at runtime, such as p2p, RPC, sync, gracefully closing them if the process ends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconNode

type BeaconNode struct {
	GenesisInitializer    genesis.Initializer
	CheckpointInitializer checkpoint.Initializer
	// contains filtered or unexported fields
}

BeaconNode defines a struct that handles the services running a random beacon chain full PoS node. It handles the lifecycle of the entire system and registers services to a service registry.

func New

func New(cliCtx *cli.Context, opts ...Option) (*BeaconNode, error)

New creates a new node instance, sets up configuration options, and registers every required service to the node.

func (*BeaconNode) BlockFeed

func (b *BeaconNode) BlockFeed() *event.Feed

BlockFeed implements blockfeed.Notifier.

func (*BeaconNode) Close

func (b *BeaconNode) Close()

Close handles graceful shutdown of the system.

func (*BeaconNode) OperationFeed

func (b *BeaconNode) OperationFeed() *event.Feed

OperationFeed implements opfeed.Notifier.

func (*BeaconNode) Start

func (b *BeaconNode) Start()

Start the BeaconNode and kicks off every registered service.

func (*BeaconNode) StateFeed

func (b *BeaconNode) StateFeed() *event.Feed

StateFeed implements statefeed.Notifier.

type Option

type Option func(bn *BeaconNode) error

Option for beacon node configuration.

func WithBlockchainFlagOptions

func WithBlockchainFlagOptions(opts []blockchain.Option) Option

WithBlockchainFlagOptions includes functional options for the blockchain service related to CLI flags.

func WithBuilderFlagOptions

func WithBuilderFlagOptions(opts []builder.Option) Option

WithBuilderFlagOptions includes functional options for the builder service related to CLI flags.

func WithExecutionChainOptions

func WithExecutionChainOptions(opts []execution.Option) Option

WithExecutionChainOptions includes functional options for the execution chain service related to CLI flags.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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