ethutil

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

Concurrent_searchLog

concurrent_searchLog在go-ethereum中client.QueryFilter的基础上优化performance,主要优点如下:

  • 能够通过调用一个方法获取2k个以上的区块信息
  • 并发发送HTTP请求,性能为原本API的4倍左右
  • 使用控制反转优化因为频繁调用HTTP请求而出现的网络拥塞,极大降低了网络拥塞的可能性
  • 保证并发HTTP请求的原子性,在网络不会出现问题的情况下,一定能获取全部的日志

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() *ethClient

func Init added in v1.3.0

func Init(url string) error

func NewEthClient added in v1.3.0

func NewEthClient(url string) (*ethClient, error)

Types

type FilterFunc

type FilterFunc func(log []types.Log, work *workUnit) error

type LogsStream

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

func NewDefaultLogsStream added in v1.3.0

func NewDefaultLogsStream(log []types.Log) (*LogsStream, error)

func NewLogsStream

func NewLogsStream(log []types.Log, client *ethClient) *LogsStream

func (*LogsStream) Done

func (l *LogsStream) Done() (result []types.Log, err error)

func (*LogsStream) FilterLog

func (l *LogsStream) FilterLog(filter FilterFunc) *LogsStream

func (*LogsStream) TxFromAndTo added in v1.3.0

func (l *LogsStream) TxFromAndTo(from []common.Address) *LogsStream

type Timeout added in v1.3.0

type Timeout time.Duration
var (
	// TimeLess the same as context.Background(),represent has no timeout limit
	TimeLess Timeout = 1<<63 - 1
)

Jump to

Keyboard shortcuts

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