workflow

package
v0.1.3-testnet Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceTagTxInput = "txinput"
)

Variables

View Source
var (
	EventNewGoodTx = eventtype.RegisterNew[*vertex.WrappedTx]("new good seq")
	EventNewTx     = eventtype.RegisterNew[*vertex.WrappedTx]("new tx") // event may be posted more than once for the transaction
)

Functions

func OptionDoNotStartPruner

func OptionDoNotStartPruner(c *ConfigParams)

OptionDoNotStartPruner used for testing, to disable pruner Config key: 'workflow.do_not_start_pruner: true'

func OptionEnableSyncManager

func OptionEnableSyncManager(c *ConfigParams)

OptionEnableSyncManager used to disable sync manager which is optional if sync is not long Config key: 'workflow.do_not_start_sync_manager: true'

Types

type ConfigOption

type ConfigOption func(c *ConfigParams)

type ConfigParams

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

type TxInOption

type TxInOption func(options *txInOptions)

func WithMetadata

func WithMetadata(metadata *txmetadata.TransactionMetadata) TxInOption

func WithPeerMetadata

func WithPeerMetadata(peerID peer.ID, metadata *txmetadata.TransactionMetadata) TxInOption

func WithSourceType

func WithSourceType(sourceType txmetadata.SourceType) TxInOption

type Workflow

type Workflow struct {
	*memdag.MemDAG
	// contains filtered or unexported fields
}

func Start

func Start(env environment, peers *peering.Peers, opts ...ConfigOption) *Workflow

func StartFromConfig

func StartFromConfig(env environment, peers *peering.Peers) *Workflow

func (*Workflow) AddWantedTransaction

func (w *Workflow) AddWantedTransaction(txid *ledger.TransactionID)

func (*Workflow) EnsureBranch

func (w *Workflow) EnsureBranch(txid ledger.TransactionID, timeout ...time.Duration) (*vertex.WrappedTx, error)

func (*Workflow) EnsureLatestBranches

func (w *Workflow) EnsureLatestBranches() error

func (*Workflow) EvidenceNonSequencerTx

func (w *Workflow) EvidenceNonSequencerTx()

func (*Workflow) GetLatestMilestone

func (w *Workflow) GetLatestMilestone(seqID ledger.ChainID) *vertex.WrappedTx

func (*Workflow) GetTxInclusion

func (w *Workflow) GetTxInclusion(txid *ledger.TransactionID, slotsBack int) *multistate.TxInclusion

func (*Workflow) GossipAttachedTransaction

func (w *Workflow) GossipAttachedTransaction(tx *transaction.Transaction, metadata *txmetadata.TransactionMetadata)

func (*Workflow) GossipTxBytesToPeers

func (w *Workflow) GossipTxBytesToPeers(txBytes []byte, metadata *txmetadata.TransactionMetadata, except ...peer.ID)

func (*Workflow) IsSynced

func (w *Workflow) IsSynced() bool

func (*Workflow) LatestMilestonesDescending

func (w *Workflow) LatestMilestonesDescending(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx

LatestMilestonesDescending returns optionally filtered sorted transactions from the sequencer tippool

func (*Workflow) LatestMilestonesShuffled

func (w *Workflow) LatestMilestonesShuffled(filter ...func(seqID ledger.ChainID, vid *vertex.WrappedTx) bool) []*vertex.WrappedTx

LatestMilestonesShuffled returns optionally filtered sorted transactions from the sequencer tippool

func (*Workflow) ListenToAccount

func (w *Workflow) ListenToAccount(account ledger.Accountable, fun func(wOut vertex.WrappedOutput))

ListenToAccount listens to all outputs which belongs to the account (except stem-locked outputs)

func (*Workflow) ListenToSequencers

func (w *Workflow) ListenToSequencers(fun func(vid *vertex.WrappedTx))

func (*Workflow) MaxDurationInTheFuture

func (w *Workflow) MaxDurationInTheFuture() time.Duration

func (*Workflow) MustEnsureBranch

func (w *Workflow) MustEnsureBranch(txid ledger.TransactionID) *vertex.WrappedTx

func (*Workflow) MustPersistTxBytesWithMetadata

func (w *Workflow) MustPersistTxBytesWithMetadata(txBytes []byte, metadata *txmetadata.TransactionMetadata)

func (*Workflow) NumSequencerTips

func (w *Workflow) NumSequencerTips() int

func (*Workflow) OwnSequencerMilestoneIn

func (w *Workflow) OwnSequencerMilestoneIn(txBytes []byte, meta *txmetadata.TransactionMetadata)

func (*Workflow) PeerName

func (w *Workflow) PeerName(id peer.ID) string

func (*Workflow) PokeAllWith

func (w *Workflow) PokeAllWith(wanted *vertex.WrappedTx)

func (*Workflow) PokeMe

func (w *Workflow) PokeMe(me, with *vertex.WrappedTx)

func (*Workflow) PostEventNewGood

func (w *Workflow) PostEventNewGood(vid *vertex.WrappedTx)

func (*Workflow) PostEventNewTransaction

func (w *Workflow) PostEventNewTransaction(vid *vertex.WrappedTx)

func (*Workflow) QueryTxIDStatus

func (w *Workflow) QueryTxIDStatus(txid *ledger.TransactionID) (ret vertex.TxIDStatus)

func (*Workflow) QueryTxIDStatusJSONAble

func (w *Workflow) QueryTxIDStatusJSONAble(txid *ledger.TransactionID) vertex.TxIDStatusJSONAble

func (*Workflow) SaveFullDAG

func (w *Workflow) SaveFullDAG(fname string)

func (*Workflow) SendToTippool

func (w *Workflow) SendToTippool(vid *vertex.WrappedTx)

func (*Workflow) SendTxBytesWithMetadataToPeer

func (w *Workflow) SendTxBytesWithMetadataToPeer(id peer.ID, txBytes []byte, metadata *txmetadata.TransactionMetadata) bool

func (*Workflow) TxBytesFromStoreIn

func (w *Workflow) TxBytesFromStoreIn(txBytesWithMetadata []byte) (*ledger.TransactionID, error)

func (*Workflow) TxBytesIn

func (w *Workflow) TxBytesIn(txBytes []byte, opts ...TxInOption) (*ledger.TransactionID, error)

func (*Workflow) TxBytesInFromAPIQueued

func (w *Workflow) TxBytesInFromAPIQueued(txBytes []byte)

func (*Workflow) TxBytesInFromPeerQueued

func (w *Workflow) TxBytesInFromPeerQueued(txBytes []byte, metaData *txmetadata.TransactionMetadata, from peer.ID, txData []byte)

func (*Workflow) TxFromStoreIn

func (w *Workflow) TxFromStoreIn(txid *ledger.TransactionID) (err error)

func (*Workflow) TxIn

func (w *Workflow) TxIn(tx *transaction.Transaction, opts ...TxInOption) error

func (*Workflow) TxInFromAPI

func (w *Workflow) TxInFromAPI(tx *transaction.Transaction) error

func (*Workflow) TxInFromPeer

func (w *Workflow) TxInFromPeer(tx *transaction.Transaction, metaData *txmetadata.TransactionMetadata, from peer.ID) error

func (*Workflow) WaitTxIDDefined

func (w *Workflow) WaitTxIDDefined(txid *ledger.TransactionID, pollPeriod, timeout time.Duration) (vertex.Status, error)

Jump to

Keyboard shortcuts

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