Documentation
¶
Index ¶
Constants ¶
View Source
const MaxRetry = 3
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
type Metrics ¶
type Metrics struct {
// ConfirmedTransactions counts transactions whose ledger status resolved to
// Valid and whose token-request hash matched, i.e. fully committed.
ConfirmedTransactions metrics.Counter
// DeletedTransactions counts transactions whose ledger status resolved to
// Invalid, or whose token-request hash did not match (integrity failure).
DeletedTransactions metrics.Counter
// HashMismatches counts the subset of deleted transactions that were
// invalidated specifically because the committed token-request hash did not
// match the locally stored one. Non-zero values indicate a data-integrity
// violation worth alerting on.
HashMismatches metrics.Counter
// RetryExhausted counts calls to OnError, i.e. how many transactions had
// their finality processing abandoned after all retries were exhausted.
RetryExhausted metrics.Counter
// OnStatusDuration is a histogram of the total wall-clock time for each
// OnStatus invocation (including any retries), measured in seconds.
OnStatusDuration metrics.Histogram
}
Metrics holds the instrumentation for the finality Listener.
func NewMetrics ¶
NewMetrics creates a new Metrics instance with the given provider. This is exported for use by other packages that need finality metrics.
type TTXRecoveryHandler ¶
type TTXRecoveryHandler struct {
// contains filtered or unexported fields
}
TTXRecoveryHandler implements transaction recovery by directly querying transaction status and applying finality logic synchronously
func NewTTXRecoveryHandler ¶
func NewTTXRecoveryHandler( logger logging.Logger, network networkService, namespace string, hasher tokenRequestHasher, tmsID token.TMSID, transactionDB transactionDB, tokens tokensService, tracer trace.Tracer, metricsProvider metrics.Provider, ) *TTXRecoveryHandler
NewTTXRecoveryHandler creates a new recovery handler with all dependencies needed to perform synchronous transaction recovery
type TokenRequestHasher ¶
type TokenRequestHasher struct {
// contains filtered or unexported fields
}
TokenRequestHasher processes token requests from raw bytes
func NewTokenRequestHasher ¶
func NewTokenRequestHasher(tmsProvider dep.TokenManagementServiceProvider, tmsID token.TMSID) *TokenRequestHasher
NewTokenRequestHasher creates a new token request hasher
func (*TokenRequestHasher) ProcessTokenRequest ¶
func (h *TokenRequestHasher) ProcessTokenRequest(ctx context.Context, tokenRequestRaw []byte) (tr *token.Request, msgToSign []byte, err error)
ProcessTokenRequest processes a raw token request and returns the request and message to sign
Click to show internal directories.
Click to hide internal directories.