events

package
v5.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package events defines a gRPC events service implementation, following the official API standards https://ethereum.github.io/beacon-apis/#/. This package includes the events endpoint.

Index

Constants

View Source
const (
	InvalidTopic = "__invalid__"
	// HeadTopic represents a new chain head event topic.
	HeadTopic = "head"
	// BlockTopic represents a new produced block event topic.
	BlockTopic = "block"
	// AttestationTopic represents a new submitted attestation event topic.
	AttestationTopic = "attestation"
	// VoluntaryExitTopic represents a new performed voluntary exit event topic.
	VoluntaryExitTopic = "voluntary_exit"
	// FinalizedCheckpointTopic represents a new finalized checkpoint event topic.
	FinalizedCheckpointTopic = "finalized_checkpoint"
	// ChainReorgTopic represents a chain reorganization event topic.
	ChainReorgTopic = "chain_reorg"
	// SyncCommitteeContributionTopic represents a new sync committee contribution event topic.
	SyncCommitteeContributionTopic = "contribution_and_proof"
	// BLSToExecutionChangeTopic represents a new received BLS to execution change event topic.
	BLSToExecutionChangeTopic = "bls_to_execution_change"
	// PayloadAttributesTopic represents a new payload attributes for execution payload building event topic.
	PayloadAttributesTopic = "payload_attributes"
	// BlobSidecarTopic represents a new blob sidecar event topic
	BlobSidecarTopic = "blob_sidecar"
	// ProposerSlashingTopic represents a new proposer slashing event topic
	ProposerSlashingTopic = "proposer_slashing"
	// AttesterSlashingTopic represents a new attester slashing event topic
	AttesterSlashingTopic = "attester_slashing"
	// LightClientFinalityUpdateTopic represents a new light client finality update event topic.
	LightClientFinalityUpdateTopic = "light_client_finality_update"
	// LightClientOptimisticUpdateTopic represents a new light client optimistic update event topic.
	LightClientOptimisticUpdateTopic = "light_client_optimistic_update"
)
View Source
const DefaultEventFeedDepth = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	StateNotifier          statefeed.Notifier
	OperationNotifier      opfeed.Notifier
	HeadFetcher            blockchain.HeadFetcher
	ChainInfoFetcher       blockchain.ChainInfoFetcher
	TrackedValidatorsCache *cache.TrackedValidatorsCache
	KeepAliveInterval      time.Duration
	EventFeedDepth         int
}

Server defines a server implementation of the gRPC events service, providing RPC endpoints to subscribe to events from the beacon node.

func (*Server) StreamEvents

func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request)

StreamEvents provides an endpoint to subscribe to the beacon node Server-Sent-Events stream. Consumers should use the eventsource implementation to listen for those events. Servers may send SSE comments beginning with ':' for any purpose, including to keep the event stream connection alive in the presence of proxy servers.

type StreamingResponseWriter added in v5.1.1

type StreamingResponseWriter interface {
	http.ResponseWriter
	http.Flusher
}

StreamingResponseWriter defines a type that can be used by the eventStreamer. This must be an http.ResponseWriter that supports flushing and hijacking.

Jump to

Keyboard shortcuts

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