Documentation ¶
Index ¶
- type Client
- func (k *Client) CloseRelayer(ctx context.Context, relayID types.RelayID) error
- func (k *Client) Get(ctx context.Context, relayID types.RelayID) (core.Relayer, error)
- func (k *Client) List(ctx context.Context, relayIDs ...types.RelayID) (map[types.RelayID]core.Relayer, error)
- func (k *Client) NewChainWriter(ctx context.Context, relayID types.RelayID, chainWriterConfig []byte) (uint32, error)
- func (k *Client) NewContractReader(ctx context.Context, relayID types.RelayID, contractReaderConfig []byte) (uint32, error)
- func (k *Client) NewPluginProvider(ctx context.Context, relayID types.RelayID, relayArgs core.RelayArgs, ...) (uint32, error)
- func (k *Client) RelayerHealthReport(ctx context.Context, relayID types.RelayID) (map[string]error, error)
- func (k *Client) RelayerLatestHead(ctx context.Context, relayID types.RelayID) (types.Head, error)
- func (k *Client) RelayerName(ctx context.Context, relayID types.RelayID) (string, error)
- func (k *Client) RelayerReady(ctx context.Context, relayID types.RelayID) error
- func (k *Client) StartRelayer(ctx context.Context, relayID types.RelayID) error
- type Server
- func (s *Server) Close() error
- func (s *Server) CloseRelayer(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)
- func (s *Server) Get(ctx context.Context, req *relayerset.GetRelayerRequest) (*relayerset.GetRelayerResponse, error)
- func (s *Server) List(ctx context.Context, req *relayerset.ListAllRelayersRequest) (*relayerset.ListAllRelayersResponse, error)
- func (s *Server) NewChainWriter(ctx context.Context, req *relayerset.NewChainWriterRequest) (*relayerset.NewChainWriterResponse, error)
- func (s *Server) NewContractReader(ctx context.Context, req *relayerset.NewContractReaderRequest) (*relayerset.NewContractReaderResponse, error)
- func (s *Server) NewPluginProvider(ctx context.Context, req *relayerset.NewPluginProviderRequest) (*relayerset.NewPluginProviderResponse, error)
- func (s *Server) RelayerHealthReport(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerHealthReportResponse, error)
- func (s *Server) RelayerLatestHead(ctx context.Context, req *relayerset.LatestHeadRequest) (*relayerset.LatestHeadResponse, error)
- func (s *Server) RelayerName(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerNameResponse, error)
- func (s *Server) RelayerReady(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)
- func (s *Server) StartRelayer(ctx context.Context, relayID *relayerset.RelayerId) (*emptypb.Empty, error)
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 (*Client) CloseRelayer ¶
func (*Client) NewChainWriter ¶
func (*Client) NewContractReader ¶
func (*Client) NewPluginProvider ¶
func (*Client) RelayerHealthReport ¶
func (*Client) RelayerLatestHead ¶
func (*Client) RelayerName ¶
func (*Client) RelayerReady ¶
type Server ¶
type Server struct { relayerset.UnimplementedRelayerSetServer Name string // contains filtered or unexported fields }
func NewRelayerSetServer ¶
func (*Server) CloseRelayer ¶
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, req *relayerset.GetRelayerRequest) (*relayerset.GetRelayerResponse, error)
func (*Server) List ¶
func (s *Server) List(ctx context.Context, req *relayerset.ListAllRelayersRequest) (*relayerset.ListAllRelayersResponse, error)
func (*Server) NewChainWriter ¶
func (s *Server) NewChainWriter(ctx context.Context, req *relayerset.NewChainWriterRequest) (*relayerset.NewChainWriterResponse, error)
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 ¶
func (s *Server) NewContractReader(ctx context.Context, req *relayerset.NewContractReaderRequest) (*relayerset.NewContractReaderResponse, error)
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) NewPluginProvider ¶
func (s *Server) NewPluginProvider(ctx context.Context, req *relayerset.NewPluginProviderRequest) (*relayerset.NewPluginProviderResponse, error)
func (*Server) RelayerHealthReport ¶
func (s *Server) RelayerHealthReport(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerHealthReportResponse, error)
func (*Server) RelayerLatestHead ¶
func (s *Server) RelayerLatestHead(ctx context.Context, req *relayerset.LatestHeadRequest) (*relayerset.LatestHeadResponse, error)
func (*Server) RelayerName ¶
func (s *Server) RelayerName(ctx context.Context, relayID *relayerset.RelayerId) (*relayerset.RelayerNameResponse, error)