soltxm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TxFailRevert = iota
	TxFailReject
	TxFailDrop
	TxFailSimRevert
	TxFailSimOther
)
View Source
const (
	MaxQueueLen      = 1000
	MaxRetryTimeMs   = 250 // max tx retry time (exponential retry will taper to retry every 0.25s)
	MaxSigsToConfirm = 256 // max number of signatures in GetSignatureStatus call
)
View Source
const (
	NotFound = iota
	Processed
	ConfirmedRevert
	ConfirmedSuccess
)

tx not found < tx processed < tx confirmed/finalized + revert < tx confirmed/finalized + success

Variables

This section is empty.

Functions

Types

type PendingTxContext

type PendingTxContext interface {
	New(sig solana.Signature, cancel context.CancelFunc) (uuid.UUID, error)
	Add(id uuid.UUID, sig solana.Signature) error
	Remove(sig solana.Signature) uuid.UUID
	ListAll() []solana.Signature
	Expired(sig solana.Signature, lifespan time.Duration) bool
	// state change hooks
	OnSuccess(sig solana.Signature) uuid.UUID
	OnError(sig solana.Signature, errType int) uuid.UUID // match err type using enum
}

type Txm

type Txm struct {
	// contains filtered or unexported fields
}

Txm manages transactions for the solana blockchain. simple implementation with no persistently stored txs

func NewTxm

func NewTxm(chainID string, tc func() (solanaClient.ReaderWriter, error), cfg config.Config, ks keystore.Solana, lggr logger.Logger) *Txm

NewTxm creates a txm. Uses simulation so should only be used to send txes to trusted contracts i.e. OCR.

func (*Txm) Close

func (txm *Txm) Close() error

Close close service

func (*Txm) Enqueue

func (txm *Txm) Enqueue(accountID string, tx *solanaGo.Transaction) error

Enqueue enqueue a msg destined for the solana chain.

func (*Txm) HealthReport

func (txm *Txm) HealthReport() map[string]error

func (*Txm) Healthy

func (txm *Txm) Healthy() error

Healthy service is healthy

func (*Txm) InflightTxs

func (txm *Txm) InflightTxs() int

func (*Txm) Name

func (txm *Txm) Name() string

func (*Txm) Ready

func (txm *Txm) Ready() error

Ready service is ready

func (*Txm) Start

func (txm *Txm) Start(ctx context.Context) error

Start subscribes to queuing channel and processes them.

Jump to

Keyboard shortcuts

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