Documentation ¶
Index ¶
- func NewGeneralConfig(configToml string, secretsToml string, context *cli.Context) (coreconfig.GeneralConfig, error)
- type Application
- type ApplicationOpts
- type ChainlinkApplication
- func (app *ChainlinkApplication) AddJobV2(ctx context.Context, j *job.Job) error
- func (app *ChainlinkApplication) BridgeORM() bridges.ORM
- func (app *ChainlinkApplication) ConfigDump(ctx context.Context) (string, error)
- func (app *ChainlinkApplication) DeleteJob(ctx context.Context, jobID int32) error
- func (app *ChainlinkApplication) EVMORM() evmtypes.ORM
- func (app *ChainlinkApplication) GetChains() Chains
- func (app *ChainlinkApplication) GetConfig() config.GeneralConfig
- func (app *ChainlinkApplication) GetEventBroadcaster() pg.EventBroadcaster
- func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
- func (app *ChainlinkApplication) GetFeedsService() feeds.Service
- func (app *ChainlinkApplication) GetHealthChecker() services.Checker
- func (app *ChainlinkApplication) GetKeyStore() keystore.Master
- func (app *ChainlinkApplication) GetLogger() logger.Logger
- 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) SessionORM() sessions.ORM
- 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) TxmORM() txmgr.ORM
- func (app *ChainlinkApplication) WakeSessionReaper()
- type Chains
- type Config
- type EVMConfig
- type EVMConfigs
- type EVMNodes
- type FilePersistedSecretGenerator
- type SecretGenerator
- type Secrets
- type SolanaConfig
- type SolanaConfigs
- type SolanaNodes
- type TerraConfig
- type TerraConfigs
- type TerraNodes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGeneralConfig ¶ added in v1.8.0
func NewGeneralConfig(configToml string, secretsToml string, context *cli.Context) (coreconfig.GeneralConfig, error)
Types ¶
type Application ¶
type Application interface { Start(ctx context.Context) error Stop() error GetLogger() logger.Logger GetHealthChecker() services.Checker GetSqlxDB() *sqlx.DB GetConfig() config.GeneralConfig // ConfigDump returns a TOML configuration from the current environment and database configuration. ConfigDump(context.Context) (string, error) SetLogLevel(lvl zapcore.Level) error GetKeyStore() keystore.Master GetEventBroadcaster() pg.EventBroadcaster WakeSessionReaper() GetWebAuthnConfiguration() sessions.WebAuthnConfiguration GetExternalInitiatorManager() webhook.ExternalInitiatorManager GetChains() Chains // V2 Jobs (TOML specified) JobSpawner() job.Spawner JobORM() job.ORM EVMORM() evmtypes.ORM PipelineORM() pipeline.ORM BridgeORM() bridges.ORM SessionORM() sessions.ORM TxmORM() txmgr.ORM 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) // Feeds GetFeedsService() feeds.Service // 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 ¶ added in v1.1.0
type ApplicationOpts struct { Config config.GeneralConfig EventBroadcaster pg.EventBroadcaster SqlxDB *sqlx.DB KeyStore keystore.Master Chains Chains Logger logger.Logger CloseLogger func() error ExternalInitiatorManager webhook.ExternalInitiatorManager Version string RestrictedHTTPClient *http.Client UnrestrictedHTTPClient *http.Client SecretGenerator SecretGenerator }
type ChainlinkApplication ¶
type ChainlinkApplication struct { Chains Chains EventBroadcaster pg.EventBroadcaster FeedsService feeds.Service Config config.GeneralConfig KeyStore keystore.Master ExternalInitiatorManager webhook.ExternalInitiatorManager SessionReaper utils.SleeperTask HealthChecker services.Checker Nurse *services.Nurse // 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) BridgeORM ¶ added in v1.1.0
func (app *ChainlinkApplication) BridgeORM() bridges.ORM
func (*ChainlinkApplication) ConfigDump ¶ added in v1.6.0
func (app *ChainlinkApplication) ConfigDump(ctx context.Context) (string, error)
func (*ChainlinkApplication) DeleteJob ¶ added in v1.0.0
func (app *ChainlinkApplication) DeleteJob(ctx context.Context, jobID int32) error
func (*ChainlinkApplication) EVMORM ¶ added in v1.0.0
func (app *ChainlinkApplication) EVMORM() evmtypes.ORM
func (*ChainlinkApplication) GetChains ¶ added in v1.2.0
func (app *ChainlinkApplication) GetChains() Chains
GetChains returns Chains.
func (*ChainlinkApplication) GetConfig ¶ added in v0.10.11
func (app *ChainlinkApplication) GetConfig() config.GeneralConfig
func (*ChainlinkApplication) GetEventBroadcaster ¶ added in v1.1.0
func (app *ChainlinkApplication) GetEventBroadcaster() pg.EventBroadcaster
func (*ChainlinkApplication) GetExternalInitiatorManager ¶ added in v0.9.10
func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
func (*ChainlinkApplication) GetFeedsService ¶ added in v0.10.8
func (app *ChainlinkApplication) GetFeedsService() feeds.Service
func (*ChainlinkApplication) GetHealthChecker ¶ added in v0.10.8
func (app *ChainlinkApplication) GetHealthChecker() services.Checker
func (*ChainlinkApplication) GetKeyStore ¶ added in v0.10.8
func (app *ChainlinkApplication) GetKeyStore() keystore.Master
func (*ChainlinkApplication) GetLogger ¶ added in v0.10.6
func (app *ChainlinkApplication) GetLogger() logger.Logger
func (*ChainlinkApplication) GetSqlxDB ¶ added in v1.1.0
func (app *ChainlinkApplication) GetSqlxDB() *sqlx.DB
func (*ChainlinkApplication) GetWebAuthnConfiguration ¶ added in v1.1.0
func (app *ChainlinkApplication) GetWebAuthnConfiguration() sessions.WebAuthnConfiguration
Returns the configuration to use for creating and authenticating new WebAuthn credentials
func (*ChainlinkApplication) ID ¶ added in v1.1.0
func (app *ChainlinkApplication) ID() uuid.UUID
func (*ChainlinkApplication) JobORM ¶ added in v0.9.9
func (app *ChainlinkApplication) JobORM() job.ORM
func (*ChainlinkApplication) JobSpawner ¶ added in v0.10.8
func (app *ChainlinkApplication) JobSpawner() job.Spawner
func (*ChainlinkApplication) PipelineORM ¶ added in v0.10.8
func (app *ChainlinkApplication) PipelineORM() pipeline.ORM
func (*ChainlinkApplication) ReplayFromBlock ¶ added in v0.10.11
func (app *ChainlinkApplication) ReplayFromBlock(chainID *big.Int, number uint64, forceBroadcast bool) error
ReplayFromBlock implements the Application interface.
func (*ChainlinkApplication) ResumeJobV2 ¶ added in v0.10.10
func (*ChainlinkApplication) RunJobV2 ¶ added in v0.9.6
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 ¶ added in v0.10.8
func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error)
func (*ChainlinkApplication) SecretGenerator ¶ added in v1.7.0
func (app *ChainlinkApplication) SecretGenerator() SecretGenerator
func (*ChainlinkApplication) SessionORM ¶ added in v1.1.0
func (app *ChainlinkApplication) SessionORM() sessions.ORM
func (*ChainlinkApplication) SetLogLevel ¶ added in v1.1.0
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 ¶ added in v0.9.9
func (app *ChainlinkApplication) StopIfStarted() error
func (*ChainlinkApplication) TxmORM ¶ added in v1.3.0
func (app *ChainlinkApplication) TxmORM() txmgr.ORM
func (*ChainlinkApplication) WakeSessionReaper ¶
func (app *ChainlinkApplication) WakeSessionReaper()
WakeSessionReaper wakes up the reaper to do its reaping.
type Chains ¶ added in v1.2.0
type Chains struct { EVM evm.ChainSet Solana solana.ChainSet // nil if disabled Terra terra.ChainSet // nil if disabled StarkNet starknet.ChainSet // nil if disabled }
Chains holds a ChainSet for each type of chain.
type Config ¶ added in v1.6.0
type Config struct { config.Core EVM EVMConfigs `toml:",omitempty"` Solana SolanaConfigs `toml:",omitempty"` Terra TerraConfigs `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 utils.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, utils.Big.
func (*Config) SetDefaults ¶ added in v1.8.0
func (c *Config) SetDefaults()
SetDefaults initializes unset fields with default values.
func (*Config) TOMLString ¶ added in v1.6.0
TOMLString returns a pretty-printed TOML encoded string, with extra line breaks removed.
type EVMConfig ¶ added in v1.6.0
func (*EVMConfig) ValidateConfig ¶ added in v1.8.0
type EVMConfigs ¶ added in v1.8.0
type EVMConfigs []*EVMConfig
func (EVMConfigs) ValidateConfig ¶ added in v1.8.0
func (cs EVMConfigs) ValidateConfig() (err error)
type EVMNodes ¶ added in v1.8.0
func (EVMNodes) ValidateConfig ¶ added in v1.8.0
type FilePersistedSecretGenerator ¶ added in v1.7.0
type FilePersistedSecretGenerator struct{}
type SecretGenerator ¶ added in v1.7.0
SecretGenerator is the interface for objects that generate a secret used to sign or encrypt.
type Secrets ¶ added in v1.8.0
func (*Secrets) SetOverrides ¶ added in v1.8.0
Use ENV vars or flags to override secrets
type SolanaConfig ¶ added in v1.6.0
type SolanaConfig struct { ChainID *string Enabled *bool solcfg.Chain Nodes SolanaNodes }
func (*SolanaConfig) ValidateConfig ¶ added in v1.8.0
func (c *SolanaConfig) ValidateConfig() (err error)
type SolanaConfigs ¶ added in v1.8.0
type SolanaConfigs []*SolanaConfig
func (SolanaConfigs) ValidateConfig ¶ added in v1.8.0
func (cs SolanaConfigs) ValidateConfig() (err error)
type SolanaNodes ¶ added in v1.8.0
func (SolanaNodes) ValidateConfig ¶ added in v1.8.0
func (ns SolanaNodes) ValidateConfig() (err error)
type TerraConfig ¶ added in v1.6.0
type TerraConfig struct { ChainID *string Enabled *bool tercfg.Chain Nodes TerraNodes }
func (*TerraConfig) ValidateConfig ¶ added in v1.8.0
func (c *TerraConfig) ValidateConfig() (err error)
type TerraConfigs ¶ added in v1.8.0
type TerraConfigs []*TerraConfig
func (TerraConfigs) ValidateConfig ¶ added in v1.8.0
func (cs TerraConfigs) ValidateConfig() (err error)
type TerraNodes ¶ added in v1.8.0
func (TerraNodes) ValidateConfig ¶ added in v1.8.0
func (ns TerraNodes) ValidateConfig() (err error)