Documentation
¶
Index ¶
- Variables
- func CreateBcsValue(typeTag aptos.TypeTag, typeValue any) ([]byte, error)
- func CreateTypeTag(typeName string) (aptos.TypeTag, error)
- func GetBcsValues(data []byte, typeTags ...aptos.TypeTag) ([]any, error)
- func GetContexedTxLogger(baseLogger logger.Logger, txID string, txMetadata *commontypes.TxMeta) logger.Logger
- type AccountStore
- type AptosTx
- type AptosTxm
- func (a *AptosTxm) Close() error
- func (a *AptosTxm) Enqueue(transactionID string, txMetadata *commontypes.TxMeta, ...) error
- func (a *AptosTxm) GetStatus(transactionID string) (commontypes.TransactionStatus, error)
- func (a *AptosTxm) HealthReport() map[string]error
- func (a *AptosTxm) InflightCount() (int, int)
- func (a *AptosTxm) Name() string
- func (a *AptosTxm) Ready() error
- func (a *AptosTxm) Start(ctx context.Context) error
- type Config
- type RetryReason
- type TxStore
- func (s *TxStore) AddUnconfirmed(nonce uint64, hash string, expirationTimestampSecs uint64, tx *AptosTx) error
- func (s *TxStore) Confirm(nonce uint64, hash string, failed bool) error
- func (s *TxStore) GetLastResyncedNonce() uint64
- func (s *TxStore) GetNextNonce() uint64
- func (s *TxStore) GetUnconfirmed() []*UnconfirmedTx
- func (s *TxStore) InflightCount() int
- func (s *TxStore) ResyncNonce(onchainNonce uint64)
- type UnconfirmedTx
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfigSet = Config{ BroadcastChanSize: 100, ConfirmPollSecs: 2, DefaultMaxGasAmount: 200000, MaxSimulateAttempts: 5, MaxSubmitRetryAttempts: 10, SubmitDelayDuration: 3, TxExpirationSecs: 10, MaxTxRetryAttempts: 5, PruneIntervalSecs: uint64(60 * 60 * 4), PruneTxExpirationSecs: uint64(60 * 60 * 2), }
DefaultConfigSet is the default configuration for the TransactionManager
Functions ¶
func GetContexedTxLogger ¶
Types ¶
type AccountStore ¶
type AccountStore struct {
// contains filtered or unexported fields
}
func NewAccountStore ¶
func NewAccountStore() *AccountStore
func (*AccountStore) CreateTxStore ¶
func (c *AccountStore) CreateTxStore(accountAddress string, initialNonce uint64) (*TxStore, error)
func (*AccountStore) GetAllUnconfirmed ¶
func (c *AccountStore) GetAllUnconfirmed() map[string][]*UnconfirmedTx
func (*AccountStore) GetTotalInflightCount ¶
func (c *AccountStore) GetTotalInflightCount() int
func (*AccountStore) GetTxStore ¶
func (c *AccountStore) GetTxStore(accountAddress string) *TxStore
GetTxStore returns the TxStore for the provided account.
type AptosTx ¶
type AptosTx struct {
ID string
Metadata *commontypes.TxMeta
Timestamp uint64
FromAddress aptos.AccountAddress
PublicKey ed25519.PublicKey
ContractAddress aptos.AccountAddress
ModuleName string
FunctionName string
TypeTags []aptos.TypeTag
BcsValues [][]byte
Attempt uint64
Status commontypes.TransactionStatus
Simulate bool
}
type AptosTxm ¶
type AptosTxm struct {
// contains filtered or unexported fields
}
func New ¶
func New(lgr logger.Logger, keystore loop.Keystore, config Config, getClient func() (aptos.AptosRpcClient, error)) (*AptosTxm, error)
TODO: Config input is not validated for sanity
func (*AptosTxm) GetStatus ¶
func (a *AptosTxm) GetStatus(transactionID string) (commontypes.TransactionStatus, error)
func (*AptosTxm) HealthReport ¶
func (*AptosTxm) InflightCount ¶
type Config ¶
type Config struct {
BroadcastChanSize uint
ConfirmPollSecs uint
DefaultMaxGasAmount uint64
MaxSimulateAttempts uint
MaxSubmitRetryAttempts uint
SubmitDelayDuration uint
TxExpirationSecs uint64
MaxTxRetryAttempts uint64
PruneIntervalSecs uint64
PruneTxExpirationSecs uint64
}
TODO: these should be duration, not numbers
type RetryReason ¶
type RetryReason int
const ( RetryReasonOutOfGas RetryReason = iota RetryReasonExpired )
func (RetryReason) String ¶
func (r RetryReason) String() string
type TxStore ¶
type TxStore struct {
// contains filtered or unexported fields
}
TxStore tracks broadcast & unconfirmed txs per account address per chain id
func NewTxStore ¶
func (*TxStore) AddUnconfirmed ¶
func (*TxStore) GetLastResyncedNonce ¶
func (*TxStore) GetNextNonce ¶
func (*TxStore) GetUnconfirmed ¶
func (s *TxStore) GetUnconfirmed() []*UnconfirmedTx
func (*TxStore) InflightCount ¶
func (*TxStore) ResyncNonce ¶
Resync the next nonce. This should never be called between GetNextNonce() and AddUnconfirmed() as it updates the next nonce, since AddUnconfirmed expects the current `nextNonce` to be used for the following transaction.
Click to show internal directories.
Click to hide internal directories.