builder

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ForkchoiceUpdatedMethod v1 request string for JSON-RPC.
	ForkchoiceUpdatedMethod = "engine_forkchoiceUpdatedV1"
	// ForkchoiceUpdatedMethodV2 v2 request string for JSON-RPC.
	ForkchoiceUpdatedMethodV2 = "engine_forkchoiceUpdatedV2"
	// GetPayloadMethod v1 request string for JSON-RPC.
	GetPayloadMethod = "engine_getPayloadV1"
	// GetPayloadMethodV2 v2 request string for JSON-RPC.
	GetPayloadMethodV2 = "engine_getPayloadV2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func New

func New(opts ...Option) (*Builder, error)

New creates a proxy server forwarding requests from a consensus client to an execution client.

func (*Builder) Address

func (p *Builder) Address() string

Address for the proxy server.

func (*Builder) ServeHTTP

func (p *Builder) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP requests from a consensus client to an execution client, modifying in-flight requests and/or responses as desired. It also processes any backed-up requests.

func (*Builder) Start

func (p *Builder) Start(ctx context.Context) error

Start a proxy server.

type ExecHeaderResponseCapella

type ExecHeaderResponseCapella struct {
	Version string `json:"version"`
	Data    struct {
		Signature hexutil.Bytes                 `json:"signature"`
		Message   *builderAPI.BuilderBidCapella `json:"message"`
	} `json:"data"`
}

type ExecPayloadResponse

type ExecPayloadResponse struct {
	Version string               `json:"version"`
	Data    *v1.ExecutionPayload `json:"data"`
}

type ForkchoiceUpdatedResponse

type ForkchoiceUpdatedResponse struct {
	Jsonrpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	ID      uint64        `json:"id"`
	Result  struct {
		Status    *v1.PayloadStatus  `json:"payloadStatus"`
		PayloadId *v1.PayloadIDBytes `json:"payloadId"`
	} `json:"result"`
}

type Option

type Option func(p *Builder) error

func WithDestinationAddress

func WithDestinationAddress(addr string) Option

WithDestinationAddress sets the forwarding address requests will be sent to.

func WithHost

func WithHost(host string) Option

WithHost sets the proxy server host.

func WithJwtSecret

func WithJwtSecret(secret string) Option

WithJwtSecret adds in support for jwt authenticated connections for our proxy.

func WithLogFile

func WithLogFile(f *os.File) Option

WithLogFile specifies a log file to write the proxies output to.

func WithLogger

func WithLogger(l *logrus.Logger) Option

WithLogger sets a custom logger for the proxy.

func WithPort

func WithPort(port int) Option

WithPort sets the proxy server port.

Jump to

Keyboard shortcuts

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