Documentation ¶
Index ¶
- Variables
- func FilterRelayersByType(network relay.Network) func(id relay.ID) bool
- type Application
- type ApplicationOpts
- type ChainStatuser
- type ChainlinkApplication
- func (app *ChainlinkApplication) AddJobV2(ctx context.Context, j *job.Job) error
- func (app *ChainlinkApplication) AuthenticationProvider() sessions.AuthenticationProvider
- func (app *ChainlinkApplication) BasicAdminUsersORM() sessions.BasicAdminUsersORM
- func (app *ChainlinkApplication) BridgeORM() bridges.ORM
- func (app *ChainlinkApplication) DeleteJob(ctx context.Context, jobID int32) error
- func (app *ChainlinkApplication) EVMORM() evmtypes.Configs
- func (app *ChainlinkApplication) GetAuditLogger() audit.AuditLogger
- func (app *ChainlinkApplication) GetConfig() GeneralConfig
- func (app *ChainlinkApplication) GetEventBroadcaster() pg.EventBroadcaster
- func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
- func (app *ChainlinkApplication) GetHealthChecker() services.Checker
- func (app *ChainlinkApplication) GetKeyStore() keystore.Master
- func (app *ChainlinkApplication) GetLogger() logger.SugaredLogger
- func (app *ChainlinkApplication) GetLoopRegistry() *plugins.LoopRegistry
- func (app *ChainlinkApplication) GetRelayers() RelayerChainInteroperators
- func (app *ChainlinkApplication) GetSqlxDB() *sqlx.DB
- func (app *ChainlinkApplication) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration
- func (app *ChainlinkApplication) ID() uuid.UUID
- func (app *ChainlinkApplication) JobORM() job.ORM
- func (app *ChainlinkApplication) JobSpawner() job.Spawner
- func (app *ChainlinkApplication) PipelineORM() pipeline.ORM
- func (app *ChainlinkApplication) ReplayFromBlock(chainID *big.Int, number uint64, forceBroadcast bool) error
- func (app *ChainlinkApplication) ResumeJobV2(ctx context.Context, taskID uuid.UUID, result pipeline.Result) error
- func (app *ChainlinkApplication) RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error)
- func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, ...) (int64, error)
- func (app *ChainlinkApplication) SecretGenerator() SecretGenerator
- func (app *ChainlinkApplication) SetLogLevel(lvl zapcore.Level) error
- func (app *ChainlinkApplication) Start(ctx context.Context) error
- func (app *ChainlinkApplication) Stop() error
- func (app *ChainlinkApplication) StopIfStarted() error
- func (app *ChainlinkApplication) TxmStorageService() txmgr.EvmTxStore
- func (app *ChainlinkApplication) WakeSessionReaper()
- type ChainsNodesStatuser
- type Config
- type CoreRelayerChainInitFunc
- type CoreRelayerChainInteroperators
- func (rs *CoreRelayerChainInteroperators) ChainStatus(ctx context.Context, id relay.ID) (types.ChainStatus, error)
- func (rs *CoreRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]types.ChainStatus, int, error)
- func (rs *CoreRelayerChainInteroperators) Get(id relay.ID) (loop.Relayer, error)
- func (rs *CoreRelayerChainInteroperators) LegacyEVMChains() legacyevm.LegacyChainContainer
- func (rs *CoreRelayerChainInteroperators) List(filter FilterFn) RelayerChainInteroperators
- func (rs *CoreRelayerChainInteroperators) Node(ctx context.Context, name string) (types.NodeStatus, error)
- func (rs *CoreRelayerChainInteroperators) NodeStatuses(ctx context.Context, offset, limit int, relayerIDs ...relay.ID) (nodes []types.NodeStatus, count int, err error)
- func (rs *CoreRelayerChainInteroperators) Services() (s []services.ServiceCtx)
- func (rs *CoreRelayerChainInteroperators) Slice() []loop.Relayer
- type EVMFactoryConfig
- type FilePersistedSecretGenerator
- type FilterFn
- type GeneralConfig
- type GeneralConfigOpts
- type LegacyChainer
- type LoopRelayerStorer
- type NodesStatuser
- type RelayerChainInteroperators
- type RelayerFactory
- type SecretGenerator
- type Secrets
Constants ¶
This section is empty.
Variables ¶
var AllRelayers = func(id relay.ID) bool { return true }
var ErrInvalidSecrets = errors.New("invalid secrets")
var ErrNoSuchRelayer = errors.New("relayer does not exist")
Functions ¶
Types ¶
type Application ¶
type Application interface { Start(ctx context.Context) error Stop() error GetLogger() logger.SugaredLogger GetAuditLogger() audit.AuditLogger GetHealthChecker() services.Checker GetSqlxDB() *sqlx.DB GetConfig() GeneralConfig SetLogLevel(lvl zapcore.Level) error GetKeyStore() keystore.Master WakeSessionReaper() GetWebAuthnConfiguration() sessions.WebAuthnConfiguration GetExternalInitiatorManager() webhook.ExternalInitiatorManager GetRelayers() RelayerChainInteroperators GetLoopRegistry() *plugins.LoopRegistry // V2 Jobs (TOML specified) JobSpawner() job.Spawner JobORM() job.ORM EVMORM() evmtypes.Configs PipelineORM() pipeline.ORM BridgeORM() bridges.ORM BasicAdminUsersORM() sessions.BasicAdminUsersORM AuthenticationProvider() sessions.AuthenticationProvider TxmStorageService() txmgr.EvmTxStore AddJobV2(ctx context.Context, job *job.Job) error DeleteJob(ctx context.Context, jobID int32) error RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error) ResumeJobV2(ctx context.Context, taskID uuid.UUID, result pipeline.Result) error // Testing only RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error) // ReplayFromBlock replays logs from on or after the given block number. If forceBroadcast is // set to true, consumers will reprocess data even if it has already been processed. ReplayFromBlock(chainID *big.Int, number uint64, forceBroadcast bool) error // ID is unique to this particular application instance ID() uuid.UUID SecretGenerator() SecretGenerator }
Application implements the common functions used in the core node.
func NewApplication ¶
func NewApplication(opts ApplicationOpts) (Application, error)
NewApplication initializes a new store if one is not already present at the configured root directory (default: ~/.chainlink), the logger at the same directory and returns the Application to be used by the node. TODO: Inject more dependencies here to save booting up useless stuff in tests
type ApplicationOpts ¶
type ApplicationOpts struct { Config GeneralConfig Logger logger.Logger EventBroadcaster pg.EventBroadcaster MailMon *mailbox.Monitor SqlxDB *sqlx.DB KeyStore keystore.Master RelayerChainInteroperators *CoreRelayerChainInteroperators AuditLogger audit.AuditLogger CloseLogger func() error ExternalInitiatorManager webhook.ExternalInitiatorManager Version string RestrictedHTTPClient *http.Client UnrestrictedHTTPClient *http.Client SecretGenerator SecretGenerator LoopRegistry *plugins.LoopRegistry GRPCOpts loop.GRPCOpts }
type ChainStatuser ¶
type ChainlinkApplication ¶
type ChainlinkApplication struct { EventBroadcaster pg.EventBroadcaster Config GeneralConfig KeyStore keystore.Master ExternalInitiatorManager webhook.ExternalInitiatorManager SessionReaper *utils.SleeperTask HealthChecker services.Checker Nurse *services.Nurse AuditLogger audit.AuditLogger // contains filtered or unexported fields }
ChainlinkApplication contains fields for the JobSubscriber, Scheduler, and Store. The JobSubscriber and Scheduler are also available in the services package, but the Store has its own package.
func (*ChainlinkApplication) AuthenticationProvider ¶
func (app *ChainlinkApplication) AuthenticationProvider() sessions.AuthenticationProvider
func (*ChainlinkApplication) BasicAdminUsersORM ¶
func (app *ChainlinkApplication) BasicAdminUsersORM() sessions.BasicAdminUsersORM
func (*ChainlinkApplication) BridgeORM ¶
func (app *ChainlinkApplication) BridgeORM() bridges.ORM
func (*ChainlinkApplication) DeleteJob ¶
func (app *ChainlinkApplication) DeleteJob(ctx context.Context, jobID int32) error
func (*ChainlinkApplication) EVMORM ¶
func (app *ChainlinkApplication) EVMORM() evmtypes.Configs
TODO BCF-2516 remove this all together remove EVM specifics
func (*ChainlinkApplication) GetAuditLogger ¶
func (app *ChainlinkApplication) GetAuditLogger() audit.AuditLogger
func (*ChainlinkApplication) GetConfig ¶
func (app *ChainlinkApplication) GetConfig() GeneralConfig
func (*ChainlinkApplication) GetEventBroadcaster ¶
func (app *ChainlinkApplication) GetEventBroadcaster() pg.EventBroadcaster
func (*ChainlinkApplication) GetExternalInitiatorManager ¶
func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
func (*ChainlinkApplication) GetHealthChecker ¶
func (app *ChainlinkApplication) GetHealthChecker() services.Checker
func (*ChainlinkApplication) GetKeyStore ¶
func (app *ChainlinkApplication) GetKeyStore() keystore.Master
func (*ChainlinkApplication) GetLogger ¶
func (app *ChainlinkApplication) GetLogger() logger.SugaredLogger
func (*ChainlinkApplication) GetLoopRegistry ¶
func (app *ChainlinkApplication) GetLoopRegistry() *plugins.LoopRegistry
func (*ChainlinkApplication) GetRelayers ¶
func (app *ChainlinkApplication) GetRelayers() RelayerChainInteroperators
func (*ChainlinkApplication) GetSqlxDB ¶
func (app *ChainlinkApplication) GetSqlxDB() *sqlx.DB
func (*ChainlinkApplication) GetWebAuthnConfiguration ¶
func (app *ChainlinkApplication) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration
Returns the configuration to use for creating and authenticating new WebAuthn credentials
func (*ChainlinkApplication) ID ¶
func (app *ChainlinkApplication) ID() uuid.UUID
func (*ChainlinkApplication) JobORM ¶
func (app *ChainlinkApplication) JobORM() job.ORM
func (*ChainlinkApplication) JobSpawner ¶
func (app *ChainlinkApplication) JobSpawner() job.Spawner
func (*ChainlinkApplication) PipelineORM ¶
func (app *ChainlinkApplication) PipelineORM() pipeline.ORM
func (*ChainlinkApplication) ReplayFromBlock ¶
func (app *ChainlinkApplication) ReplayFromBlock(chainID *big.Int, number uint64, forceBroadcast bool) error
ReplayFromBlock implements the Application interface.
func (*ChainlinkApplication) ResumeJobV2 ¶
func (*ChainlinkApplication) RunJobV2 ¶
func (app *ChainlinkApplication) RunJobV2( ctx context.Context, jobID int32, meta map[string]interface{}, ) (int64, error)
Only used for local testing, not supported by the UI.
func (*ChainlinkApplication) RunWebhookJobV2 ¶
func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error)
func (*ChainlinkApplication) SecretGenerator ¶
func (app *ChainlinkApplication) SecretGenerator() SecretGenerator
func (*ChainlinkApplication) SetLogLevel ¶
func (app *ChainlinkApplication) SetLogLevel(lvl zapcore.Level) error
func (*ChainlinkApplication) Start ¶
func (app *ChainlinkApplication) Start(ctx context.Context) error
Start all necessary services. If successful, nil will be returned. Start sequence is aborted if the context gets cancelled.
func (*ChainlinkApplication) Stop ¶
func (app *ChainlinkApplication) Stop() error
Stop allows the application to exit by halting schedules, closing logs, and closing the DB connection.
func (*ChainlinkApplication) StopIfStarted ¶
func (app *ChainlinkApplication) StopIfStarted() error
func (*ChainlinkApplication) TxmStorageService ¶
func (app *ChainlinkApplication) TxmStorageService() txmgr.EvmTxStore
func (*ChainlinkApplication) WakeSessionReaper ¶
func (app *ChainlinkApplication) WakeSessionReaper()
WakeSessionReaper wakes up the reaper to do its reaping.
type ChainsNodesStatuser ¶
type ChainsNodesStatuser interface { ChainStatuser NodesStatuser }
ChainsNodesStatuser report statuses about chains and nodes
type Config ¶
type Config struct { toml.Core EVM evmcfg.EVMConfigs `toml:",omitempty"` }
Config is the root type used for TOML configuration.
See docs at /docs/CONFIG.md generated via config.GenerateDocs from /internal/config/docs.toml
When adding a new field:
- consider including a unit suffix with the field name
- TOML is limited to int64/float64, so fields requiring greater range/precision must use non-standard types implementing encoding.TextMarshaler/TextUnmarshaler, like big.Big and decimal.Decimal
- std lib types that don't implement encoding.TextMarshaler/TextUnmarshaler (time.Duration, url.URL, big.Int) won't work as expected, and require wrapper types. See models.Duration, models.URL, big.Big.
func (*Config) TOMLString ¶
TOMLString returns a TOML encoded string.
type CoreRelayerChainInitFunc ¶
type CoreRelayerChainInitFunc func(op *CoreRelayerChainInteroperators) error
CoreRelayerChainInitFunc is a hook in the constructor to create relayers from a factory.
func InitEVM ¶
func InitEVM(ctx context.Context, factory RelayerFactory, config EVMFactoryConfig) CoreRelayerChainInitFunc
InitEVM is a option for instantiating evm relayers
type CoreRelayerChainInteroperators ¶
type CoreRelayerChainInteroperators struct {
// contains filtered or unexported fields
}
CoreRelayerChainInteroperators implements RelayerChainInteroperators as needed for the core erinaceus.Application
func NewCoreRelayerChainInteroperators ¶
func NewCoreRelayerChainInteroperators(initFuncs ...CoreRelayerChainInitFunc) (*CoreRelayerChainInteroperators, error)
func (*CoreRelayerChainInteroperators) ChainStatus ¶
func (rs *CoreRelayerChainInteroperators) ChainStatus(ctx context.Context, id relay.ID) (types.ChainStatus, error)
ChainStatus gets [types.ChainStatus]
func (*CoreRelayerChainInteroperators) ChainStatuses ¶
func (rs *CoreRelayerChainInteroperators) ChainStatuses(ctx context.Context, offset, limit int) ([]types.ChainStatus, int, error)
func (*CoreRelayerChainInteroperators) Get ¶
Get a loop.Relayer by id
func (*CoreRelayerChainInteroperators) LegacyEVMChains ¶
func (rs *CoreRelayerChainInteroperators) LegacyEVMChains() legacyevm.LegacyChainContainer
LegacyEVMChains returns a container with all the evm chains TODO BCF-2511
func (*CoreRelayerChainInteroperators) List ¶
func (rs *CoreRelayerChainInteroperators) List(filter FilterFn) RelayerChainInteroperators
List returns all the RelayerChainInteroperators that match the FilterFn. A typical usage pattern to use [List] with [FilterByType] to obtain a set of RelayerChainInteroperators for a given chain
func (*CoreRelayerChainInteroperators) Node ¶
func (rs *CoreRelayerChainInteroperators) Node(ctx context.Context, name string) (types.NodeStatus, error)
func (*CoreRelayerChainInteroperators) NodeStatuses ¶
func (rs *CoreRelayerChainInteroperators) NodeStatuses(ctx context.Context, offset, limit int, relayerIDs ...relay.ID) (nodes []types.NodeStatus, count int, err error)
ids must be a string representation of relay.Identifier ids are a filter; if none are specified, all are returned.
func (*CoreRelayerChainInteroperators) Services ¶
func (rs *CoreRelayerChainInteroperators) Services() (s []services.ServiceCtx)
func (*CoreRelayerChainInteroperators) Slice ¶
func (rs *CoreRelayerChainInteroperators) Slice() []loop.Relayer
Returns a slice of loop.Relayer. A typically usage pattern to is use [List(criteria)].Slice() for range based operations
type EVMFactoryConfig ¶
type EVMFactoryConfig struct { legacyevm.ChainOpts evmrelay.CSAETHKeystore }
type FilePersistedSecretGenerator ¶
type FilePersistedSecretGenerator struct{}
type GeneralConfig ¶
type GeneralConfig interface { config.AppConfig toml.HasEVMConfigs // ConfigTOML returns both the user provided and effective configuration as TOML. ConfigTOML() (user, effective string) }
type GeneralConfigOpts ¶
type GeneralConfigOpts struct { ConfigStrings []string SecretsStrings []string Config Secrets // OverrideFn is a *test-only* hook to override effective values. OverrideFn func(*Config, *Secrets) SkipEnv bool }
GeneralConfigOpts holds configuration options for creating a coreconfig.GeneralConfig via New().
See ParseTOML to initilialize Config and Secrets from TOML.
func (GeneralConfigOpts) New ¶
func (o GeneralConfigOpts) New() (GeneralConfig, error)
New returns a GeneralConfig for the given options.
type LegacyChainer ¶
type LegacyChainer interface {
LegacyEVMChains() legacyevm.LegacyChainContainer
}
LegacyChainer is an interface for getting legacy chains This will be deprecated/removed when products depend only on the relayer interface.
type LoopRelayerStorer ¶
LoopRelayerStorer is key-value like interface for storing and retrieving loop.Relayer
type NodesStatuser ¶
type NodesStatuser interface {
NodeStatuses(ctx context.Context, offset, limit int, relayIDs ...relay.ID) (nodes []types.NodeStatus, count int, err error)
}
NodesStatuser is an interface for node configuration and state. TODO BCF-2440, BCF-2511 may need Node(ctx,name) to get a node status by name
type RelayerChainInteroperators ¶
type RelayerChainInteroperators interface { Services() []services.ServiceCtx List(filter FilterFn) RelayerChainInteroperators LoopRelayerStorer LegacyChainer ChainsNodesStatuser }
RelayerChainInteroperators encapsulates relayers and chains and is the primary entry point for the node to access relayers, get legacy chains associated to a relayer and get status about the chains and nodes
type RelayerFactory ¶
func (*RelayerFactory) NewEVM ¶
func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (map[relay.ID]evmrelay.LoopRelayAdapter, error)
type SecretGenerator ¶
SecretGenerator is the interface for objects that generate a secret used to sign or encrypt.
type Secrets ¶
func (*Secrets) TOMLString ¶
TOMLString returns a TOML encoded string with secret values redacted.
func (*Secrets) Validate ¶
Validate validates every consitutent secret and return an accumulated error
func (*Secrets) ValidateDB ¶
ValidateDB only validates the encompassed DatabaseSecret
Source Files ¶
- application.go
- config.go
- config_audit_logger.go
- config_auto_pprof.go
- config_database.go
- config_feature.go
- config_general.go
- config_general_secrets.go
- config_general_state.go
- config_insecure.go
- config_job_pipeline.go
- config_log.go
- config_password.go
- config_prometheus.go
- config_pyroscope.go
- config_sentry.go
- config_threshold.go
- config_tracing.go
- config_web_server.go
- relayer_chain_interoperators.go
- relayer_factory.go
- secret_generator.go
- types.go