types

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFakeForkChoice

func GenerateFakeForkChoice() *v1.ForkChoice

Types

type EventSource added in v0.0.46

type EventSource string
const (
	NilEventSource            EventSource = ""
	UnknownEventSource        EventSource = "unknown"
	BeaconNodeEventSource     EventSource = "beacon_node"
	XatuPollingEventSource    EventSource = "xatu_polling"
	XatuReorgEventEventSource EventSource = "xatu_reorg_event"
)

func NewEventSourceFromString added in v0.0.46

func NewEventSourceFromString(s string) EventSource

func RandomEventSource added in v0.0.46

func RandomEventSource() EventSource

func (EventSource) String added in v0.0.46

func (e EventSource) String() string

type Frame

type Frame struct {
	// Data is the fork choice dump.
	Data *v1.ForkChoice `json:"data"`
	// Metadata is the metadata of the frame.
	Metadata FrameMetadata `json:"metadata"`
}

Frame holds a fork choice dump with a timestamp.

func GenerateFakeFrame

func GenerateFakeFrame() *Frame

func (*Frame) AsGzipJSON

func (f *Frame) AsGzipJSON() ([]byte, error)

func (*Frame) FromGzipJSON

func (f *Frame) FromGzipJSON(data []byte) error

func (*Frame) Validate

func (f *Frame) Validate() error

type FrameMetadata

type FrameMetadata struct {
	// ID is the ID of the frame.
	ID string `json:"id"`
	// Node is the node that provided the frame.
	// In the case of a beacon node, this is the beacon node's ID as specified in the config for this service.
	// In the case of Xatu, this is the Xatu Sentry ID.
	Node string `json:"node"`
	// FetchedAt is the time the frame was fetched.
	FetchedAt time.Time `json:"fetched_at"`
	// WallClockSlot is the wall clock slot at the time the frame was fetched.
	WallClockSlot phase0.Slot `json:"wall_clock_slot"`
	// WallClockSlot is the wall clock slot at the time the frame was fetched.
	WallClockEpoch phase0.Epoch `json:"wall_clock_epoch"`
	// Labels are labels to apply to the frame.
	Labels []string `json:"labels"`
	// ConsensusClient is the consensus client that provided the frame.
	ConsensusClient string `json:"consensus_client"`
	// EventSource is the event source that provided the frame.
	EventSource string `json:"event_source"`
}

func (*FrameMetadata) Validate

func (f *FrameMetadata) Validate() error

Jump to

Keyboard shortcuts

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