Documentation
¶
Index ¶
- Variables
- func NewRelayerSessions(deps depinject.Config, opts ...relayer.RelayerSessionsManagerOption) (_ relayer.RelayerSessionsManager, err error)
- func NewSessionTree(sessionHeader *sessiontypes.SessionHeader, supplierOperatorAddress string, ...) (relayer.SessionTree, error)
- func WithSessionTreesInspector(sessionTreeMap *SessionsTreesMap) relayer.RelayerSessionsManagerOption
- func WithStoresDirectory(storesDirectory string) relayer.RelayerSessionsManagerOption
- type SessionsTreesMap
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") )
var ClamAndProofGasCost = sdktypes.NewInt64Coin(volatile.DenomuPOKT, 100_000)
Cumulative (observed) gas fees for creating a single claim and submitting a single proof: - Gas price at time of observance: 0.01uPOKT - Value obtained empirically by observing logs during load testing - Value may change as network parameters change - This value is a function of the claim & proof message sizes
Functions ¶
func NewRelayerSessions ¶
func NewRelayerSessions( deps depinject.Config, opts ...relayer.RelayerSessionsManagerOption, ) (_ relayer.RelayerSessionsManager, err error)
NewRelayerSessions creates a new relayerSessions.
Required dependencies:
- client.BlockClient
- client.BlockQueryClient
- client.SupplierClientMap
- client.SharedQueryClient
- client.ServiceQueryClient
- client.ProofQueryClient
- client.BankQueryClient
- polylog.Logger
Available options:
- WithStoresDirectory
- WithSigningKeyNames
func NewSessionTree ¶
func NewSessionTree( sessionHeader *sessiontypes.SessionHeader, supplierOperatorAddress string, storesDirectory string, logger polylog.Logger, ) (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.
func WithSessionTreesInspector ¶ added in v0.1.2
func WithSessionTreesInspector(sessionTreeMap *SessionsTreesMap) relayer.RelayerSessionsManagerOption
WithSessionTreesInspector allows setting the relay session manager's session tree map via a pointer. In other words, it exposes the session trees map for testing purposes. This shouldn't be used in production, but useful for testing so internal structures can be accessed and validated for expected state.
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 ¶
type SessionsTreesMap ¶ added in v0.1.2
type SessionsTreesMap = map[string]map[int64]map[string]relayer.SessionTree
SessionTreesMap is an alias type for a map of supplierOperatorAddress -> sessionEndHeight -> sessionId -> SessionTree.
It keeps track of the sessions created by RelayMiner in memory. The sessions are group by their end block height, session id and supplier operator address.