Documentation
¶
Index ¶
- type MetricsRouter
- 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 MetricsRouter ¶
type MetricsRouter struct {
// contains filtered or unexported fields
}
MetricsRouter multiplexes Prometheus metrics by the first path segment (chainID), and then requires the next segment to be 'metrics'. Effective paths:
/{chain}/metrics
The wrapped handler is expected to serve on '/'.
func NewMetricsRouter ¶
func NewMetricsRouter(log gethlog.Logger) *MetricsRouter
func (*MetricsRouter) Close ¶
func (r *MetricsRouter) Close() error
func (*MetricsRouter) ServeHTTP ¶
func (r *MetricsRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*MetricsRouter) SetHandler ¶
func (r *MetricsRouter) SetHandler(chainID string, h http.Handler)
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.
type RouterConfig ¶
RouterConfig defines runtime options for the RPC router server.