server

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderKeySlotUID      = "X-MEVBoost-SlotID"
	HeaderKeyVersion      = "X-MEVBoost-Version"
	HeaderStartTimeUnixMS = "X-MEVBoost-StartTimeUnixMS"
)

Variables

This section is empty.

Functions

func ComputeDomain added in v0.5.0

func ComputeDomain(domainType phase0.DomainType, forkVersionHex, genesisValidatorsRootHex string) (domain phase0.Domain, err error)

ComputeDomain computes the signing domain

func DecodeJSON added in v0.7.5

func DecodeJSON(r io.Reader, dst any) error

DecodeJSON reads JSON from io.Reader and decodes it into a struct

func SendHTTPRequest added in v0.5.0

func SendHTTPRequest(ctx context.Context, client http.Client, method, url string, userAgent UserAgent, headers map[string]string, payload, dst any) (code int, err error)

SendHTTPRequest - prepare and send HTTP request, marshaling the payload if any, and decoding the response if dst is set

func SendHTTPRequestWithRetries added in v1.5.0

func SendHTTPRequestWithRetries(ctx context.Context, client http.Client, method, url string, userAgent UserAgent, headers map[string]string, payload, dst any, maxRetries int, log *logrus.Entry) (code int, err error)

SendHTTPRequestWithRetries - prepare and send HTTP request, retrying the request if within the client timeout

Types

type BlockHashHex added in v1.3.2

type BlockHashHex string

BlockHashHex is a hex-string representation of a block hash

type BoostService

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

BoostService - the mev-boost service

func NewBoostService

func NewBoostService(opts BoostServiceOpts) (*BoostService, error)

NewBoostService created a new BoostService

func (*BoostService) CheckRelays added in v0.5.0

func (m *BoostService) CheckRelays() int

CheckRelays sends a request to each one of the relays previously registered to get their status

func (*BoostService) StartHTTPServer added in v0.4.0

func (m *BoostService) StartHTTPServer() error

StartHTTPServer starts the HTTP server for this boost service instance

type BoostServiceOpts added in v0.7.1

type BoostServiceOpts struct {
	Log                   *logrus.Entry
	ListenAddr            string
	Relays                []types.RelayEntry
	RelayMonitors         []*url.URL
	GenesisForkVersionHex string
	GenesisTime           uint64
	RelayCheck            bool
	RelayMinBid           types.U256Str

	RequestTimeoutGetHeader  time.Duration
	RequestTimeoutGetPayload time.Duration
	RequestTimeoutRegVal     time.Duration
	RequestMaxRetries        int
}

BoostServiceOpts provides all available options for use with NewBoostService

type UserAgent added in v0.7.5

type UserAgent string

UserAgent is a custom string type to avoid confusing url + userAgent parameters in SendHTTPRequest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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