bidcollect

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package bidcollect contains code for bid collection from various sources.

Index

Constants

View Source
const (
	SourceTypeGetHeader        = 0
	SourceTypeDataAPI          = 1
	SourceTypeUltrasoundStream = 2
)

Variables

View Source
var CommonBidCSVFields = []string{
	"source_type",
	"received_at_ms",

	"timestamp_ms",
	"slot",
	"slot_t_ms",
	"value",

	"block_hash",
	"parent_hash",
	"builder_pubkey",
	"block_number",

	"block_fee_recipient",
	"relay",
	"proposer_pubkey",
	"proposer_fee_recipient",
	"optimistic_submission",
}

Functions

This section is empty.

Types

type BidCollector

type BidCollector struct {
	// contains filtered or unexported fields
}

func NewBidCollector

func NewBidCollector(opts *BidCollectorOpts) *BidCollector

func (*BidCollector) MustStart

func (c *BidCollector) MustStart()

type BidCollectorOpts

type BidCollectorOpts struct {
	Log *logrus.Entry
	UID string

	CollectUltrasoundStream bool
	CollectGetHeader        bool
	CollectDataAPI          bool

	Relays        []common.RelayEntry
	BeaconNodeURI string // for getHeader

	OutDir    string
	OutputTSV bool
}

type BidProcessor

type BidProcessor struct {
	// contains filtered or unexported fields
}

func NewBidProcessor

func NewBidProcessor(opts *BidProcessorOpts) *BidProcessor

func (*BidProcessor) Start

func (c *BidProcessor) Start()

type BidProcessorOpts

type BidProcessorOpts struct {
	Log       *logrus.Entry
	UID       string
	OutDir    string
	OutputTSV bool
}

type CommonBid

type CommonBid struct {
	// Collector-internal fields
	SourceType   int   `json:"source_type"`
	ReceivedAtMs int64 `json:"received_at"`

	// Common fields
	Slot          uint64 `json:"slot"`
	BlockNumber   uint64 `json:"block_number"`
	BlockHash     string `json:"block_hash"`
	ParentHash    string `json:"parent_hash"`
	BuilderPubkey string `json:"builder_pubkey"`
	Value         string `json:"value"`

	// Ultrasound top-bid stream - https://github.com/ultrasoundmoney/docs/blob/main/top-bid-websocket.md
	BlockFeeRecipient string `json:"block_fee_recipient"`

	// Data API
	// - Ultrasound: https://relay-analytics.ultrasound.money/relay/v1/data/bidtraces/builder_blocks_received?slot=9194844
	// - Flashbots: https://boost-relay.flashbots.net/relay/v1/data/bidtraces/builder_blocks_received?slot=8969837
	Relay                string `json:"relay"`
	TimestampMs          int64  `json:"timestamp_ms"`
	ProposerPubkey       string `json:"proposer_pubkey"`
	ProposerFeeRecipient string `json:"proposer_fee_recipient"`
	OptimisticSubmission bool   `json:"optimistic_submission"`
}

func DataAPIToCommonBids

func DataAPIToCommonBids(bids DataAPIPollerBidsMsg) []*CommonBid

func GetHeaderToCommonBid

func GetHeaderToCommonBid(bid GetHeaderPollerBidsMsg) *CommonBid

func UltrasoundStreamToCommonBid

func UltrasoundStreamToCommonBid(bid *UltrasoundStreamBidsMsg) *CommonBid

func (*CommonBid) ToCSVFields

func (bid *CommonBid) ToCSVFields() []string

func (*CommonBid) ToCSVLine

func (bid *CommonBid) ToCSVLine(separator string) string

func (*CommonBid) UniqueKey

func (bid *CommonBid) UniqueKey() string

func (*CommonBid) ValueAsBigInt

func (bid *CommonBid) ValueAsBigInt() *big.Int

type DataAPIPoller

type DataAPIPoller struct {
	Log    *logrus.Entry
	BidC   chan DataAPIPollerBidsMsg
	Relays []common.RelayEntry
}

func NewDataAPIPoller

func NewDataAPIPoller(opts *DataAPIPollerOpts) *DataAPIPoller

func (*DataAPIPoller) Start

func (poller *DataAPIPoller) Start()

type DataAPIPollerBidsMsg

type DataAPIPollerBidsMsg struct {
	Bids       []relaycommon.BidTraceV2WithTimestampJSON
	Relay      common.RelayEntry
	ReceivedAt time.Time
}

type DataAPIPollerOpts

type DataAPIPollerOpts struct {
	Log    *logrus.Entry
	BidC   chan DataAPIPollerBidsMsg
	Relays []common.RelayEntry
}

type GetHeaderPoller

type GetHeaderPoller struct {
	// contains filtered or unexported fields
}

func NewGetHeaderPoller

func NewGetHeaderPoller(opts *GetHeaderPollerOpts) *GetHeaderPoller

func (*GetHeaderPoller) Start

func (poller *GetHeaderPoller) Start()

type GetHeaderPollerBidsMsg

type GetHeaderPollerBidsMsg struct {
	Slot       uint64
	Bid        types.GetHeaderResponse
	Relay      common.RelayEntry
	ReceivedAt time.Time
}

type GetHeaderPollerOpts

type GetHeaderPollerOpts struct {
	Log       *logrus.Entry
	BidC      chan GetHeaderPollerBidsMsg
	BeaconURI string
	Relays    []common.RelayEntry
}

type OutFiles

type OutFiles struct {
	FAll *os.File
	FTop *os.File
}

type UltrasoundStreamBidsMsg

type UltrasoundStreamBidsMsg struct {
	Bid        common.UltrasoundStreamBid
	Relay      string
	ReceivedAt time.Time
}

type UltrasoundStreamConnection

type UltrasoundStreamConnection struct {
	// contains filtered or unexported fields
}

func NewUltrasoundStreamConnection

func NewUltrasoundStreamConnection(opts UltrasoundStreamOpts) *UltrasoundStreamConnection

func (*UltrasoundStreamConnection) Start

func (ustream *UltrasoundStreamConnection) Start()

type UltrasoundStreamOpts

type UltrasoundStreamOpts struct {
	Log  *logrus.Entry
	BidC chan UltrasoundStreamBidsMsg
}

Directories

Path Synopsis
Package website contains the service delivering the website
Package website contains the service delivering the website

Jump to

Keyboard shortcuts

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