Documentation
¶
Overview ¶
Package ethereum provides Ethereum beacon node functionality
Index ¶
- func ComputeForkDigest(genesisValidatorsRoot phase0.Root, forkVersion phase0.Version, ...) phase0.ForkDigest
- type BeaconNode
- func (b *BeaconNode) ForkDigest() (phase0.ForkDigest, error)
- func (b *BeaconNode) GetCurrentBlobSchedule() (*BlobScheduleEntry, error)
- func (b *BeaconNode) GetEpoch(epoch uint64) ethwallclock.Epoch
- func (b *BeaconNode) GetEpochFromSlot(slot uint64) ethwallclock.Epoch
- func (b *BeaconNode) GetSlot(slot uint64) ethwallclock.Slot
- func (b *BeaconNode) GetWallclock() *ethwallclock.EthereumBeaconChain
- func (b *BeaconNode) IsHealthy() bool
- func (b *BeaconNode) Metadata() *services.MetadataService
- func (b *BeaconNode) Node() beacon.Node
- func (b *BeaconNode) OnReady(callback func(ctx context.Context) error)
- func (b *BeaconNode) Start(ctx context.Context) error
- func (b *BeaconNode) Stop(ctx context.Context) error
- func (b *BeaconNode) Synced(ctx context.Context) error
- type BlobScheduleEntry
- type Config
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeForkDigest ¶
func ComputeForkDigest(genesisValidatorsRoot phase0.Root, forkVersion phase0.Version, blobParams *BlobScheduleEntry) phase0.ForkDigest
Types ¶
type BeaconNode ¶
type BeaconNode struct {
// contains filtered or unexported fields
}
BeaconNode represents a connection to an Ethereum beacon node and manages any associated services (eg: metadata, etc).
func NewBeaconNode ¶
func NewBeaconNode( log logrus.FieldLogger, namespace string, config *Config, opts *Options, ) (*BeaconNode, error)
NewBeaconNode creates a new beacon node instance with the given configuration. It initializes any services and configures the beacon subscriptions.
func (*BeaconNode) ForkDigest ¶
func (b *BeaconNode) ForkDigest() (phase0.ForkDigest, error)
func (*BeaconNode) GetCurrentBlobSchedule ¶
func (b *BeaconNode) GetCurrentBlobSchedule() (*BlobScheduleEntry, error)
GetCurrentBlobSchedule returns the current blob schedule for the current epoch.
func (*BeaconNode) GetEpoch ¶
func (b *BeaconNode) GetEpoch(epoch uint64) ethwallclock.Epoch
GetEpoch returns the wallclock epoch for a given slot number.
func (*BeaconNode) GetEpochFromSlot ¶
func (b *BeaconNode) GetEpochFromSlot(slot uint64) ethwallclock.Epoch
GetEpochFromSlot returns the wallclock epoch for a given slot.
func (*BeaconNode) GetSlot ¶
func (b *BeaconNode) GetSlot(slot uint64) ethwallclock.Slot
GetSlot returns the wallclock slot for a given slot number.
func (*BeaconNode) GetWallclock ¶
func (b *BeaconNode) GetWallclock() *ethwallclock.EthereumBeaconChain
GetWallclock returns the wallclock for the beacon chain.
func (*BeaconNode) IsHealthy ¶
func (b *BeaconNode) IsHealthy() bool
IsHealthy returns whether the node is healthy.
func (*BeaconNode) Metadata ¶
func (b *BeaconNode) Metadata() *services.MetadataService
Metadata returns the metadata service instance.
func (*BeaconNode) Node ¶
func (b *BeaconNode) Node() beacon.Node
Node returns the underlying beacon node instance.
func (*BeaconNode) OnReady ¶
func (b *BeaconNode) OnReady(callback func(ctx context.Context) error)
OnReady registers a callback to be executed when the beacon node is ready.
func (*BeaconNode) Start ¶
func (b *BeaconNode) Start(ctx context.Context) error
Start starts the beacon node and waits for it to be ready.
type BlobScheduleEntry ¶
BlobScheduleEntry represents a blob parameter configuration for a specific epoch.
type Config ¶
type Config struct {
// The address of the Beacon node to connect to
BeaconNodeAddress string `yaml:"beaconNodeAddress"`
// BeaconNodeHeaders is a map of headers to send to the beacon node.
BeaconNodeHeaders map[string]string `yaml:"beaconNodeHeaders"`
// NetworkOverride is an optional network name to use instead of what's reported by the beacon node
NetworkOverride string `yaml:"networkOverride,omitempty"`
}
Config defines the configuration for the Ethereum beacon node.