Documentation ¶
Overview ¶
Package proxy provides a proxy middleware for engine API requests between Ethereum consensus clients and execution clients accordingly. Allows for customizing in-flight requests or responses using custom triggers. Useful for end-to-end testing.
Index ¶
- type Option
- type Proxy
- func (p *Proxy) AddRequestInterceptor(rpcMethodName string, response func() interface{}, trigger func() bool)
- func (p *Proxy) Address() string
- func (p *Proxy) ReleaseBackedUpRequests(rpcMethodName string)
- func (p *Proxy) RemoveRequestInterceptor(rpcMethodName string)
- func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (p *Proxy) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
func WithDestinationAddress ¶
WithDestinationAddress sets the forwarding address requests will be proxied to.
func WithJwtSecret ¶
WithJwtSecret adds in support for jwt authenticated connections for our proxy.
func WithLogFile ¶
WithLogFile specifies a log file to write the proxies output to.
func WithLogger ¶
WithLogger sets a custom logger for the proxy.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy server that sits as a middleware between an Ethereum consensus client and an execution client, allowing us to modify in-flight requests and responses for testing purposes.
func New ¶
New creates a proxy server forwarding requests from a consensus client to an execution client.
func (*Proxy) AddRequestInterceptor ¶
func (p *Proxy) AddRequestInterceptor(rpcMethodName string, response func() interface{}, trigger func() bool)
AddRequestInterceptor for a desired json-rpc method by specifying a custom response and a function that checks if the interceptor should be triggered.
func (*Proxy) ReleaseBackedUpRequests ¶
ReleaseBackedUpRequests releases backed up http requests which were previously ignored due to our interceptors.
func (*Proxy) RemoveRequestInterceptor ¶
RemoveRequestInterceptor removes the request interceptor for the provided method.