evmsync

package
v0.10.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventSyncer = &globalListenerManager{
	listeners: make(map[string]*listenerInfo),
}

EventSyncer is the singleton that is responsible for syncing events from Ethereum.

View Source
var StatePoller = &statePoller{}

StatePoller is the global instance of the state poller extension, which allows polling for state on Ethereum. Unlike normal listeners (which are registered in init), StatePoller allows registration to be performed on-demand as part of the consensus process. It also provides access to an EVM client for the target chain, accessed via the local node's configuration.

Functions

This section is empty.

Types

type EVMEventListenerConfig

type EVMEventListenerConfig struct {
	// UniqueName is a unique name for the listener.
	// It MUST be unique from all other listeners.
	UniqueName string
	// ContractAddresses is a list of contract addresses to listen to events from.
	ContractAddresses []string
	// EventSignatures is a list of event signatures to listen to.
	// All events from any contract configured matching any of these signatures will be emitted.
	// It is optional and defaults to all events.
	EventSignatures []string
	// Chain is the chain that the listener is listening to.
	Chain chains.Chain
	// Resolve is the function that will be called the Kwil network
	// has confirmed events from Ethereum.
	Resolve ResolveFunc
}

EVMEventListenerConfig is the configuration for an EVM event listener.

type EVMPollFunc

type EVMPollFunc func(ctx context.Context, service *common.Service, eventstore listeners.EventKV, broadcast func(context.Context, []byte) error, client *ethclient.Client) (done bool)

type PollConfig

type PollConfig struct {
	// Chain is the chain to poll
	Chain chains.Chain
	// PollFunc is the function to call to poll the chain
	PollFunc EVMPollFunc
	// ResolveFunc is the function to call to resolve the state
	ResolveFunc resolutions.ResolveFunc
	// UniqueName is a unique name for the poller
	UniqueName string
}

type ResolveFunc

type ResolveFunc func(ctx context.Context, app *common.App, block *common.BlockContext, logs []ethtypes.Log) error

Directories

Path Synopsis
package chains tracks the EVM chains that are supported by the node.
package chains tracks the EVM chains that are supported by the node.

Jump to

Keyboard shortcuts

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