proxy

package
v0.0.9-4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

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