Documentation ¶
Index ¶
- Constants
- Variables
- func HCLogLogger(l logger.Logger) hclog.Logger
- func NewLogger() (logger.Logger, error)
- func PluginMedianHandshakeConfig() plugin.HandshakeConfig
- func PluginRelayerHandshakeConfig() plugin.HandshakeConfig
- func RegisterStandAloneProvider(s *grpc.Server, p types.PluginProvider, pType types.OCR2PluginType) error
- func SetupTracing(config TracingConfig) (err error)
- type BrokerConfig
- type ContextValues
- type EnvConfig
- type ErrorLog
- type GRPCOpts
- type GRPCPluginMedian
- type GRPCPluginRelayer
- type Keystore
- type MedianService
- type Plugin
- type PluginMedian
- type PluginRelayer
- type PromServer
- type PromServerOpts
- type Relayer
- type RelayerAdapter
- func (r *RelayerAdapter) Close() error
- func (r *RelayerAdapter) HealthReport() map[string]error
- func (r *RelayerAdapter) Name() string
- func (r *RelayerAdapter) NewPluginProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.PluginProvider, error)
- func (r *RelayerAdapter) Ready() (err error)
- func (r *RelayerAdapter) Start(ctx context.Context) error
- type RelayerExt
- type RelayerService
- func (r *RelayerService) GetChainStatus(ctx context.Context) (types.ChainStatus, error)
- func (r *RelayerService) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (nodes []types.NodeStatus, nextPageToken string, total int, err error)
- func (r *RelayerService) NewPluginProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.PluginProvider, error)
- func (r *RelayerService) Transact(ctx context.Context, from, to string, amount *big.Int, balanceCheck bool) error
- type ReportingPluginFactory
- type Server
- type TracingConfig
Constants ¶
const PluginMedianName = "median"
PluginMedianName is the name for types.PluginMedian/[NewGRPCPluginMedian].
const PluginRelayerName = "relayer"
PluginRelayerName is the name for types.PluginRelayer/[NewGRPCPluginRelayer].
Variables ¶
Functions ¶
func HCLogLogger ¶
HCLogLogger returns an hclog.Logger backed by the given logger.Logger.
func NewLogger ¶
NewLogger returns a new logger.Logger configured to encode hclog compatible JSON.
func PluginMedianHandshakeConfig ¶
func PluginMedianHandshakeConfig() plugin.HandshakeConfig
func PluginRelayerHandshakeConfig ¶
func PluginRelayerHandshakeConfig() plugin.HandshakeConfig
func RegisterStandAloneProvider ¶
func RegisterStandAloneProvider(s *grpc.Server, p types.PluginProvider, pType types.OCR2PluginType) error
RegisterStandAloneProvider register the servers needed for a plugin provider, this is a workaround to test the Node API medianpoc on EVM until the EVM relayer is loopifyed
func SetupTracing ¶
func SetupTracing(config TracingConfig) (err error)
SetupTracing initializes open telemetry with the provided config. It sets the global trace provider and opens a connection to the configured collector.
Types ¶
type BrokerConfig ¶
type BrokerConfig = internal.BrokerConfig
type ContextValues ¶
ContextValues is a helper for passing values via a context.Context.
func (*ContextValues) Args ¶
func (v *ContextValues) Args() (a []any)
Args returns a slice of args to pass to logger.Logger.With.
func (*ContextValues) ContextWithValues ¶
func (v *ContextValues) ContextWithValues(ctx context.Context) context.Context
ContextWithValues returns a context.Context with values set from v.
func (*ContextValues) SetValues ¶
func (v *ContextValues) SetValues(ctx context.Context)
SetValues sets v to values from the ctx.
type EnvConfig ¶
type EnvConfig struct { PrometheusPort int TracingEnabled bool TracingCollectorTarget string TracingSamplingRatio float64 TracingTLSCertPath string TracingAttributes map[string]string }
EnvConfig is the configuration between the application and the LOOP executable. The values are fully resolved and static and passed via the environment.
type GRPCOpts ¶
func NewGRPCOpts ¶
func NewGRPCOpts(registerer prometheus.Registerer) GRPCOpts
NewGRPCOpts initializes open telemetry and returns GRPCOpts with telemetry interceptors. It is called from the host and each plugin - intended as there is bidirectional communication
type GRPCPluginMedian ¶
type GRPCPluginMedian struct { plugin.NetRPCUnsupportedPlugin BrokerConfig PluginServer types.PluginMedian // contains filtered or unexported fields }
func (*GRPCPluginMedian) ClientConfig ¶
func (p *GRPCPluginMedian) ClientConfig() *plugin.ClientConfig
func (*GRPCPluginMedian) GRPCClient ¶
func (p *GRPCPluginMedian) GRPCClient(_ context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)
GRPCClient implements plugin.GRPCPlugin and returns the pluginClient types.PluginMedian, updated with the new broker and conn.
func (*GRPCPluginMedian) GRPCServer ¶
func (p *GRPCPluginMedian) GRPCServer(broker *plugin.GRPCBroker, server *grpc.Server) error
type GRPCPluginRelayer ¶
type GRPCPluginRelayer struct { plugin.NetRPCUnsupportedPlugin BrokerConfig PluginServer PluginRelayer // contains filtered or unexported fields }
GRPCPluginRelayer implements plugin.GRPCPlugin for types.PluginRelayer.
func (*GRPCPluginRelayer) ClientConfig ¶
func (p *GRPCPluginRelayer) ClientConfig() *plugin.ClientConfig
func (*GRPCPluginRelayer) GRPCClient ¶
func (p *GRPCPluginRelayer) GRPCClient(_ context.Context, broker *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)
GRPCClient implements plugin.GRPCPlugin and returns the pluginClient types.PluginRelayer, updated with the new broker and conn.
func (*GRPCPluginRelayer) GRPCServer ¶
func (p *GRPCPluginRelayer) GRPCServer(broker *plugin.GRPCBroker, server *grpc.Server) error
type MedianService ¶
type MedianService struct { internal.PluginService[*GRPCPluginMedian, types.ReportingPluginFactory] }
MedianService is a types.Service that maintains an internal types.PluginMedian.
func NewMedianService ¶
func NewMedianService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cmd, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog types.ErrorLog) *MedianService
NewMedianService returns a new *MedianService. cmd must return a new exec.Cmd each time it is called.
func (*MedianService) NewReportingPlugin ¶
func (m *MedianService) NewReportingPlugin(config ocrtypes.ReportingPluginConfig) (ocrtypes.ReportingPlugin, ocrtypes.ReportingPluginInfo, error)
type Plugin ¶
Plugin is a base layer for plugins to easily manage sub-[types.Service]s. Useful for implementing PluginRelayer and PluginMedian.
func (*Plugin) HealthReport ¶
func (*Plugin) SubService ¶
type PluginRelayer ¶
type PluginRelayer = internal.PluginRelayer
type PromServer ¶
type PromServer struct {
// contains filtered or unexported fields
}
func NewPromServer ¶
func NewPromServer(port int, lggr logger.Logger) *PromServer
func (*PromServer) Close ¶
func (p *PromServer) Close() error
Close shuts down the underlying HTTP server. See http.Server.Close for details
func (*PromServer) Start ¶
func (p *PromServer) Start() error
Start starts HTTP server on specified port to handle metrics requests
type PromServerOpts ¶
func (PromServerOpts) New ¶
func (o PromServerOpts) New(port int, lggr logger.Logger) *PromServer
type RelayerAdapter ¶
type RelayerAdapter struct { types.Relayer RelayerExt }
RelayerAdapter adapts a types.Relayer and RelayerExt to implement Relayer.
func (*RelayerAdapter) Close ¶
func (r *RelayerAdapter) Close() error
func (*RelayerAdapter) HealthReport ¶
func (r *RelayerAdapter) HealthReport() map[string]error
func (*RelayerAdapter) Name ¶
func (r *RelayerAdapter) Name() string
func (*RelayerAdapter) NewPluginProvider ¶
func (r *RelayerAdapter) NewPluginProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.PluginProvider, error)
func (*RelayerAdapter) Ready ¶
func (r *RelayerAdapter) Ready() (err error)
type RelayerExt ¶
type RelayerExt interface { types.ChainService ID() string }
RelayerExt is a subset of loop.Relayer for adapting types.Relayer, typically with a Chain. See RelayerAdapter.
type RelayerService ¶
type RelayerService struct { internal.PluginService[*GRPCPluginRelayer, Relayer] }
RelayerService is a types.Service that maintains an internal Relayer.
func NewRelayerService ¶
func NewRelayerService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cmd, config string, keystore types.Keystore) *RelayerService
NewRelayerService returns a new *RelayerService. cmd must return a new exec.Cmd each time it is called.
func (*RelayerService) GetChainStatus ¶
func (r *RelayerService) GetChainStatus(ctx context.Context) (types.ChainStatus, error)
func (*RelayerService) ListNodeStatuses ¶
func (r *RelayerService) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (nodes []types.NodeStatus, nextPageToken string, total int, err error)
func (*RelayerService) NewPluginProvider ¶
func (r *RelayerService) NewPluginProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.PluginProvider, error)
type Server ¶
type Server struct { GRPCOpts GRPCOpts Logger logger.SugaredLogger // contains filtered or unexported fields }
Server holds common plugin server fields.
func MustNewStartedServer ¶
MustNewStartedServer returns a new started Server like NewStartedServer, but logs and exits in the event of error. The caller is responsible for calling Server.Stop().
func NewStartedServer ¶
NewStartedServer returns a started Server. The caller is responsible for calling Server.Stop().
func (*Server) MustRegister ¶
func (s *Server) MustRegister(c services.HealthReporter)
MustRegister registers the HealthReporter with services.HealthChecker, or exits upon failure.
type TracingConfig ¶
type TracingConfig struct { // NodeAttributes are the attributes to attach to traces. NodeAttributes map[string]string // Enables tracing; requires a collector to be provided Enabled bool // Collector is the address of the OTEL collector to send traces to. CollectorTarget string // SamplingRatio is the ratio of traces to sample. 1.0 means sample all traces. SamplingRatio float64 // TLSCertPath is the path to the TLS certificate to use when connecting to the collector. TLSCertPath string // OnDialError is called when the dialer fails, providing an opportunity to log. OnDialError func(error) }