ethlogscanner

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

README

ethlogscanner

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkSizeUpdated

type ChunkSizeUpdated struct {
	Previous int
	Updated  int
	// contains filtered or unexported fields
}

func (ChunkSizeUpdated) Time

func (n ChunkSizeUpdated) Time() time.Time

type Cursor

type Cursor uint64

It also supports JSON serialization to provide a semantic representation of the data.

func MakeCursor

func MakeCursor(blockNum uint64, txIndex, logIndex uint) Cursor

MakeCursor returns a Cursor for a specific log location on the blockchain.

func (Cursor) BlockNum

func (l Cursor) BlockNum() uint64

func (Cursor) LogIndex

func (l Cursor) LogIndex() uint

func (Cursor) MarshalJSON

func (c Cursor) MarshalJSON() ([]byte, error)

func (Cursor) Next

func (c Cursor) Next() Cursor

func (Cursor) String

func (c Cursor) String() string

func (Cursor) TxIndex

func (l Cursor) TxIndex() uint

func (*Cursor) UnmarshalJSON

func (c *Cursor) UnmarshalJSON(b []byte) error

type CursorUpdated

type CursorUpdated struct {
	Next Cursor
	// contains filtered or unexported fields
}

func (CursorUpdated) Time

func (n CursorUpdated) Time() time.Time

type FilterCompleted

type FilterCompleted struct {
	FilterStarted

	Duration     time.Duration
	NumberOfLogs int

	HasErr bool
}

func (FilterCompleted) Time

func (n FilterCompleted) Time() time.Time

type FilterStarted

type FilterStarted struct {
	From uint64
	To   uint64

	ChunkSize int
	// contains filtered or unexported fields
}

func (FilterStarted) Time

func (n FilterStarted) Time() time.Time

type Log

type Log types.Log

func (*Log) Cursor

func (l *Log) Cursor() Cursor

type Notification

type Notification interface {
	Time() time.Time
	// contains filtered or unexported methods
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithFilter

func WithFilter(addresses []common.Address, topics [][]common.Hash) Option

func WithInitialChunkSize

func WithInitialChunkSize(initialChunkSize int) Option

func WithMaxChunkSize

func WithMaxChunkSize(maxChunkSize int) Option

func WithRetryFilter

func WithRetryFilter(minInterval, maxInterval, maxElapsed time.Duration) Option

func WithRetryHead

func WithRetryHead(minInterval, maxInterval, maxElapsed time.Duration) Option

func WithStart

func WithStart(start Cursor) Option

func WithStayBehindToHead

func WithStayBehindToHead(stayBehindToHead int) Option

func WithThresholdChunkAdjByDur

func WithThresholdChunkAdjByDur(adjThresholdDur time.Duration) Option

func WithThresholdChunkAdjByLogs

func WithThresholdChunkAdjByLogs(adjThresholdLogs int) Option

type Scanner

type Scanner interface {
	io.Closer

	Err() <-chan error
	Log() <-chan *Log
	Done() <-chan error
	Notify() <-chan Notification

	Next() Cursor
}

func Scan

func Scan(ctx context.Context, ethClient *ethclient.Client, options ...Option) (Scanner, error)

Jump to

Keyboard shortcuts

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