ethereum

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UP   = 1
	DOWN = 0
)

Variables

This section is empty.

Functions

func NewBridgeClient

func NewBridgeClient(contractAddress ethCommon.Address, ethClient *ethclient.Client) (bridgeClientI, error)

func NewClient

func NewClient(cfg *config.ChainConfig) chain.IClient

NewClient initializes Client and returns the interface to chain.IClient

func NewEthClient

func NewEthClient(rpcEndPoint string) ethClientI

Types

type Client

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

func (*Client) FeedPacket

func (cl *Client) FeedPacket(ctx context.Context, ch chan<- *chain.Packet)

FeedPacket spawsn few goroutines and starts to poll ethereum on regular interval. It uses filter logs method that specifically filters particular packet related logs. The range of block numbers to filter logs is set in defaultHeightDifferenceForFilterLogs. It parses the logs and if packet has destination chainID that this attestor supports then it will be send to the channel ch.

func (*Client) GetMissedPacket

func (cl *Client) GetMissedPacket(
	ctx context.Context, missedPkt *chain.MissedPacket) (
	*chain.Packet, error)

GetMissedPacket retrieves packet from source chain and returns it.

func (*Client) Name

func (cl *Client) Name() string

func (*Client) SetMetrics

func (cl *Client) SetMetrics(metrics *metrics.PrometheusMetrics)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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