Documentation
¶
Index ¶
- Variables
- func NewRelayerSessions(ctx context.Context, deps depinject.Config, ...) (_ relayer.RelayerSessionsManager, err error)
- func NewSessionTree(sessionHeader *sessiontypes.SessionHeader, ...) (relayer.SessionTree, error)
- func WithStoresDirectory(storesDirectory string) relayer.RelayerSessionsManagerOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrSessionTreeClosed = sdkerrors.Register(codespace, 1, "session tree already closed") ErrSessionTreeNotClosed = sdkerrors.Register(codespace, 2, "session tree not closed") ErrSessionTreeStorePathExists = sdkerrors.Register(codespace, 3, "session tree store path already exists") ErrSessionTreeProofPathMismatch = sdkerrors.Register(codespace, 4, "session tree proof path mismatch") ErrSessionTreeUndefinedStoresDirectory = sdkerrors.Register(codespace, 5, "session tree key-value store directory undefined for where they will be saved on disk") ErrSessionTreeAlreadyMarkedAsClaimed = sdkerrors.Register(codespace, 6, "session tree already marked as claimed") ErrSessionSupplierClientNotFound = sdkerrors.Register(codespace, 7, "supplier client not found") ErrSessionUpdatingTree = sdkerrors.Register(codespace, 8, "error updating session SMST") ErrSessionRelayMetaHasNoServiceID = sdkerrors.Register(codespace, 9, "service ID not specified in relay metadata") ErrSessionRelayMetaHasInvalidServiceID = sdkerrors.Register(codespace, 10, "service specified in relay metadata not found") )
Functions ¶
func NewRelayerSessions ¶
func NewRelayerSessions( ctx context.Context, deps depinject.Config, opts ...relayer.RelayerSessionsManagerOption, ) (_ relayer.RelayerSessionsManager, err error)
NewRelayerSessions creates a new relayerSessions.
Required dependencies:
- client.BlockClient
- client.SupplierClientMap
- client.ProofQueryClient
Available options:
- WithStoresDirectory
- WithSigningKeyNames
func NewSessionTree ¶
func NewSessionTree( sessionHeader *sessiontypes.SessionHeader, supplierOperatorAddress *cosmostypes.AccAddress, storesDirectory string, ) (relayer.SessionTree, error)
NewSessionTree creates a new sessionTree from a Session and a storePrefix. It also takes a function removeFromRelayerSessions that removes the sessionTree from the RelayerSessionsManager. It returns an error if the KVStore fails to be created.
TODO_BETA(@red-0ne): When starting a new session, check what the MaxClaimableAmount (in uPOKT) by the Supplier as a function of (app_stake, compute_units_per_relay_for_service, global_compute_units_to_token_multiplier). TODO_CONFIG_NOTE: Whether or not the RelayMiner stop handling requests when the max is reached should be configurable by the operator. TODO_ERROR_NOTE: If overservicing is set to false, create a new error that the relay is rejected specifically because the supplier has reached the max claimable amount, so the caller should relay the request to another supplier.
func WithStoresDirectory ¶
func WithStoresDirectory(storesDirectory string) relayer.RelayerSessionsManagerOption
WithStoresDirectory sets the path on disk where KVStore data files used to store SMST of work sessions are created.
Types ¶
This section is empty.