Documentation
¶
Index ¶
- Variables
- func NewRelayerProxy(deps depinject.Config, opts ...relayer.RelayerProxyOption) (relayer.RelayerProxy, error)
- func NewSynchronousServer(logger polylog.Logger, serverConfig *config.RelayMinerServerConfig, ...) relayer.RelayServer
- func WithServicesConfigMap(servicesConfigMap map[string]*config.RelayMinerServerConfig) relayer.RelayerProxyOption
- func WithSigningKeyNames(keyNames []string) relayer.RelayerProxyOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrRelayerProxyUnsupportedRPCType = sdkerrors.Register(codespace, 1, "unsupported rpc type") ErrRelayerProxyInvalidSession = sdkerrors.Register(codespace, 2, "invalid session in relayer request") ErrRelayerProxyInvalidSupplier = sdkerrors.Register(codespace, 3, "supplier does not belong to session") ErrRelayerProxyUndefinedSigningKeyNames = sdkerrors.Register(codespace, 4, "supplier signing key names are undefined") ErrRelayerServicesConfigsUndefined = sdkerrors.Register(codespace, 5, "services configurations are undefined") ErrRelayerProxyInvalidRelayRequest = sdkerrors.Register(codespace, 6, "invalid relay request") ErrRelayerProxyInvalidRelayResponse = sdkerrors.Register(codespace, 7, "invalid relay response") ErrRelayerProxyServiceEndpointNotHandled = sdkerrors.Register(codespace, 8, "service endpoint not handled by relayer proxy") ErrRelayerProxyUnsupportedTransportType = sdkerrors.Register(codespace, 9, "unsupported proxy transport type") ErrRelayerProxyInternalError = sdkerrors.Register(codespace, 10, "internal error") ErrRelayerProxyMissingSupplierOperatorAddress = sdkerrors.Register(codespace, 11, "supplier operator address is missing") )
Functions ¶
func NewRelayerProxy ¶
func NewRelayerProxy( deps depinject.Config, opts ...relayer.RelayerProxyOption, ) (relayer.RelayerProxy, error)
NewRelayerProxy creates a new relayer proxy with the given dependencies or returns an error if the dependencies fail to resolve or the options are invalid.
Required dependencies:
- cosmosclient.Context
- client.BlockClient
- client.SessionQueryClient
- client.SharedQueryClient
- client.SupplierQueryClient
Available options:
- WithSigningKeyNames
- WithServicesConfigMap
func NewSynchronousServer ¶
func NewSynchronousServer( logger polylog.Logger, serverConfig *config.RelayMinerServerConfig, servedRelaysProducer chan<- *types.Relay, proxy relayer.RelayerProxy, ) relayer.RelayServer
NewSynchronousServer creates a new HTTP server that listens for incoming relay requests and forwards them to the supported proxied service endpoint. It takes the serviceId, endpointUrl, and the main RelayerProxy as arguments and returns a RelayServer that listens to incoming RelayRequests. TODO_RESEARCH(#590): Currently, the communication between the AppGateServer and the RelayMiner uses HTTP. This could be changed to a more generic and performant one, such as pure TCP.
func WithServicesConfigMap ¶
func WithServicesConfigMap(servicesConfigMap map[string]*config.RelayMinerServerConfig) relayer.RelayerProxyOption
WithServicesConfigMap updates the configurations of all the services the RelayMiner proxies requests to. servicesConfigMap is a map of server endpoints to their respective parsed configurations.
func WithSigningKeyNames ¶ added in v0.0.3
func WithSigningKeyNames(keyNames []string) relayer.RelayerProxyOption
WithSigningKeyName sets the signing key name used by the relayer proxy to sign relay responses. It is used along with the keyring to get the supplier operator address and sign the relay responses.
Types ¶
This section is empty.