Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectedContract ¶
type ConnectedContract interface { eth.ContractCodec Call(result interface{}, methodName string, args ...interface{}) error SubscribeToLogs(listener LogListener) (connected bool, _ UnsubscribeFunc) }
func NewConnectedContract ¶
func NewConnectedContract( codec eth.ContractCodec, address common.Address, ethClient eth.Client, logBroadcaster LogBroadcaster, ) ConnectedContract
type LogBroadcast ¶ added in v0.8.3
type LogBroadcast interface { Log() interface{} UpdateLog(eth.RawLog) WasAlreadyConsumed() (bool, error) MarkConsumed() error }
The LogBroadcast type wraps an eth.Log but provides additional functionality for determining whether or not the log has been consumed and for marking the log as consumed
type LogBroadcaster ¶
type LogBroadcaster interface { utils.DependentAwaiter Start() Register(address common.Address, listener LogListener) (connected bool) Unregister(address common.Address, listener LogListener) Stop() }
The LogBroadcaster 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 NewLogBroadcaster ¶
NewLogBroadcaster creates a new instance of the logBroadcaster
type LogListener ¶
type LogListener interface { OnConnect() OnDisconnect() HandleLog(lb LogBroadcast, err error) JobID() *models.ID }
The LogListener 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 LogListener) LogListener
NewDecodingLogListener creates a new decodingLogListener
type ManagedSubscription ¶ added in v0.8.3
A ManagedSubscription acts as wrapper for the eth.Subscription. Specifically, the ManagedSubscription closes the log channel as soon as the unsubscribe request is made
type UnsubscribeFunc ¶
type UnsubscribeFunc func()