log

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenerJobID added in v0.10.3

func ListenerJobID(listener Listener) interface{}

ListenerJobID returns the appropriate job ID for a listener

func NewBroadcaster

func NewBroadcaster(orm ORM, ethClient eth.Client, config Config) *broadcaster

NewBroadcaster creates a new instance of the broadcaster

func NewORM added in v0.10.3

func NewORM(db *gorm.DB) *orm

Types

type AbigenContract added in v0.10.3

type AbigenContract interface {
	Address() common.Address
	ParseLog(log types.Log) (generated.AbigenLog, error)
}

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(listener Listener, opts ListenerOpts) (connected bool, unsubscribe func())
}

The Broadcaster manages log subscription requests for the Chainlink node. Instead of creating a new 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.

type Config added in v0.10.3

type Config interface {
	BlockBackfillDepth() uint64
	TriggerFallbackDBPollInterval() time.Duration
}

type Listener

type Listener interface {
	OnConnect()
	OnDisconnect()
	HandleLog(b Broadcast)
	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.

type ListenerOpts added in v0.10.3

type ListenerOpts struct {
	Contract AbigenContract
	Logs     []generated.AbigenLog
}

type ORM added in v0.10.3

type ORM interface {
	WasBroadcastConsumed(blockHash common.Hash, logIndex uint, jobID interface{}) (bool, error)
	MarkBroadcastConsumed(blockHash common.Hash, blockNumber uint64, logIndex uint, jobID interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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