server

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingRelayPubkey = fmt.Errorf("missing relay public key")

ErrMissingRelayPubkey is returned if a new RelayEntry URL has no public key

Functions

func ComputeDomain added in v0.5.0

func ComputeDomain(domainType types.DomainType, forkVersionHex, genesisValidatorsRootHex string) (domain types.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 GetURI added in v1.0.0

func GetURI(url *url.URL, path string) string

GetURI returns the full request URI with scheme, host, path and args.

func RelayEntriesToStrings added in v1.3.2

func RelayEntriesToStrings(relays []RelayEntry) []string

RelayEntriesToStrings returns the string representation of a list of relay entries

func SendHTTPRequest added in v0.5.0

func SendHTTPRequest(ctx context.Context, client http.Client, method, url string, userAgent UserAgent, 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

Types

type AuctionTranscript added in v1.4.0

type AuctionTranscript struct {
	Bid        *types.SignedBuilderBid         `json:"bid"`
	Acceptance *types.SignedBlindedBeaconBlock `json:"acceptance"`
}

AuctionTranscript is the bid and blinded block received from the relay send to the relay monitor

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                []RelayEntry
	RelayMonitors         []*url.URL
	GenesisForkVersionHex string
	RelayCheck            bool
	RelayMinBid           types.U256Str

	RequestTimeoutGetHeader  time.Duration
	RequestTimeoutGetPayload time.Duration
	RequestTimeoutRegVal     time.Duration
}

BoostServiceOpts provides all available options for use with NewBoostService

type RelayEntry added in v0.4.2

type RelayEntry struct {
	PublicKey types.PublicKey
	URL       *url.URL
}

RelayEntry represents a relay that mev-boost connects to.

func NewRelayEntry added in v0.4.5

func NewRelayEntry(relayURL string) (entry RelayEntry, err error)

NewRelayEntry creates a new instance based on an input string relayURL can be IP@PORT, PUBKEY@IP:PORT, https://IP, etc.

func (*RelayEntry) GetURI added in v0.7.4

func (r *RelayEntry) GetURI(path string) string

GetURI returns the full request URI with scheme, host, path and args for the relay.

func (*RelayEntry) String added in v0.4.5

func (r *RelayEntry) String() string

type UserAgent added in v0.7.5

type UserAgent string

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

Jump to

Keyboard shortcuts

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