log

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast interface {
	DecodedLog() interface{}
	RawLog() types.Log
	SetDecodedLog(interface{})
	WasAlreadyConsumed() (bool, error)
	MarkConsumed() error
}

The Broadcast type wraps a models.Log but provides additional functionality for determining whether or not the log has been consumed and for marking the log as consumed

type Broadcaster

type Broadcaster interface {
	utils.DependentAwaiter
	Start() error
	Stop() error
	Register(address common.Address, listener Listener) (connected bool)
	Unregister(address common.Address, listener Listener)
}

The Broadcaster manages log subscription requests for the Chainlink node. Instead of creating a new websocket subscription for each request, it multiplexes all subscriptions to all of the relevant contracts over a single connection and forwards the logs to the relevant subscribers.

func NewBroadcaster

func NewBroadcaster(ethClient eth.Client, orm ormInterface, backfillDepth uint64) Broadcaster

NewBroadcaster creates a new instance of the broadcaster

type Listener

type Listener interface {
	OnConnect()
	OnDisconnect()
	HandleLog(lb Broadcast, err error)
	JobID() models.JobID
	JobIDV2() int32
	IsV2Job() bool
}

The Listener responds to log events through HandleLog, and contains setup/tear-down callbacks in the On* functions.

func NewDecodingLogListener

func NewDecodingLogListener(codec eth.ContractCodec, nativeLogTypes map[common.Hash]interface{}, innerListener Listener) Listener

NewDecodingLogListener creates a new decodingLogListener

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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