Documentation ¶
Overview ¶
Package goethx will help you monitor ethereum transactions
Index ¶
Constants ¶
View Source
const PublicBlockCountValid = 3
PublicBlockCountValid represents after how many blocks a tx is considered valid
View Source
const PublicPollingInterval = 2000
PublicPollingInterval represents the number of seconds between each tx check
View Source
const PublicPollingTimeOut = 7200000
PublicPollingTimeOut represents the number of seconds after we stop looking at tx
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TxMgr ¶
type TxMgr struct { Logger logrus.StdLogger Cli ethCli BlockCountValid int64 PollingInterval time.Duration PollingTimeOut time.Duration TxProcessing map[common.Hash]bool Mutex *sync.Mutex }
TxMgr will allow listening to transactions
type TxMgrI ¶
type TxMgrI interface { MonitorTx( ctx context.Context, txH common.Hash, chTx chan<- TxMsg, ) (bool, error) }
TxMgrI represent the interface to listen to eth tx
type TxStatus ¶
type TxStatus int
TxStatus represent the status of the tx
const ( // TxNil is used when status is empty TxNil TxStatus = 0 // TxPending is used when the tx is still waiting to be mined TxPending TxStatus = 10 // TxError is used when the tx is not successful TxError TxStatus = 100 // TxNotFound is used when no tx has been found TxNotFound TxStatus = 101 // TxTimeOut is used when tx has not been included in a block // within the polling timeout TxTimeOut TxStatus = 102 // TxSuccessNotEnoughBlocks is when tx has been included // but not eough blocks have been appended after TxSuccessNotEnoughBlocks = 103 // TxSuccess is used when tx is successfully included into a block TxSuccess TxStatus = 1000 )
Click to show internal directories.
Click to hide internal directories.