ethereum

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerTag = "ETHEREUM_TELEPORT_LISTENER"
View Source
const SignatureKey = "ethereum"
View Source
const TeleportEventType = "teleport_evm"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.5.0

type Client interface {
	BlockNumber(ctx context.Context) (uint64, error)
	FilterLogs(ctx context.Context, q geth.FilterQuery) ([]types.Log, error)
}

Client is a Ethereum compatible client.

type Signer

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

Signer signs Ethereum logger messages using Ethereum signature.

func NewSigner

func NewSigner(signer ethereum.Signer, types []string) *Signer

NewSigner returns a new instance of the Signer struct.

func (*Signer) Sign

func (l *Signer) Sign(event *messages.Event) (bool, error)

Sign implements the Signer interface.

type TeleportListener added in v0.5.0

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

TeleportListener listens to TeleportGUID events on Ethereum compatible blockchains.

https://github.com/makerdao/dss-teleport

func NewTeleportListener added in v0.5.0

func NewTeleportListener(cfg TeleportListenerConfig) *TeleportListener

NewTeleportListener returns a new instance of the TeleportListener struct.

func (*TeleportListener) Events added in v0.5.0

func (tl *TeleportListener) Events() chan *messages.Event

Events implements the publisher.Listener interface.

func (*TeleportListener) Start added in v0.5.0

func (tl *TeleportListener) Start(ctx context.Context) error

Start implements the publisher.Listener interface.

type TeleportListenerConfig added in v0.5.0

type TeleportListenerConfig struct {
	// Client is an instance of Ethereum RPC client.
	Client Client
	// Addresses is a list of contracts from which logs will be fetched.
	Addresses []ethereum.Address
	// Interval specifies how often listener should check for new logs.
	Interval time.Duration
	// BlocksDelta is a list of distances between the latest block on the
	// blockchain and blocks from which logs are to be taken. The purpose of
	// this field is to ensure that older events are resent from time to time.
	// This is to allow other clients on the Oracle network to restore its
	// state and ensure that no events are missed in the event of an Oracle
	// failure.
	BlocksDelta []int
	// BlocksLimit specifies how from many blocks logs can be fetched at once.
	BlocksLimit int
	// Logger is a current logger interface used by the TeleportListener.
	// The Logger is used to monitor asynchronous processes.
	Logger log.Logger
}

TeleportListenerConfig contains a configuration options for NewTeleportListener.

Jump to

Keyboard shortcuts

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