stream

package
v0.5.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheTopic         = "/block/cache"
	BidTopic           = "/block/bid"
	SlotDeliveredTopic = "/slot/delivered"
)
View Source
var (
	ErrDecodeVarint = errors.New("error decoding varint value")
)

Functions

This section is empty.

Types

type BellatrixHeaderWithSlot

type BellatrixHeaderWithSlot struct {
	ExecutionPayloadHeader bellatrix.ExecutionPayloadHeader
	HeaderSlot             uint64
}

func (BellatrixHeaderWithSlot) Header

func (BellatrixHeaderWithSlot) Slot

type CapellaHeaderWithSlot

type CapellaHeaderWithSlot struct {
	ExecutionPayloadHeader capella.ExecutionPayloadHeader
	HeaderSlot             uint64
}

func (CapellaHeaderWithSlot) Header

func (CapellaHeaderWithSlot) Slot

func (b CapellaHeaderWithSlot) Slot() uint64

type Client

type Client struct {
	Pubsub Pubsub

	Config StreamConfig
	Logger log.Logger
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ps Pubsub, st State, cfg StreamConfig) *Client

func (*Client) AttachMetrics

func (s *Client) AttachMetrics(m *metrics.Metrics)

func (*Client) BlockCache

func (s *Client) BlockCache() <-chan structs.BlockBidAndTrace

func (*Client) BuilderBid

func (s *Client) BuilderBid() <-chan structs.BuilderBidExtended

func (*Client) PublishBlockCache

func (s *Client) PublishBlockCache(ctx context.Context, block structs.BlockBidAndTrace) error

func (*Client) PublishBuilderBid

func (s *Client) PublishBuilderBid(ctx context.Context, bid structs.BuilderBidExtended) error

func (*Client) PublishSlotDelivered

func (s *Client) PublishSlotDelivered(ctx context.Context, slot structs.Slot) error

func (*Client) RunBuilderBidSubscriber

func (s *Client) RunBuilderBidSubscriber(ctx context.Context) error

func (*Client) RunCacheSubscriber

func (s *Client) RunCacheSubscriber(ctx context.Context) error

func (*Client) RunSlotDeliveredSubscriber

func (s *Client) RunSlotDeliveredSubscriber(ctx context.Context) error

func (*Client) RunSubscriberParallel

func (s *Client) RunSubscriberParallel(ctx context.Context, num uint) error

type EncoderSSZ

type EncoderSSZ interface {
	MarshalSSZ() ([]byte, error)
}

type ForkVersionFormat

type ForkVersionFormat uint64
const (
	Unknown ForkVersionFormat = iota
	AltairJson
	BellatrixJson
	CapellaJson
	CapellaSSZ
)

type HeaderWithSlot

type HeaderWithSlot struct {
	ExecutionPayloadHeader structs.ExecutionPayloadHeader
	HeaderSlot             uint64
}

type JsonItem

type JsonItem struct {
	StreamMeta Metadata
	StreamData json.RawMessage
}

func (JsonItem) Data

func (d JsonItem) Data() []byte

func (JsonItem) Meta

func (d JsonItem) Meta() Metadata

type Metadata

type Metadata struct {
	Source string
}

type Pubsub

type Pubsub interface {
	Publish(context.Context, string, []byte) error
	Subscribe(context.Context, string) chan []byte
}

type State

type State interface {
	ForkVersion(epoch structs.Slot) structs.ForkVersion
	HeadSlot() structs.Slot
}

type StreamConfig

type StreamConfig struct {
	Logger          log.Logger
	ID              string
	TTL             time.Duration
	PubsubTopic     string // pubsub topic name for block submissions
	StreamQueueSize int
}

type StreamData

type StreamData interface {
	Data() []byte
	Meta() Metadata
}

type StreamMetrics

type StreamMetrics struct {
	StreamRecvCounter *prometheus.CounterVec
	Timing            *prometheus.HistogramVec
}

Directories

Path Synopsis
transport

Jump to

Keyboard shortcuts

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