Documentation
¶
Index ¶
- type MetricsFanIn
- type MetricsService
- type NonCloseableL1BeaconClient
- type NonCloseableL1Client
- type NonCloseableRPC
- func (c *NonCloseableRPC) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (c *NonCloseableRPC) CallContext(ctx context.Context, result any, method string, args ...any) error
- func (c *NonCloseableRPC) Close()
- func (c *NonCloseableRPC) Subscribe(ctx context.Context, namespace string, channel any, args ...any) (ethereum.Subscription, error)
- type Router
- type RouterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsFanIn ¶ added in v1.16.6
type MetricsFanIn struct {
// contains filtered or unexported fields
}
MetricsFanIn is an http.handler which allows multiple Prometheus metrics "Gatherers" to be combined and served at the /metrics path.
The Gatherers must not collide with each other, e.g. each must have a unique name or label set. This can be accomplished by using a distinct, global label on each Gatherer.
func NewMetricsFanIn ¶ added in v1.16.6
func NewMetricsFanIn(numGatherers int) *MetricsFanIn
func (*MetricsFanIn) ServeHTTP ¶ added in v1.16.6
func (r *MetricsFanIn) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*MetricsFanIn) SetMetricsRegistry ¶ added in v1.16.6
func (r *MetricsFanIn) SetMetricsRegistry(key string, g prometheus.Gatherer)
type MetricsService ¶
type MetricsService struct {
// contains filtered or unexported fields
}
MetricsService encapsulates an HTTP server that serves the MetricsRouter.
func NewMetricsService ¶
func NewMetricsService(log gethlog.Logger, listenAddr string, port int, handler http.Handler) *MetricsService
NewMetricsService constructs a metrics HTTP server bound to the given address/port using the provided handler.
func (*MetricsService) Start ¶
func (s *MetricsService) Start(onError func(error))
Start begins serving metrics in a background goroutine. If the server exits with an error, the optional onError callback is invoked.
type NonCloseableL1BeaconClient ¶
type NonCloseableL1BeaconClient struct {
*sources.L1BeaconClient
}
NonCloseableL1BeaconClient wraps an L1BeaconClient to prevent it from being closed. This is used when sharing a single beacon client across multiple virtual nodes.
func NewNonCloseableL1BeaconClient ¶
func NewNonCloseableL1BeaconClient(client *sources.L1BeaconClient) *NonCloseableL1BeaconClient
NewNonCloseableL1BeaconClient wraps an L1BeaconClient to prevent closure. Returns nil if the input client is nil (beacon client is optional).
func (*NonCloseableL1BeaconClient) Close ¶
func (c *NonCloseableL1BeaconClient) Close()
type NonCloseableL1Client ¶
NonCloseableL1Client wraps an L1Client to prevent it from being closed. This is used when sharing a single L1Client across multiple virtual nodes, where we don't want any individual node to close the shared resource.
func NewNonCloseableL1Client ¶
func NewNonCloseableL1Client(client *sources.L1Client) *NonCloseableL1Client
NewNonCloseableL1Client wraps an L1Client to prevent closure.
func (*NonCloseableL1Client) Close ¶
func (c *NonCloseableL1Client) Close()
Close is a no-op for the non-closeable wrapper. The underlying client should only be closed when the supernode itself shuts down.
type NonCloseableRPC ¶
NonCloseableRPC wraps an RPC client to prevent it from being closed. This is used when sharing a single RPC connection across multiple clients.
func NewNonCloseableRPC ¶
func NewNonCloseableRPC(rpcClient client.RPC) *NonCloseableRPC
NewNonCloseableRPC wraps an RPC client to prevent closure.
func (*NonCloseableRPC) BatchCallContext ¶
BatchCallContext delegates to the underlying RPC client
func (*NonCloseableRPC) CallContext ¶
func (c *NonCloseableRPC) CallContext(ctx context.Context, result any, method string, args ...any) error
CallContext delegates to the underlying RPC client
func (*NonCloseableRPC) Close ¶
func (c *NonCloseableRPC) Close()
Close is a no-op for the non-closeable wrapper.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router multiplexes JSON-RPC requests by the first path segment which represents the chainID.
func NewRouter ¶
func NewRouter(log gethlog.Logger, cfg RouterConfig) *Router
NewRouter constructs an empty Router. Handlers can be added later via SetHandler.
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP routes requests to the chain-specific handler, after stripping the chain prefix.
func (*Router) SetHandler ¶
SetHandler replaces or adds the handler for a given chainID at runtime.
func (*Router) SetRootHandler ¶ added in v1.16.2
SetRootHandler sets the optional handler for '/'. If unset, '/' returns 404.
type RouterConfig ¶
RouterConfig defines runtime options for the RPC router server.