{"modulePath":"github.com/GoPlugin/pluginV2","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package evm\n\n## Variables\n\n```go\nvar ErrNoChains = errors.New(\"no EVM chains loaded\")\n```\nErrNoChains indicates that no EVM chains have been started\n\n## Functions\n\n```go\nfunc ClobberDBFromEnv(db *sqlx.DB, config LegacyEthNodeConfig, lggr logger.Logger) error\n```\n\n```go\nfunc NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) types.ORM\n```\nNewORM returns a new EVM ORM\n\n```go\nfunc SetupNodes(db *sqlx.DB, cfg LegacyEthNodeConfig, lggr logger.Logger) (err error)\n```\nSetupNodes 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\u0026ct\\_workflow=all](https://app.shortcut.com/chainlinklabs/epic/33587/overhaul-config?cf_workflow=500000005\u0026ct_workflow=all)\n\n## Types\n\n```go\ntype Chain interface {\n\tservices.ServiceCtx\n\tID() *big.Int\n\tClient() evmclient.Client\n\tConfig() evmconfig.ChainScopedConfig\n\tUpdateConfig(*types.ChainCfg)\n\tLogBroadcaster() log.Broadcaster\n\tHeadBroadcaster() httypes.HeadBroadcaster\n\tTxManager() txmgr.TxManager\n\tHeadTracker() httypes.HeadTracker\n\tLogger() logger.Logger\n\tBalanceMonitor() monitor.BalanceMonitor\n\tLogPoller() logpoller.LogPoller\n}\n```\n\n```go\ntype ChainConfigUpdater func(*types.ChainCfg) error\n```\n\n```go\nfunc UpdateKeySpecificMaxGasPrice(addr common.Address, maxGasPriceWei *assets.Wei) ChainConfigUpdater\n```\n\n```go\ntype ChainSet interface {\n\tservices.ServiceCtx\n\tGet(id *big.Int) (Chain, error)\n\n\tShow(id utils.Big) (types.DBChain, error)\n\n\tDefault() (Chain, error)\n\tChains() []Chain\n\tChainCount() int\n\n\tORM() types.ORM\n\n\tAdd(ctx context.Context, id utils.Big, config *types.ChainCfg) (types.DBChain, error)\n\tRemove(id utils.Big) error\n\tIndex(offset, limit int) ([]types.DBChain, int, error)\n\tUpdateConfig(id *big.Int, updaters ...ChainConfigUpdater) error\n\tConfigure(ctx context.Context, id utils.Big, enabled bool, config *types.ChainCfg) (types.DBChain, error)\n\n\t// GetNodes et al retrieves Nodes from the ORM and adds additional state info\n\tGetNodes(ctx context.Context, offset, limit int) (nodes []types.Node, count int, err error)\n\tGetNodesForChain(ctx context.Context, chainID utils.Big, offset, limit int) (nodes []types.Node, count int, err error)\n\tGetNodesByChainIDs(ctx context.Context, chainIDs []utils.Big) (nodes []types.Node, err error)\n\n\tCreateNode(ctx context.Context, data types.Node) (types.Node, error)\n\tDeleteNode(ctx context.Context, id int32) error\n}\n```\n\n```go\nfunc LoadChainSet(ctx context.Context, opts ChainSetOpts) (ChainSet, error)\n```\n[https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config](https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config)\n\n```go\nfunc NewDBChainSet(ctx context.Context, opts ChainSetOpts, dbchains []types.DBChain, nodes map[string][]types.Node) (ChainSet, error)\n```\nNewDBChainSet returns a new ChainSet from legacy configuration. [https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config](https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config)\n\n```go\nfunc NewTOMLChainSet(ctx context.Context, opts ChainSetOpts, chains []*v2.EVMConfig) (ChainSet, error)\n```\nNewTOMLChainSet returns a new ChainSet from TOML configuration.\n\n```go\ntype ChainSetOpts struct {\n\tConfig           config.GeneralConfig\n\tLogger           logger.Logger\n\tDB               *sqlx.DB\n\tKeyStore         keystore.Eth\n\tEventBroadcaster pg.EventBroadcaster\n\tORM              types.ORM\n\tMailMon          *utils.MailboxMonitor\n\n\t// Gen-functions are useful for dependency injection by tests\n\tGenEthClient      func(*big.Int) client.Client\n\tGenLogBroadcaster func(*big.Int) log.Broadcaster\n\tGenLogPoller      func(*big.Int) logpoller.LogPoller\n\tGenHeadTracker    func(*big.Int, httypes.HeadBroadcaster) httypes.HeadTracker\n\tGenTxManager      func(*big.Int) txmgr.TxManager\n}\n```\n\n```go\ntype LegacyEthNodeConfig interface {\n\tDefaultChainID() *big.Int\n\tEthereumURL() string\n\tEthereumHTTPURL() *url.URL\n\tEthereumSecondaryURLs() []url.URL\n\tEthereumNodes() string\n\tpg.QConfig\n}\n```\n\n","path":"github.com/GoPlugin/pluginV2/core/chains/evm","name":"evm","synopsis":"","isRedistributable":true}
