internal

package
v0.0.0-...-3f0f60f Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPluginMedianServer

func RegisterPluginMedianServer(server *grpc.Server, broker Broker, brokerCfg BrokerConfig, impl PluginMedian) error

func RegisterPluginRelayerServer

func RegisterPluginRelayerServer(server *grpc.Server, broker Broker, brokerCfg BrokerConfig, impl PluginRelayer) error

Types

type Broker

type Broker interface {
	Accept(id uint32) (net.Listener, error)
	DialWithOptions(id uint32, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
	NextId() uint32
}

Broker is a subset of the methods exported by *plugin.GRPCBroker.

type BrokerConfig

type BrokerConfig struct {
	StopCh <-chan struct{}
	Logger logger.Logger

	GRPCOpts // optional
}

BrokerConfig holds Broker configuration fields.

type ErrConfigDigestLen

type ErrConfigDigestLen int

func (ErrConfigDigestLen) Error

func (e ErrConfigDigestLen) Error() string

type ErrConnAccept

type ErrConnAccept struct {
	ID   uint32
	Name string
	Err  error
}

func (ErrConnAccept) Error

func (e ErrConnAccept) Error() string

func (ErrConnAccept) Unwrap

func (e ErrConnAccept) Unwrap() error

type ErrConnDial

type ErrConnDial struct {
	ID   uint32
	Name string
	Err  error
}

func (ErrConnDial) Error

func (e ErrConnDial) Error() string

func (ErrConnDial) Unwrap

func (e ErrConnDial) Unwrap() error

type ErrUint8Bounds

type ErrUint8Bounds struct {
	U    uint32
	Name string
}

func (ErrUint8Bounds) Error

func (e ErrUint8Bounds) Error() string

type ErrorLog

type ErrorLog interface {
	SaveError(ctx context.Context, msg string) error
}

type GRPCOpts

type GRPCOpts struct {
	// Optionally include additional options when dialing a client.
	// Normally aligned with [plugin.ClientConfig.GRPCDialOptions].
	DialOpts []grpc.DialOption
	// Optionally override the default *grpc.Server constructor.
	// Normally aligned with [plugin.ServeConfig.GRPCServer].
	NewServer func([]grpc.ServerOption) *grpc.Server
}

GRPCOpts has GRPC client and server options.

type Keystore

type Keystore interface {
	Accounts(ctx context.Context) (accounts []string, err error)
	// Sign returns data signed by account.
	// nil data can be used as a no-op to check for account existence.
	Sign(ctx context.Context, account string, data []byte) (signed []byte, err error)
}

type PluginMedian

type PluginMedian interface {
	NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog ErrorLog) (ReportingPluginFactory, error)
}

type PluginMedianClient

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

func NewPluginMedianClient

func NewPluginMedianClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.ClientConn) *PluginMedianClient

func (PluginMedianClient) Close

func (s PluginMedianClient) Close() error

func (PluginMedianClient) HealthReport

func (s PluginMedianClient) HealthReport() map[string]error

func (PluginMedianClient) Name

func (s PluginMedianClient) Name() string

func (*PluginMedianClient) NewMedianFactory

func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog ErrorLog) (ReportingPluginFactory, error)

func (PluginMedianClient) Ready

func (s PluginMedianClient) Ready() error

func (PluginMedianClient) Refresh

func (p PluginMedianClient) Refresh(broker Broker, conn *grpc.ClientConn)

func (PluginMedianClient) Start

func (s PluginMedianClient) Start(ctx context.Context) error

type PluginRelayer

type PluginRelayer interface {
	NewRelayer(ctx context.Context, config string, keystore Keystore) (Relayer, error)
}

type PluginRelayerClient

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

func NewPluginRelayerClient

func NewPluginRelayerClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.ClientConn) *PluginRelayerClient

func (*PluginRelayerClient) NewRelayer

func (p *PluginRelayerClient) NewRelayer(ctx context.Context, config string, keystore Keystore) (Relayer, error)

func (PluginRelayerClient) Refresh

func (p PluginRelayerClient) Refresh(broker Broker, conn *grpc.ClientConn)

type Relayer

type Relayer interface {
	types.Service

	NewConfigProvider(context.Context, types.RelayArgs) (types.ConfigProvider, error)
	NewMedianProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.MedianProvider, error)
	NewMercuryProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.MercuryProvider, error)

	ChainStatus(ctx context.Context, id string) (types.ChainStatus, error)
	ChainStatuses(ctx context.Context, offset, limit int) (chains []types.ChainStatus, count int, err error)

	NodeStatuses(ctx context.Context, offset, limit int, chainIDs ...string) (nodes []types.NodeStatus, count int, err error)

	SendTx(ctx context.Context, chainID, from, to string, amount *big.Int, balanceCheck bool) error
}

Relayer extends [types.Relayer] and includes [context.Context]s.

type ReportingPluginFactory

type ReportingPluginFactory interface {
	types.Service
	libocr.ReportingPluginFactory
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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