ethclient

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package ethclient is a listener that listens to an Ethereum client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

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

Parameter is the interface for service parameters.

func WithAddress

func WithAddress(address string) Parameter

WithAddress sets the address of the Ethereum client.

func WithBlockDelay

func WithBlockDelay(delay uint32) Parameter

WithBlockDelay sets the number of blocks to delay before passing on to the handlers, allowing avoidance of reorgs. Ignored if block specifier is provided.

func WithBlockSpecifier added in v1.2.1

func WithBlockSpecifier(specifier string) Parameter

WithBlockSpecifier sets the specifier for the block to handle. This override block delay if supplied.

func WithBlockTriggers

func WithBlockTriggers(triggers []*handlers.BlockTrigger) Parameter

WithBlockTriggers sets the block triggers for the listener.

func WithEventTriggers

func WithEventTriggers(triggers []*handlers.EventTrigger) Parameter

WithEventTriggers sets the event triggers for the listener.

func WithInterval

func WithInterval(interval time.Duration) Parameter

WithInterval sets the interval between polls.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level.

func WithMetadataDB

func WithMetadataDB(db *pebble.DB) Parameter

WithMetadataDB sets the metadata database.

func WithMonitor

func WithMonitor(monitor metrics.Service) Parameter

WithMonitor sets the metrics monitor.

func WithTimeout

func WithTimeout(timeout time.Duration) Parameter

WithTimeout sets the timeout for requests made to the Ethereum client.

func WithTxTriggers

func WithTxTriggers(triggers []*handlers.TxTrigger) Parameter

WithTxTriggers sets the transaction triggers for the listener.

type Service

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

Service is a listener that listens to an Ethereum client.

func New

func New(ctx context.Context, params ...Parameter) (*Service, error)

New creates a new service.

Jump to

Keyboard shortcuts

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