relayerset

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*net.BrokerExt
	*goplugin.ServiceClient
	// contains filtered or unexported fields
}

func NewRelayerSetClient

func NewRelayerSetClient(log logger.Logger, b *net.BrokerExt, conn grpc.ClientConnInterface) *Client

func (*Client) CloseRelayer

func (k *Client) CloseRelayer(ctx context.Context, relayID types.RelayID) error

func (*Client) Get

func (k *Client) Get(ctx context.Context, relayID types.RelayID) (core.Relayer, error)

func (*Client) List

func (k *Client) List(ctx context.Context, relayIDs ...types.RelayID) (map[types.RelayID]core.Relayer, error)

func (*Client) NewChainWriter

func (k *Client) NewChainWriter(ctx context.Context, relayID types.RelayID, chainWriterConfig []byte) (uint32, error)

func (*Client) NewContractReader

func (k *Client) NewContractReader(ctx context.Context, relayID types.RelayID, contractReaderConfig []byte) (uint32, error)

func (*Client) NewPluginProvider

func (k *Client) NewPluginProvider(ctx context.Context, relayID types.RelayID, relayArgs core.RelayArgs, pluginArgs core.PluginArgs) (uint32, error)

func (*Client) RelayerHealthReport

func (k *Client) RelayerHealthReport(ctx context.Context, relayID types.RelayID) (map[string]error, error)

func (*Client) RelayerLatestHead

func (k *Client) RelayerLatestHead(ctx context.Context, relayID types.RelayID) (types.Head, error)

func (*Client) RelayerName

func (k *Client) RelayerName(ctx context.Context, relayID types.RelayID) (string, error)

func (*Client) RelayerReady

func (k *Client) RelayerReady(ctx context.Context, relayID types.RelayID) error

func (*Client) StartRelayer

func (k *Client) StartRelayer(ctx context.Context, relayID types.RelayID) error

type Server

type Server struct {
	relayerset.UnimplementedRelayerSetServer

	Name string
	// contains filtered or unexported fields
}

func NewRelayerSetServer

func NewRelayerSetServer(log logger.Logger, underlying core.RelayerSet, broker *net.BrokerExt) (*Server, net.Resource)

func (*Server) Close

func (s *Server) Close() error

func (*Server) CloseRelayer

func (s *Server) CloseRelayer(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)

func (*Server) NewChainWriter

RelayerSet is supposed to serve relayers, which then hold a ContractReader and ChainWriter. Serving NewChainWriter and NewChainWriter from RelayerSet is a way to save us from instantiating an extra server for the Relayer. Without this approach, the calls we would make normally are

  • RelayerSet.Get -> Relayer
  • Relayer.NewChainWriter -> ChainWriter

We could translate this to the GRPC world by having each call to RelayerSet.Get wrap the returned relayer in a server and register that to the GRPC server. However this is actually pretty inefficient since a relayer object on its own is not useful. Users will always want to use the relayer to instantiate a contractreader or chainwriter. So we can avoid the intermediate server for the relayer by just storing a reference to the relayerSet client and the relayer we want to fetch. I.e. the calls described above instead would become:

  • RelayerSet.Get -> (RelayerSetClient, RelayerID). Effectively this call just acts as check that Relayer exists

RelayerClient.NewChainWriter -> This is a call to RelayerSet.NewChainWriter with (relayerID, []contractReaderConfig); The implementation will then fetch the relayer and call NewChainWriter on it

func (*Server) NewContractReader

RelayerSet is supposed to serve relayers, which then hold a ContractReader and ChainWriter. Serving NewContractReader and NewChainWriter from RelayerSet is a way to save us from instantiating an extra server for the Relayer. Without this approach, the calls we would make normally are

  • RelayerSet.Get -> Relayer
  • Relayer.NewContractReader -> ContractReader

We could translate this to the GRPC world by having each call to RelayerSet.Get wrap the returned relayer in a server and register that to the GRPC server. However this is actually pretty inefficient since a relayer object on its own is not useful. Users will always want to use the relayer to instantiate a contractreader or chainwriter. So we can avoid the intermediate server for the relayer by just storing a reference to the relayerSet client and the relayer we want to fetch. I.e. the calls described above instead would become:

  • RelayerSet.Get -> (RelayerSetClient, RelayerID). Effectively this call just acts as check that Relayer exists

RelayerClient.NewContractReader -> This is a call to RelayerSet.NewContractReader with (relayerID, []contractReaderConfig); The implementation will then fetch the relayer and call NewContractReader on it

func (*Server) RelayerHealthReport

func (s *Server) RelayerHealthReport(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerHealthReportResponse, error)

func (*Server) RelayerLatestHead

func (*Server) RelayerName

func (s *Server) RelayerName(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerNameResponse, error)

func (*Server) RelayerReady

func (s *Server) RelayerReady(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)

func (*Server) StartRelayer

func (s *Server) StartRelayer(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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