evm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 32 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoChains = errors.New("no EVM chains loaded")

ErrNoChains indicates that no EVM chains have been started

Functions

func ClobberDBFromEnv

func ClobberDBFromEnv(db *sqlx.DB, config LegacyEthNodeConfig, lggr logger.Logger) error

func NewORM

func NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) types.ORM

NewORM returns a new EVM ORM

func SetupNodes

func SetupNodes(db *sqlx.DB, cfg LegacyEthNodeConfig, lggr logger.Logger) (err error)

SetupNodes is a hack/shim method to allow node operators to specify multiple nodes via ENV. See: https://app.shortcut.com/chainlinklabs/epic/33587/overhaul-config?cf_workflow=500000005&ct_workflow=all

Types

type Chain

type Chain interface {
	services.ServiceCtx
	ID() *big.Int
	Client() evmclient.Client
	Config() evmconfig.ChainScopedConfig
	UpdateConfig(*types.ChainCfg)
	LogBroadcaster() log.Broadcaster
	HeadBroadcaster() httypes.HeadBroadcaster
	TxManager() txmgr.TxManager
	HeadTracker() httypes.HeadTracker
	Logger() logger.Logger
	BalanceMonitor() monitor.BalanceMonitor
	LogPoller() logpoller.LogPoller
}

type ChainConfigUpdater

type ChainConfigUpdater func(*types.ChainCfg) error

func UpdateKeySpecificMaxGasPrice

func UpdateKeySpecificMaxGasPrice(addr common.Address, maxGasPriceWei *assets.Wei) ChainConfigUpdater

type ChainSet

type ChainSet interface {
	services.ServiceCtx
	Get(id *big.Int) (Chain, error)

	Show(id utils.Big) (types.DBChain, error)

	Default() (Chain, error)
	Chains() []Chain
	ChainCount() int

	ORM() types.ORM

	Add(ctx context.Context, id utils.Big, config *types.ChainCfg) (types.DBChain, error)
	Remove(id utils.Big) error
	Index(offset, limit int) ([]types.DBChain, int, error)
	UpdateConfig(id *big.Int, updaters ...ChainConfigUpdater) error
	Configure(ctx context.Context, id utils.Big, enabled bool, config *types.ChainCfg) (types.DBChain, error)

	// GetNodes et al retrieves Nodes from the ORM and adds additional state info
	GetNodes(ctx context.Context, offset, limit int) (nodes []types.Node, count int, err error)
	GetNodesForChain(ctx context.Context, chainID utils.Big, offset, limit int) (nodes []types.Node, count int, err error)
	GetNodesByChainIDs(ctx context.Context, chainIDs []utils.Big) (nodes []types.Node, err error)

	CreateNode(ctx context.Context, data types.Node) (types.Node, error)
	DeleteNode(ctx context.Context, id int32) error
}

func NewDBChainSet

func NewDBChainSet(ctx context.Context, opts ChainSetOpts, dbchains []types.DBChain, nodes map[string][]types.Node) (ChainSet, error)

NewDBChainSet returns a new ChainSet from legacy configuration. https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config

func NewTOMLChainSet

func NewTOMLChainSet(ctx context.Context, opts ChainSetOpts, chains []*v2.EVMConfig) (ChainSet, error)

NewTOMLChainSet returns a new ChainSet from TOML configuration.

type ChainSetOpts

type ChainSetOpts struct {
	Config           config.GeneralConfig
	Logger           logger.Logger
	DB               *sqlx.DB
	KeyStore         keystore.Eth
	EventBroadcaster pg.EventBroadcaster
	ORM              types.ORM
	MailMon          *utils.MailboxMonitor

	// Gen-functions are useful for dependency injection by tests
	GenEthClient      func(*big.Int) client.Client
	GenLogBroadcaster func(*big.Int) log.Broadcaster
	GenLogPoller      func(*big.Int) logpoller.LogPoller
	GenHeadTracker    func(*big.Int, httypes.HeadBroadcaster) httypes.HeadTracker
	GenTxManager      func(*big.Int) txmgr.TxManager
}

type LegacyEthNodeConfig

type LegacyEthNodeConfig interface {
	DefaultChainID() *big.Int
	EthereumURL() string
	EthereumHTTPURL() *url.URL
	EthereumSecondaryURLs() []url.URL
	EthereumNodes() string
	pg.QConfig
}

Directories

Path Synopsis
v2
gas
cmd/arbgas command
arbgas takes a single URL argument and prints the result of three GetLegacyGas calls to the Arbitrum gas estimator.
arbgas takes a single URL argument and prints the result of three GetLegacyGas calls to the Arbitrum gas estimator.
log
Package logpoller is a service for querying EVM log data.
Package logpoller is a service for querying EVM log data.

Jump to

Keyboard shortcuts

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