Documentation
¶
Index ¶
- func GetDepositCountsFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
- func GetTransactionsCountFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
- func GetVoluntaryExitsFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
- func NewWallclock(genesisTime time.Time, chainSpec *state.Spec) *ethwallclock.EthereumBeaconChain
- type APIClientOptions
- type BeaconMetrics
- type BeaconSubscriptionOptions
- type Config
- type EmptySlotEvent
- type EventMetrics
- type EventTopics
- type FinalityCheckpointUpdated
- type FirstTimeHealthyEvent
- type ForkMetrics
- type GeneralMetrics
- type Health
- type HealthCheckFailedEvent
- type HealthCheckOptions
- type HealthCheckSucceededEvent
- type HealthMetrics
- type Metrics
- func (m *Metrics) Beacon() *BeaconMetrics
- func (m *Metrics) Events() *EventMetrics
- func (m *Metrics) Forks() *ForkMetrics
- func (m *Metrics) General() *GeneralMetrics
- func (m *Metrics) Health() *HealthMetrics
- func (m *Metrics) RawResponses() *RawResponseMetrics
- func (m *Metrics) Spec() *SpecMetrics
- func (m *Metrics) Start(ctx context.Context) error
- func (m *Metrics) Stop() error
- func (m *Metrics) Sync() *SyncMetrics
- type MetricsJob
- type Node
- type NodeVersionUpdatedEvent
- type Options
- func (o *Options) AddGoEth2ClientParams(params ...ehttp.Parameter) *Options
- func (o *Options) DisableEmptySlotDetection() *Options
- func (o *Options) DisablePrometheusMetrics() *Options
- func (o *Options) EnableDefaultBeaconSubscription() *Options
- func (o *Options) EnableEmptySlotDetection() *Options
- func (o *Options) EnablePrometheusMetrics() *Options
- func (o *Options) GetGoEth2ClientParams() []ehttp.Parameter
- func (o *Options) SetAPIClientAcceptEncoding(encoding string) *Options
- func (o *Options) SetAPIClientOptions(opts APIClientOptions) *Options
- func (o *Options) SetAPIClientTimeout(timeout time.Duration) *Options
- type PeersUpdatedEvent
- type RawResponseMetrics
- type ReadyEvent
- type SpecMetrics
- type SpecUpdatedEvent
- type Status
- type SyncMetrics
- type SyncStatusEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDepositCountsFromBeaconBlock ¶
func GetDepositCountsFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
GetDepositCountsFromBeaconBlock returns the number of deposits in a beacon block.
func GetTransactionsCountFromBeaconBlock ¶
func GetTransactionsCountFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
GetTransactionsCountFromBeaconBlock returns the number of transactions in a beacon block.
func GetVoluntaryExitsFromBeaconBlock ¶
func GetVoluntaryExitsFromBeaconBlock(block *spec.VersionedSignedBeaconBlock) int
GetVoluntaryExitsFromBeaconBlock returns the number of voluntary exits in a beacon block.
func NewWallclock ¶ added in v0.73.0
func NewWallclock(genesisTime time.Time, chainSpec *state.Spec) *ethwallclock.EthereumBeaconChain
NewWallclock builds the wall clock for the chain, following the Heze slot duration from HEZE_FORK_EPOCH onwards.
Types ¶
type APIClientOptions ¶ added in v0.71.0
type APIClientOptions struct {
// AcceptEncoding requests a specific wire encoding for raw responses. Empty
// leaves negotiation to net/http, which may transparently decompress gzip.
AcceptEncoding string
// Timeout bounds the entire request, including reading the response body.
//
// http.Client.Timeout keeps running after the response headers arrive, so it
// also bounds any read the caller performs on a response body it owns. Set it
// to zero to leave the body read governed by the request context.
Timeout human.Duration
// ResponseHeaderTimeout bounds the wait for response headers after the request
// has been written. It never bounds reading the response body. Zero disables
// it.
ResponseHeaderTimeout human.Duration
// DialTimeout bounds establishing the TCP connection. Zero disables it.
DialTimeout human.Duration
// TLSHandshakeTimeout bounds the TLS handshake. Zero disables it.
TLSHandshakeTimeout human.Duration
// MaxIdleConnsPerHost caps idle connections kept per host. Zero uses
// http.DefaultMaxIdleConnsPerHost.
MaxIdleConnsPerHost int
// MaxConnsPerHost limits total connections per host, including connections
// that are dialing, active, or idle. Excess HTTP/1 requests wait for a
// connection; HTTP/2 streams can multiplex on one connection. Zero removes
// the limit.
MaxConnsPerHost int
// MaxConcurrentRequests limits raw requests from transport start until the
// response body is closed. Excess requests wait for a slot, including when
// HTTP/2 multiplexes them on one connection. With no client timeout or
// context deadline, that wait is unbounded. Zero removes the limit.
MaxConcurrentRequests int
}
APIClientOptions configures buffered and streaming requests to the raw block, beacon state, and execution payload envelope endpoints.
It does not configure the go-eth2-client used for typed endpoints or the internal JSON client used for peer, identity, and deposit snapshot requests. Use AddGoEth2ClientParams for the typed client. Use DefaultAPIClientOptions as the base when overriding individual fields.
func DefaultAPIClientOptions ¶ added in v0.71.0
func DefaultAPIClientOptions() APIClientOptions
DefaultAPIClientOptions returns bounded defaults for the raw API client.
type BeaconMetrics ¶
type BeaconMetrics struct {
Slot prometheus.GaugeVec
Transactions prometheus.GaugeVec
Slashings prometheus.GaugeVec
Attestations prometheus.GaugeVec
Deposits prometheus.GaugeVec
VoluntaryExits prometheus.GaugeVec
FinalityCheckpoints prometheus.GaugeVec
ReOrgs prometheus.Counter
ReOrgDepth prometheus.Counter
EmptySlots prometheus.Counter
ProposerDelay prometheus.Histogram
Withdrawals prometheus.GaugeVec
WithdrawalsAmount prometheus.GaugeVec
WithdrawalsIndexMax prometheus.GaugeVec
WithdrawalsIndexMin prometheus.GaugeVec
BlobKZGCommitments prometheus.GaugeVec
// contains filtered or unexported fields
}
Beacon reports Beacon information about the beacon chain.
func NewBeaconMetrics ¶
func NewBeaconMetrics(beac Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *BeaconMetrics
NewBeaconMetrics creates a new BeaconMetrics instance.
func (*BeaconMetrics) GetSignedBeaconBlock ¶
func (b *BeaconMetrics) GetSignedBeaconBlock(ctx context.Context, blockID string) error
func (*BeaconMetrics) Name ¶
func (b *BeaconMetrics) Name() string
Name returns the name of the job.
type BeaconSubscriptionOptions ¶
type BeaconSubscriptionOptions struct {
Enabled bool
Topics EventTopics
}
BeaconSubscriptionOptions holds the options for beacon subscription.
func DefaultDisabledBeaconSubscriptionOptions ¶
func DefaultDisabledBeaconSubscriptionOptions() BeaconSubscriptionOptions
DefaultDisabledBeaconSubscriptionOptions returns the default options for a disabled beacon subscription.
func DefaultEnabledBeaconSubscriptionOptions ¶
func DefaultEnabledBeaconSubscriptionOptions() BeaconSubscriptionOptions
DefaultEnabledBeaconSubscriptionOptions returns the default options for an enabled beacon subscription.
execution_payload, execution_payload_gossip, execution_payload_available, execution_payload_bid, payload_attestation_message, and proposer_preferences can be added once Gloas is live if you want them defaulting. Not adding for now due to connection thrashing, etc.
func (*BeaconSubscriptionOptions) Disable ¶
func (b *BeaconSubscriptionOptions) Disable() *BeaconSubscriptionOptions
Disable disables the beacon subscription.
func (*BeaconSubscriptionOptions) Enable ¶
func (b *BeaconSubscriptionOptions) Enable() *BeaconSubscriptionOptions
Enable enables the beacon subscription.
type Config ¶
type Config struct {
// Name is the human-readable name of the node.
Name string `yaml:"name"`
// Address is the address of the node.
Addr string `yaml:"addr"`
// Headers are the headers to send with every request.
Headers map[string]string `yaml:"headers"`
}
Config is the configuration for a beacon node.
type EmptySlotEvent ¶
EmptySlotEvent is emitted when an empty slot is detected.
type EventMetrics ¶
type EventMetrics struct {
Count prometheus.CounterVec
TimeSinceLastEvent prometheus.Gauge
LastEventTime time.Time
// contains filtered or unexported fields
}
EventMetrics reports event counts.
func NewEventJob ¶
func NewEventJob(bc Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *EventMetrics
NewEvent creates a new Event instance.
func (*EventMetrics) HandleEvent ¶
HandleEvent handles all beacon events.
type EventTopics ¶
type EventTopics []string
EventTopics is a list of topics that can be subscribed to.
func (EventTopics) Exists ¶
func (e EventTopics) Exists(topic string) bool
Exists returns true if the topic exists in the list.
type FinalityCheckpointUpdated ¶
FinalityCheckpointUpdated is emitted when the finality checkpoint is updated.
type FirstTimeHealthyEvent ¶ added in v0.42.0
type FirstTimeHealthyEvent struct {
}
FirstTimeHealthyEvent is emitted when the node is first considered healthy.
type ForkMetrics ¶
type ForkMetrics struct {
Epochs prometheus.GaugeVec
Activated prometheus.GaugeVec
Current prometheus.GaugeVec
// contains filtered or unexported fields
}
ForkMetrics reports the state of any forks (previous, active or upcoming).
func NewForksJob ¶
func NewForksJob(beac Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *ForkMetrics
NewForksJob returns a new Forks instance.
type GeneralMetrics ¶
type GeneralMetrics struct {
NodeVersion prometheus.GaugeVec
ClientName prometheus.GaugeVec
Peers prometheus.GaugeVec
// contains filtered or unexported fields
}
GeneralMetrics reports general information about the node.
func NewGeneralJob ¶
func NewGeneralJob(beac Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *GeneralMetrics
NewGeneral creates a new General instance.
func (*GeneralMetrics) Name ¶
func (g *GeneralMetrics) Name() string
Name returns the name of the job.
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
Health tracks the health status of the beacon node.
func (*Health) FailedTotal ¶
FailedTotal returns the total number of failures.
func (*Health) SuccessTotal ¶
SuccessTotal returns the total number of successes.
type HealthCheckFailedEvent ¶
HealthCheckFailedEvent is emitted when a health check fails.
type HealthCheckOptions ¶
type HealthCheckOptions struct {
// Interval is the interval at which the health check will be run.
Interval human.Duration
// SuccessThreshold is the number of consecutive successful health checks required before the node is considered healthy.
SuccessfulResponses int
// FailureThreshold is the number of consecutive failed health checks required before the node is considered unhealthy.
FailedResponses int
}
HealthCheckOptions holds the options for the health check.
func DefaultHealthCheckOptions ¶
func DefaultHealthCheckOptions() HealthCheckOptions
DefaultHealthCheckOptions returns the default health check options.
type HealthCheckSucceededEvent ¶
HealthCheckSucceededEvent is emitted when a health check succeeds.
type HealthMetrics ¶
type HealthMetrics struct {
CheckResultsTotal *prometheus.CounterVec
Up prometheus.Gauge
// contains filtered or unexported fields
}
HealthMetrics reports metrics on the health status of the node.
func NewHealthMetrics ¶
func NewHealthMetrics(beac Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *HealthMetrics
NewHealthMetrics returns a new HealthMetrics instance.
func (*HealthMetrics) Name ¶
func (h *HealthMetrics) Name() string
Name returns the name of the job.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics contains all the metrics jobs.
func NewMetrics ¶
func NewMetrics(log logrus.FieldLogger, namespace, nodeName string, beacon Node) *Metrics
NewMetrics returns a new Metrics instance.
func (*Metrics) Beacon ¶
func (m *Metrics) Beacon() *BeaconMetrics
Beacon returns the beacon metrics job.
func (*Metrics) Events ¶
func (m *Metrics) Events() *EventMetrics
Events returns the events metrics job.
func (*Metrics) General ¶
func (m *Metrics) General() *GeneralMetrics
General returns the general metrics job.
func (*Metrics) Health ¶
func (m *Metrics) Health() *HealthMetrics
Health returns the health metrics job.
func (*Metrics) RawResponses ¶ added in v0.71.0
func (m *Metrics) RawResponses() *RawResponseMetrics
RawResponses returns the raw response metrics job.
type MetricsJob ¶
MetricsJob is a job that reports metrics.
type Node ¶
type Node interface {
// Lifecycle
// Start starts the node.
Start(ctx context.Context) error
// StartAsync starts the node asynchronously.
StartAsync(ctx context.Context)
// Stop stops the node.
Stop(ctx context.Context) error
// Service returns the Service client for the node.
Service() eth2client.Service
// Getters
// Options returns the options for the node.
Options() *Options
// Wallclock returns the EthWallclock instance
Wallclock() *ethwallclock.EthereumBeaconChain
// Eth getters. These are all cached.
// Spec returns the spec for the node.
Spec() (*state.Spec, error)
// SyncState returns the sync state for the node.
SyncState() (*v1.SyncState, error)
// Genesis returns the genesis for the node.
Genesis() (*v1.Genesis, error)
// NodeVersion returns the node version.
NodeVersion() (string, error)
// Status returns the status of the ndoe.
Status() *Status
// Finality returns the finality checkpoint for the node.
Finality() (*v1.Finality, error)
// Healthy returns true if the node is healthy.
Healthy() bool
// Fetchers - these are not cached and will always fetch from the node.
// FetchBlock fetches the block for the given state id.
FetchBlock(ctx context.Context, stateID string) (*spec.VersionedSignedBeaconBlock, error)
// FetchRawBlock fetches the raw, unparsed block for the given block id.
FetchRawBlock(ctx context.Context, blockID string, contentType string) ([]byte, error)
// FetchRawExecutionPayloadEnvelope fetches the raw, unparsed signed execution
// payload envelope for the given block id (gloas onwards).
FetchRawExecutionPayloadEnvelope(ctx context.Context, blockID string, contentType string) ([]byte, error)
// FetchExecutionPayloadEnvelope fetches the signed execution payload envelope for
// the given block id (gloas onwards). Returns nil without an error when the node
// has no envelope for the block, e.g. a withheld payload.
FetchExecutionPayloadEnvelope(ctx context.Context, blockID string) (*spec.VersionedSignedExecutionPayloadEnvelope, error)
// FetchBlockRoot fetches the block root for the given state id.
FetchBlockRoot(ctx context.Context, stateID string) (*phase0.Root, error)
// FetchBeaconState fetches the beacon state for the given state id.
FetchBeaconState(ctx context.Context, stateID string) (*spec.VersionedBeaconState, error)
// FetchBeaconStateRoot fetches the state root for the given state id.
FetchBeaconStateRoot(ctx context.Context, stateID string) (phase0.Root, error)
// FetchRawBeaconState fetches the raw, unparsed beacon state for the given state id.
FetchRawBeaconState(ctx context.Context, stateID string, contentType string) ([]byte, error)
// OpenRawBeaconState opens a streaming beacon state response. A successful
// return only establishes the response status and body; reads can still fail
// and are governed by ctx and the configured raw API client timeout. The caller
// must always close the response. Slow or partial reads retain transport
// resources, so callers should bound concurrency.
OpenRawBeaconState(ctx context.Context, stateID string, contentType string) (*api.RawResponse, error)
// OpenRawBlock opens a streaming block response. A successful return only
// establishes the response status and body; reads can still fail and remain
// governed by ctx and the configured raw API client timeout. The caller must
// always close the response. Slow or partial reads retain transport
// resources, so callers should bound concurrency.
OpenRawBlock(ctx context.Context, blockID string, contentType string) (*api.RawResponse, error)
// OpenRawExecutionPayloadEnvelope opens a streaming signed execution payload
// envelope response. A successful return only establishes the response status
// and body; reads can still fail and are governed by ctx and the configured raw
// API client timeout. The caller must always close the response. Slow or
// partial reads retain transport resources, so callers should bound concurrency.
OpenRawExecutionPayloadEnvelope(ctx context.Context, blockID string, contentType string) (*api.RawResponse, error)
// FetchValidators fetches the validators for the given state id and validator ids.
FetchValidators(ctx context.Context, state string, indices []phase0.ValidatorIndex, pubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*v1.Validator, error)
// FetchFinality fetches the finality checkpoint for the state id.
FetchFinality(ctx context.Context, stateID string) (*v1.Finality, error)
// FetchGenesis fetches the genesis configuration.
FetchGenesis(ctx context.Context) (*v1.Genesis, error)
// FetchPeers fetches the peers from the beacon node.
FetchPeers(ctx context.Context) (*types.Peers, error)
// FetchSyncStatus fetches the sync status from the beacon node.
FetchSyncStatus(ctx context.Context) (*v1.SyncState, error)
// FetchNodeVersion fetches the node version from the beacon node.
FetchNodeVersion(ctx context.Context) (string, error)
// FetchRawSpec fetches the raw, unparsed spec from the beacon node.
FetchRawSpec(ctx context.Context) (map[string]any, error)
// FetchSpec fetches the spec from the beacon node.
FetchSpec(ctx context.Context) (*state.Spec, error)
// FetchProposerDuties fetches the proposer duties from the beacon node.
FetchProposerDuties(ctx context.Context, epoch phase0.Epoch) ([]*v1.ProposerDuty, error)
// FetchForkChoice fetches the fork choice context.
FetchForkChoice(ctx context.Context) (*v1.ForkChoice, error)
// FetchDepositSnapshot fetches the deposit snapshot.
FetchDepositSnapshot(ctx context.Context) (*types.DepositSnapshot, error)
// FetchBeaconCommittees fetches the committees for the given epoch at the given state.
FetchBeaconCommittees(ctx context.Context, state string, epoch *phase0.Epoch) ([]*v1.BeaconCommittee, error)
// FetchAttestationData fetches the attestation data for the given slot and committee index.
FetchAttestationData(ctx context.Context, slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (*phase0.AttestationData, error)
// FetchBeaconBlockBlobs fetches blob sidecars for the given block id.
FetchBeaconBlockBlobs(ctx context.Context, blockID string) ([]*deneb.BlobSidecar, error)
// FetchBeaconBlockHeader fetches beacon block headers.
FetchBeaconBlockHeader(ctx context.Context, opts *eapi.BeaconBlockHeaderOpts) (*v1.BeaconBlockHeader, error)
// FetchNodeIdentity fetches the node identity.
FetchNodeIdentity(ctx context.Context) (*types.Identity, error)
// Subscriptions
// - Proxied Beacon events
// OnEvent is called when a beacon event is received.
OnEvent(ctx context.Context, handler func(ctx context.Context, ev *v1.Event) error)
// OnBlock is called when a block is received.
OnBlock(ctx context.Context, handler func(ctx context.Context, ev *v1.BlockEvent) error)
// OnBlockGossip is called when a block gossip is received.
OnBlockGossip(ctx context.Context, handler func(ctx context.Context, ev *v1.BlockGossipEvent) error)
// OnAttestation is called when an attestation is received.
OnAttestation(ctx context.Context, handler func(ctx context.Context, ev *spec.VersionedAttestation) error)
// OnSingleAttestation is called when a single attestation is received.
OnSingleAttestation(ctx context.Context, handler func(ctx context.Context, ev *electra.SingleAttestation) error)
// OnFinalizedCheckpoint is called when a finalized checkpoint is received.
OnFinalizedCheckpoint(ctx context.Context, handler func(ctx context.Context, ev *v1.FinalizedCheckpointEvent) error)
// OnHead is called when the head is received.
OnHead(ctx context.Context, handler func(ctx context.Context, ev *v1.HeadEvent) error)
// OnHeadV2 is called when a head_v2 event (gloas) is received.
OnHeadV2(ctx context.Context, handler func(ctx context.Context, ev *v1.HeadEventV2) error)
// OnChainReOrg is called when a chain reorg is received.
OnChainReOrg(ctx context.Context, handler func(ctx context.Context, ev *v1.ChainReorgEvent) error)
// OnVoluntaryExit is called when a voluntary exit is received.
OnVoluntaryExit(ctx context.Context, handler func(ctx context.Context, ev *phase0.SignedVoluntaryExit) error)
// OnContributionAndProof is called when a contribution and proof is received.
OnContributionAndProof(ctx context.Context, handler func(ctx context.Context, ev *altair.SignedContributionAndProof) error)
// OnBlobSidecar is called when a blob sidecar is received.
OnBlobSidecar(ctx context.Context, handler func(ctx context.Context, ev *v1.BlobSidecarEvent) error)
// OnDataColumnSidecar is called when a data column sidecar is received.
OnDataColumnSidecar(ctx context.Context, handler func(ctx context.Context, ev *v1.DataColumnSidecarEvent) error)
// OnFastConfirmation is called when a fast confirmation is received.
OnFastConfirmation(ctx context.Context, handler func(ctx context.Context, ev *v1.FastConfirmationEvent) error)
// EIP-7732 ePBS subscriptions.
// OnExecutionPayload is called when an execution payload has been imported into fork-choice.
OnExecutionPayload(ctx context.Context, handler func(ctx context.Context, ev *v1.ExecutionPayloadEvent) error)
// OnExecutionPayloadGossip is called when an execution payload has passed gossip validation.
OnExecutionPayloadGossip(ctx context.Context, handler func(ctx context.Context, ev *v1.ExecutionPayloadEvent) error)
// OnExecutionPayloadAvailable is called when the node has verified the execution payload and blobs are locally available.
OnExecutionPayloadAvailable(ctx context.Context, handler func(ctx context.Context, ev *v1.ExecutionPayloadAvailableEvent) error)
// OnExecutionPayloadBid is called when a SignedExecutionPayloadBid passes gossip validation.
OnExecutionPayloadBid(ctx context.Context, handler func(ctx context.Context, ev *gloas.SignedExecutionPayloadBid) error)
// OnPayloadAttestationMessage is called when a PayloadAttestationMessage is received.
OnPayloadAttestationMessage(ctx context.Context, handler func(ctx context.Context, ev *gloas.PayloadAttestationMessage) error)
// OnProposerPreferences is called when a SignedProposerPreferences is received.
OnProposerPreferences(ctx context.Context, handler func(ctx context.Context, ev *gloas.SignedProposerPreferences) error)
// - Custom events
// OnReady is called when the node is ready.
OnReady(ctx context.Context, handler func(ctx context.Context, event *ReadyEvent) error)
// OnSyncStatus is called when the sync status changes.
OnSyncStatus(ctx context.Context, handler func(ctx context.Context, event *SyncStatusEvent) error)
// OnNodeVersionUpdated is called when the node version is updated.
OnNodeVersionUpdated(ctx context.Context, handler func(ctx context.Context, event *NodeVersionUpdatedEvent) error)
// OnPeersUpdated is called when the peers are updated.
OnPeersUpdated(ctx context.Context, handler func(ctx context.Context, event *PeersUpdatedEvent) error)
// OnSpecUpdated is called when the spec is updated.
OnSpecUpdated(ctx context.Context, handler func(ctx context.Context, event *SpecUpdatedEvent) error)
// OnEmptySlot is called when an empty slot is detected.
OnEmptySlot(ctx context.Context, handler func(ctx context.Context, event *EmptySlotEvent) error)
// OnHealthCheckFailed is called when a health check fails.
OnHealthCheckFailed(ctx context.Context, handler func(ctx context.Context, event *HealthCheckFailedEvent) error)
// OnHealthCheckSucceeded is called when a health check succeeds.
OnHealthCheckSucceeded(ctx context.Context, handler func(ctx context.Context, event *HealthCheckSucceededEvent) error)
// OnFinalityCheckpointUpdated is called when a the head finality checkpoint is updated.
OnFinalityCheckpointUpdated(ctx context.Context, handler func(ctx context.Context, event *FinalityCheckpointUpdated) error)
// OnFirstTimeHealthy is called when the node is healthy for the first time.
OnFirstTimeHealthy(ctx context.Context, handler func(ctx context.Context, event *FirstTimeHealthyEvent) error)
// GetZeroLogLevel returns the zerolog level for the node.
GetZeroLogLevel() zerolog.Level
}
type NodeVersionUpdatedEvent ¶
type NodeVersionUpdatedEvent struct {
Version string
}
NodeVersionUpdatedEvent is emitted when the node version is updated.
type Options ¶
type Options struct {
BeaconSubscription BeaconSubscriptionOptions
HealthCheck HealthCheckOptions
PrometheusMetrics bool
DetectEmptySlots bool
GoEth2ClientParams []ehttp.Parameter
APIClient *APIClientOptions
}
Options holds the options for a beacon node.
func (*Options) AddGoEth2ClientParams ¶ added in v0.46.0
AddGoEth2ClientParams adds the given parameters to the options.
func (*Options) DisableEmptySlotDetection ¶
DisableEmptySlotDetection disables empty slot detection.
func (*Options) DisablePrometheusMetrics ¶
DisablePrometheusMetrics disables Prometheus metrics.
func (*Options) EnableDefaultBeaconSubscription ¶
EnableDefaultBeaconSubscription enables the default beacon subscription.
func (*Options) EnableEmptySlotDetection ¶
EnableEmptySlotDetection enables empty slot detection.
func (*Options) EnablePrometheusMetrics ¶
EnablePrometheusMetrics enables Prometheus metrics.
func (*Options) GetGoEth2ClientParams ¶ added in v0.46.0
GetGoEth2ClientParams returns the parameters for the go-eth2-client.
func (*Options) SetAPIClientAcceptEncoding ¶ added in v0.71.0
SetAPIClientAcceptEncoding sets the wire encoding requested by the raw API client while preserving its other options.
func (*Options) SetAPIClientOptions ¶ added in v0.71.0
func (o *Options) SetAPIClientOptions(opts APIClientOptions) *Options
SetAPIClientOptions sets the raw API client options.
func (*Options) SetAPIClientTimeout ¶ added in v0.71.0
SetAPIClientTimeout sets the total request timeout for the raw API client.
Pass zero to remove the bound, which is what a caller streaming a large response body wants: the read is then governed by the request context rather than by a fixed ceiling it cannot see.
type PeersUpdatedEvent ¶
PeersUpdatedEvent is emitted when the peer list is updated.
type RawResponseMetrics ¶ added in v0.71.0
type RawResponseMetrics struct {
OpenStreams prometheus.Gauge
Leaks prometheus.Counter
}
RawResponseMetrics reports the lifecycle of streaming raw responses.
func NewRawResponseMetrics ¶ added in v0.71.0
func NewRawResponseMetrics(namespace string, constLabels map[string]string) *RawResponseMetrics
NewRawResponseMetrics creates and registers raw response metrics.
func (*RawResponseMetrics) Name ¶ added in v0.71.0
func (m *RawResponseMetrics) Name() string
Name returns the name of the job.
func (*RawResponseMetrics) Start ¶ added in v0.71.0
func (m *RawResponseMetrics) Start(context.Context) error
Start starts the job.
func (*RawResponseMetrics) Stop ¶ added in v0.71.0
func (m *RawResponseMetrics) Stop() error
Stop stops the job.
type ReadyEvent ¶
type ReadyEvent struct {
}
type SpecMetrics ¶
type SpecMetrics struct {
SafeSlotsToUpdateJustified prometheus.Gauge
DepositChainID prometheus.Gauge
ConfigName prometheus.GaugeVec
MaxValidatorsPerCommittee prometheus.Gauge
SecondsPerEth1Block prometheus.Gauge
BaseRewardFactor prometheus.Gauge
EpochsPerSyncCommitteePeriod prometheus.Gauge
EffectiveBalanceIncrement prometheus.Gauge
MaxAttestations prometheus.Gauge
MinSyncCommitteeParticipants prometheus.Gauge
GenesisDelay prometheus.Gauge
SecondsPerSlot prometheus.Gauge
MaxEffectiveBalance prometheus.Gauge
TerminalTotalDifficulty prometheus.Gauge
TerminalTotalDifficultyTrillions prometheus.Gauge
MaxDeposits prometheus.Gauge
MinGenesisActiveValidatorCount prometheus.Gauge
TargetCommitteeSize prometheus.Gauge
SyncCommitteeSize prometheus.Gauge
Eth1FollowDistance prometheus.Gauge
TerminalBlockHashActivationEpoch prometheus.Gauge
MinDepositAmount prometheus.Gauge
SlotsPerEpoch prometheus.Gauge
PresetBase prometheus.GaugeVec
// contains filtered or unexported fields
}
SpecMetrics reports metrics about the configured consensus spec.
func NewSpecJob ¶
func NewSpecJob(bc Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *SpecMetrics
NewSpecJob returns a new Spec instance.
type SpecUpdatedEvent ¶
SpecUpdatedEvent is emitted when the spec is updated.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a beacon node status.
func (*Status) UpdateNetworkID ¶
UpdateNetworkID updates the network ID.
func (*Status) UpdateSyncState ¶
UpdateSyncState updates the sync state.
type SyncMetrics ¶
type SyncMetrics struct {
Percentage prometheus.Gauge
EstimatedHighestSlot prometheus.Gauge
HeadSlot prometheus.Gauge
Distance prometheus.Gauge
IsSyncing prometheus.Gauge
IsOptimistic prometheus.Gauge
// contains filtered or unexported fields
}
SyncMetrics reports metrics on the sync status of the node.
func NewSyncMetrics ¶
func NewSyncMetrics(beac Node, log logrus.FieldLogger, namespace string, constLabels map[string]string) *SyncMetrics
NewSyncMetrics returns a new Sync metrics instance.
type SyncStatusEvent ¶
SyncStatusEvent is emitted when the sync status is refreshed.