Documentation ¶
Index ¶
- func LogToConsole(msg string)
- func RebuildAvaiIndexes(clientsCount int, clientSleepTimes *map[int]int64) []int
- func StartScanTxLogs(txlogWatcher TxlogWatcher) error
- type SimpleTxLogWatcher
- func (watcher *SimpleTxLogWatcher) AddInterestedParams(address string, topic0 string)
- func (watcher *SimpleTxLogWatcher) Callback(tx *types.Log) error
- func (watcher *SimpleTxLogWatcher) GetEthClients() ([]*ethclient.Client, error)
- func (watcher *SimpleTxLogWatcher) GetInterestedAddresses() []common.Address
- func (watcher *SimpleTxLogWatcher) GetPerScanBlockCount() uint64
- func (watcher *SimpleTxLogWatcher) GetScanInterval() time.Duration
- func (watcher *SimpleTxLogWatcher) GetScanStartBlock() uint64
- func (watcher *SimpleTxLogWatcher) IsInterestedLog(addr string, topic0 string) bool
- func (watcher *SimpleTxLogWatcher) SetInfuraSecrets(secrets []string)
- func (watcher *SimpleTxLogWatcher) SetPerScanBlockCount(perScanBlockCount uint64)
- func (watcher *SimpleTxLogWatcher) SetScanInterval(interval time.Duration)
- type TxlogWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogToConsole ¶
func LogToConsole(msg string)
func RebuildAvaiIndexes ¶
Types ¶
type SimpleTxLogWatcher ¶
type SimpleTxLogWatcher struct {
// contains filtered or unexported fields
}
简单交易管理结构
func NewSimpleTxLogWatcher ¶
func NewSimpleTxLogWatcher(endpoints []string, scanStartBlock uint64, scanInterval time.Duration, callback func(*types.Log) error) *SimpleTxLogWatcher
构造一个新的简单tx管理结构(默认3秒钟扫描一次)
func (*SimpleTxLogWatcher) AddInterestedParams ¶
func (watcher *SimpleTxLogWatcher) AddInterestedParams(address string, topic0 string)
添加关注的from address
func (*SimpleTxLogWatcher) Callback ¶
func (watcher *SimpleTxLogWatcher) Callback(tx *types.Log) error
tx回调处理方法
func (*SimpleTxLogWatcher) GetEthClients ¶
func (watcher *SimpleTxLogWatcher) GetEthClients() ([]*ethclient.Client, error)
func (*SimpleTxLogWatcher) GetInterestedAddresses ¶ added in v0.0.10
func (watcher *SimpleTxLogWatcher) GetInterestedAddresses() []common.Address
func (*SimpleTxLogWatcher) GetPerScanBlockCount ¶ added in v0.0.10
func (watcher *SimpleTxLogWatcher) GetPerScanBlockCount() uint64
func (*SimpleTxLogWatcher) GetScanInterval ¶
func (watcher *SimpleTxLogWatcher) GetScanInterval() time.Duration
获取区块扫描间隔
func (*SimpleTxLogWatcher) GetScanStartBlock ¶
func (watcher *SimpleTxLogWatcher) GetScanStartBlock() uint64
func (*SimpleTxLogWatcher) IsInterestedLog ¶
func (watcher *SimpleTxLogWatcher) IsInterestedLog(addr string, topic0 string) bool
func (*SimpleTxLogWatcher) SetInfuraSecrets ¶
func (watcher *SimpleTxLogWatcher) SetInfuraSecrets(secrets []string)
func (*SimpleTxLogWatcher) SetPerScanBlockCount ¶ added in v0.0.10
func (watcher *SimpleTxLogWatcher) SetPerScanBlockCount(perScanBlockCount uint64)
func (*SimpleTxLogWatcher) SetScanInterval ¶
func (watcher *SimpleTxLogWatcher) SetScanInterval(interval time.Duration)
设置区块扫描间隔
type TxlogWatcher ¶
type TxlogWatcher interface { //获取开始扫描的区块号 GetScanStartBlock() uint64 //获取节点地址 GetEthClients() ([]*ethclient.Client, error) //获取单次扫描区块数 GetPerScanBlockCount() uint64 GetInterestedAddresses() []common.Address //是否是需要解析的tx IsInterestedLog(address string, topic0 string) bool //tx log回调处理方法 Callback(txlog *types.Log) error //获取扫描间隔 GetScanInterval() time.Duration }
Click to show internal directories.
Click to hide internal directories.