Documentation ¶
Index ¶
- func LogToConsole(msg string)
- func RebuildAvaiIndexes(clientsCount int, clientSleepTimes *map[int]int64) []int
- func StartScanTx(txWatcher TxWatcher) error
- type SimpleTxWatcher
- func (watcher *SimpleTxWatcher) AddInterestedFrom(from string)
- func (watcher *SimpleTxWatcher) AddInterestedTo(to string)
- func (watcher *SimpleTxWatcher) Callback(tx *TxInfo) error
- func (watcher *SimpleTxWatcher) GetEthClients() ([]*ethclient.Client, error)
- func (watcher *SimpleTxWatcher) GetScanInterval() time.Duration
- func (watcher *SimpleTxWatcher) GetScanStartBlock() uint64
- func (watcher *SimpleTxWatcher) IsInterestedTx(from string, to string) bool
- func (watcher *SimpleTxWatcher) SetInfuraSecrets(secrets []string)
- func (watcher *SimpleTxWatcher) SetScanInterval(interval time.Duration)
- type TxInfo
- type TxWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogToConsole ¶
func LogToConsole(msg string)
func RebuildAvaiIndexes ¶
Types ¶
type SimpleTxWatcher ¶
type SimpleTxWatcher struct {
// contains filtered or unexported fields
}
简单交易管理结构
func NewSimpleTxWatcher ¶
func NewSimpleTxWatcher(endpoints []string, scanStartBlock uint64, scanInterval time.Duration, callback func(*TxInfo) error) *SimpleTxWatcher
构造一个新的简单tx管理结构(默认3秒钟扫描一次)
func (*SimpleTxWatcher) AddInterestedFrom ¶
func (watcher *SimpleTxWatcher) AddInterestedFrom(from string)
添加关注的from address
func (*SimpleTxWatcher) AddInterestedTo ¶
func (watcher *SimpleTxWatcher) AddInterestedTo(to string)
添加关注的to address
func (*SimpleTxWatcher) Callback ¶
func (watcher *SimpleTxWatcher) Callback(tx *TxInfo) error
tx回调处理方法
func (*SimpleTxWatcher) GetEthClients ¶
func (watcher *SimpleTxWatcher) GetEthClients() ([]*ethclient.Client, error)
func (*SimpleTxWatcher) GetScanInterval ¶
func (watcher *SimpleTxWatcher) GetScanInterval() time.Duration
获取区块扫描间隔
func (*SimpleTxWatcher) GetScanStartBlock ¶
func (watcher *SimpleTxWatcher) GetScanStartBlock() uint64
func (*SimpleTxWatcher) IsInterestedTx ¶
func (watcher *SimpleTxWatcher) IsInterestedTx(from string, to string) bool
func (*SimpleTxWatcher) SetInfuraSecrets ¶
func (watcher *SimpleTxWatcher) SetInfuraSecrets(secrets []string)
func (*SimpleTxWatcher) SetScanInterval ¶
func (watcher *SimpleTxWatcher) SetScanInterval(interval time.Duration)
设置区块扫描间隔
type TxInfo ¶
type TxInfo struct { TxHash string BlockHash string BlockNumber *big.Int BlockUnixSecs uint64 From string Gas uint64 GasPrice *big.Int InputData []byte Nonce uint64 To string Value *big.Int V []byte R []byte S []byte ChainID *big.Int CallMethodID string Status uint64 TransactionIndex uint GasUsed uint64 CumulativeGasUsed uint64 // contains filtered or unexported fields }
tx相关信息
Click to show internal directories.
Click to hide internal directories.