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 ¶
- type BeaconNode
- func (b *BeaconNode) BlockFeed() *event.Feed
- func (b *BeaconNode) Close()
- func (b *BeaconNode) OperationFeed() event.SubscriberSender
- func (b *BeaconNode) RegisterBackfillService(cliCtx *cli.Context, bfs *backfill.Store) error
- func (b *BeaconNode) Start()
- func (b *BeaconNode) StateFeed() event.SubscriberSender
- type Option
- func WithBlobStorage(bs *filesystem.BlobStorage) Option
- func WithBlobStorageOptions(opt ...filesystem.BlobStorageOption) Option
- func WithBlockchainFlagOptions(opts []blockchain.Option) Option
- func WithBuilderFlagOptions(opts []builder.Option) Option
- func WithConfigOptions(opt ...params.Option) Option
- func WithDataColumnStorage(bs *filesystem.DataColumnStorage) Option
- func WithDataColumnStorageOptions(opt ...filesystem.DataColumnStorageOption) Option
- func WithExecutionChainOptions(opts []execution.Option) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconNode ¶
type BeaconNode struct {
GenesisProviders []genesis.Provider
CheckpointInitializer checkpoint.Initializer
ClockWaiter startup.ClockWaiter
BackfillOpts []backfill.ServiceOption
BlobStorage *filesystem.BlobStorage
BlobStorageOptions []filesystem.BlobStorageOption
DataColumnStorage *filesystem.DataColumnStorage
DataColumnStorageOptions []filesystem.DataColumnStorageOption
ConfigOptions []params.Option
SyncNeedsWaiter func() (das.SyncNeeds, error)
// 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, cancel context.CancelFunc, 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.SubscriberSender
OperationFeed implements opfeed.Notifier.
func (*BeaconNode) RegisterBackfillService ¶
func (*BeaconNode) Start ¶
func (b *BeaconNode) Start()
Start the BeaconNode and kicks off every registered service.
func (*BeaconNode) StateFeed ¶
func (b *BeaconNode) StateFeed() event.SubscriberSender
StateFeed implements statefeed.Notifier.
type Option ¶
type Option func(bn *BeaconNode) error
Option for beacon node configuration.
func WithBlobStorage ¶
func WithBlobStorage(bs *filesystem.BlobStorage) Option
WithBlobStorage sets the BlobStorage backend for the BeaconNode
func WithBlobStorageOptions ¶
func WithBlobStorageOptions(opt ...filesystem.BlobStorageOption) Option
WithBlobStorageOptions appends 1 or more filesystem.BlobStorageOption on the beacon node, to be used when initializing blob storage.
func WithBlockchainFlagOptions ¶
func WithBlockchainFlagOptions(opts []blockchain.Option) Option
WithBlockchainFlagOptions includes functional options for the blockchain service related to CLI flags.
func WithBuilderFlagOptions ¶
WithBuilderFlagOptions includes functional options for the builder service related to CLI flags.
func WithConfigOptions ¶
func WithDataColumnStorage ¶
func WithDataColumnStorage(bs *filesystem.DataColumnStorage) Option
WithDataColumnStorage sets the DataColumnStorage backend for the BeaconNode
func WithDataColumnStorageOptions ¶
func WithDataColumnStorageOptions(opt ...filesystem.DataColumnStorageOption) Option
WithDataColumnStorageOptions appends 1 or more filesystem.DataColumnStorageOption on the beacon node, to be used when initializing data column storage.
func WithExecutionChainOptions ¶
WithExecutionChainOptions includes functional options for the execution chain service related to CLI flags.