Documentation ¶
Index ¶
- Constants
- Variables
- func Batch(chunkSize uint, cb func(offset, limit uint) (uint, error)) error
- func EnvVarName(field string) string
- type ChainSpecificDefaultSet
- type Config
- func (c Config) AdminCredentialsFile() string
- func (c Config) AllowOrigins() string
- func (c Config) AuthenticatedRateLimit() int64
- func (c Config) AuthenticatedRateLimitPeriod() models.Duration
- func (c Config) BalanceMonitorEnabled() bool
- func (c Config) BlockBackfillDepth() uint64
- func (c Config) BridgeResponseURL() *url.URL
- func (c Config) CertFile() string
- func (c Config) ChainID() *big.Int
- func (c Config) ClientNodeURL() string
- func (c Config) CreateProductionLogger() *logger.Logger
- func (c Config) DatabaseBackupFrequency() time.Duration
- func (c Config) DatabaseBackupMode() DatabaseBackupMode
- func (c Config) DatabaseBackupURL() *url.URL
- func (c Config) DatabaseListenerMaxReconnectDuration() time.Duration
- func (c Config) DatabaseListenerMinReconnectInterval() time.Duration
- func (c Config) DatabaseMaximumTxDuration() time.Duration
- func (c Config) DatabaseTimeout() models.Duration
- func (c Config) DatabaseURL() url.URL
- func (c Config) DefaultHTTPAllowUnrestrictedNetworkAccess() bool
- func (c Config) DefaultHTTPLimit() int64
- func (c Config) DefaultHTTPTimeout() models.Duration
- func (c Config) DefaultMaxHTTPAttempts() uint
- func (c Config) Dev() bool
- func (c Config) EnableExperimentalAdapters() bool
- func (c Config) EthBalanceMonitorBlockDelay() uint16
- func (c Config) EthFinalityDepth() uint
- func (c Config) EthGasBumpPercent() uint16
- func (c Config) EthGasBumpThreshold() uint64
- func (c Config) EthGasBumpTxDepth() uint16
- func (c Config) EthGasBumpWei() *big.Int
- func (c Config) EthGasLimitDefault() uint64
- func (c Config) EthGasPriceDefault() *big.Int
- func (c Config) EthHeadTrackerHistoryDepth() uint
- func (c Config) EthHeadTrackerMaxBufferSize() uint
- func (c Config) EthLogBackfillBatchSize() uint32
- func (c Config) EthMaxGasPriceWei() *big.Int
- func (c Config) EthMaxUnconfirmedTransactions() uint64
- func (c Config) EthNonceAutoSync() bool
- func (c Config) EthRPCDefaultBatchSize() uint32
- func (c Config) EthTxResendAfterThreshold() time.Duration
- func (c Config) EthereumDisabled() bool
- func (c Config) EthereumSecondaryURLs() []url.URL
- func (c Config) EthereumURL() string
- func (c Config) ExplorerAccessKey() string
- func (c Config) ExplorerSecret() string
- func (c Config) ExplorerURL() *url.URL
- func (c Config) FeatureCronV2() bool
- func (c Config) FeatureExternalInitiators() bool
- func (c Config) FeatureFluxMonitor() bool
- func (c Config) FeatureFluxMonitorV2() bool
- func (c Config) FeatureOffchainReporting() bool
- func (c Config) FlagsContractAddress() string
- func (c Config) GasUpdaterBatchSize() uint32
- func (c Config) GasUpdaterBlockDelay() uint16
- func (c Config) GasUpdaterBlockHistorySize() uint16
- func (c Config) GasUpdaterEnabled() bool
- func (c Config) GasUpdaterTransactionPercentile() uint16
- func (c Config) GetAdvisoryLockIDConfiguredOrDefault() int64
- func (c Config) GetDatabaseDialectConfiguredOrDefault() dialects.DialectName
- func (c Config) GlobalLockRetryInterval() models.Duration
- func (c Config) HTTPServerWriteTimeout() time.Duration
- func (c Config) HeadTimeBudget() time.Duration
- func (c Config) InsecureFastScrypt() bool
- func (c Config) JSONConsole() bool
- func (c Config) JobPipelineMaxRunDuration() time.Duration
- func (c Config) JobPipelineReaperInterval() time.Duration
- func (c Config) JobPipelineReaperThreshold() time.Duration
- func (c Config) JobPipelineResultWriteQueueDepth() uint64
- func (c Config) KeeperMaximumGracePeriod() int64
- func (c Config) KeeperMinimumRequiredConfirmations() uint64
- func (c Config) KeeperRegistrySyncInterval() time.Duration
- func (c Config) KeyFile() string
- func (c Config) KeysDir() string
- func (c Config) LinkContractAddress() string
- func (c Config) LogLevel() LogLevel
- func (c Config) LogSQLMigrations() bool
- func (c Config) LogSQLStatements() bool
- func (c Config) LogToDisk() bool
- func (c Config) MaximumServiceDuration() models.Duration
- func (c Config) MigrateDatabase() bool
- func (c Config) MinIncomingConfirmations() uint32
- func (c Config) MinRequiredOutgoingConfirmations() uint64
- func (c Config) MinimumContractPayment() *assets.Link
- func (c Config) MinimumRequestExpiration() uint64
- func (c Config) MinimumServiceDuration() models.Duration
- func (c Config) OCRBlockchainTimeout(override time.Duration) time.Duration
- func (c Config) OCRBootstrapCheckInterval() time.Duration
- func (c Config) OCRContractConfirmations(override uint16) uint16
- func (c Config) OCRContractPollInterval(override time.Duration) time.Duration
- func (c Config) OCRContractSubscribeInterval(override time.Duration) time.Duration
- func (c Config) OCRContractTransmitterTransmitTimeout() time.Duration
- func (c Config) OCRDHTLookupInterval() int
- func (c Config) OCRDatabaseTimeout() time.Duration
- func (c Config) OCRIncomingMessageBufferSize() int
- func (c Config) OCRKeyBundleID(override *models.Sha256Hash) (models.Sha256Hash, error)
- func (c Config) OCRMonitoringEndpoint(override string) string
- func (c Config) OCRNewStreamTimeout() time.Duration
- func (c Config) OCRObservationGracePeriod() time.Duration
- func (c Config) OCRObservationTimeout(override time.Duration) time.Duration
- func (c Config) OCROutgoingMessageBufferSize() int
- func (c Config) OCRTraceLogging() bool
- func (c Config) OCRTransmitterAddress(override *models.EIP55Address) (models.EIP55Address, error)
- func (c Config) ORMMaxIdleConns() int
- func (c Config) ORMMaxOpenConns() int
- func (c Config) OperatorContractAddress() common.Address
- func (c Config) P2PAnnounceIP() net.IP
- func (c Config) P2PAnnouncePort() uint16
- func (c Config) P2PBootstrapPeers(override []string) ([]string, error)
- func (c Config) P2PDHTAnnouncementCounterUserPrefix() uint32
- func (c Config) P2PListenIP() net.IP
- func (c Config) P2PListenPort() uint16
- func (c Config) P2PPeerID(override *models.PeerID) (models.PeerID, error)
- func (c Config) P2PPeerIDIsSet() bool
- func (c Config) P2PPeerstoreWriteInterval() time.Duration
- func (c Config) Port() uint16
- func (c Config) ReaperExpiration() models.Duration
- func (c Config) ReplayFromBlock() int64
- func (c Config) RootDir() string
- func (c Config) SecureCookies() bool
- func (c Config) SessionOptions() sessions.Options
- func (c Config) SessionSecret() ([]byte, error)
- func (c Config) SessionTimeout() models.Duration
- func (c Config) Set(name string, value interface{})
- func (c Config) SetEthGasPriceDefault(value *big.Int) error
- func (c Config) SetLogLevel(ctx context.Context, value string) error
- func (c Config) SetLogSQLStatements(ctx context.Context, sqlEnabled bool) error
- func (c *Config) SetRuntimeStore(orm *ORM)
- func (c Config) StatsPusherLogging() bool
- func (c Config) TLSCertPath() string
- func (c Config) TLSHost() string
- func (c Config) TLSKeyPath() string
- func (c Config) TLSPort() uint16
- func (c Config) TLSRedirect() bool
- func (c Config) TriggerFallbackDBPollInterval() time.Duration
- func (c Config) UnAuthenticatedRateLimit() int64
- func (c Config) UnAuthenticatedRateLimitPeriod() models.Duration
- func (c *Config) Validate() error
- type ConfigReader
- type ConfigSchema
- type Connection
- type DatabaseBackupMode
- type LockingStrategy
- type LogLevel
- type ORM
- func (orm *ORM) AllKeys() ([]models.Key, error)
- func (orm *ORM) AnyJobWithType(taskTypeName string) (bool, error)
- func (orm *ORM) ArchiveEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
- func (orm *ORM) ArchiveJob(ID models.JobID) error
- func (orm *ORM) AuthorizedUserWithSession(sessionID string, sessionDuration time.Duration) (models.User, error)
- func (orm *ORM) BridgeTypes(offset int, limit int) ([]models.BridgeType, int, error)
- func (orm *ORM) BulkDeleteRuns(bulkQuery *models.BulkDeleteRunRequest) error
- func (orm *ORM) Chain(ctx context.Context, hash common.Hash, lookback uint) (models.Head, error)
- func (orm *ORM) ClearNonCurrentSessions(sessionID string) error
- func (orm *ORM) ClearSessions() error
- func (orm *ORM) ClobberDiskKeyStoreWithDBKeys(keysDir string) error
- func (orm *ORM) Close() error
- func (orm *ORM) CountOf(t interface{}) (int, error)
- func (orm *ORM) CreateBridgeType(bt *models.BridgeType) error
- func (orm *ORM) CreateExternalInitiator(externalInitiator *models.ExternalInitiator) error
- func (orm *ORM) CreateInitiator(initr *models.Initiator) error
- func (orm *ORM) CreateJob(job *models.JobSpec) error
- func (orm *ORM) CreateJobRun(run *models.JobRun) error
- func (orm *ORM) CreateKeyIfNotExists(k models.Key) error
- func (orm *ORM) CreateServiceAgreement(sa *models.ServiceAgreement) error
- func (orm *ORM) CreateSession(sr models.SessionRequest) (string, error)
- func (orm *ORM) DeleteBridgeType(bt *models.BridgeType) error
- func (orm *ORM) DeleteEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
- func (orm *ORM) DeleteExternalInitiator(name string) error
- func (orm *ORM) DeleteFluxMonitorRoundsBackThrough(aggregator common.Address, roundID uint32) error
- func (orm *ORM) DeleteJobSpecError(ID int64) error
- func (orm *ORM) DeleteKey(address common.Address) error
- func (orm *ORM) DeleteStaleSessions(before time.Time) error
- func (orm *ORM) DeleteUser() error
- func (orm *ORM) DeleteUserSession(sessionID string) error
- func (orm *ORM) EthTransactionsWithAttempts(offset, limit int) ([]models.EthTx, int, error)
- func (orm *ORM) EthTxAttempts(offset, limit int) ([]models.EthTxAttempt, int, error)
- func (orm *ORM) FindBridge(name models.TaskType) (bt models.BridgeType, err error)
- func (orm *ORM) FindBridgesByNames(names []string) ([]models.BridgeType, error)
- func (orm *ORM) FindEncryptedSecretVRFKeys(where ...vrfkey.EncryptedVRFKey) (retrieved []*vrfkey.EncryptedVRFKey, err error)
- func (orm *ORM) FindEthTaskRunTxByTaskRunID(taskRunID uuid.UUID) (*models.EthTaskRunTx, error)
- func (orm *ORM) FindEthTxAttempt(hash common.Hash) (*models.EthTxAttempt, error)
- func (orm *ORM) FindEthTxWithAttempts(etxID int64) (models.EthTx, error)
- func (orm *ORM) FindExternalInitiator(eia *auth.Token) (*models.ExternalInitiator, error)
- func (orm *ORM) FindExternalInitiatorByName(iname string) (exi models.ExternalInitiator, err error)
- func (orm *ORM) FindInitiator(ID int64) (initr models.Initiator, err error)
- func (orm *ORM) FindJobIDsWithBridge(bridgeName string) ([]models.JobID, error)
- func (orm *ORM) FindJobRun(id uuid.UUID) (jr models.JobRun, err error)
- func (orm *ORM) FindJobRunIncludingArchived(id uuid.UUID) (jr models.JobRun, err error)
- func (orm *ORM) FindJobSpec(id models.JobID) (job models.JobSpec, err error)
- func (orm *ORM) FindJobSpecError(jobID models.JobID, description string) (*models.JobSpecError, error)
- func (orm *ORM) FindJobSpecUnscoped(id models.JobID) (job models.JobSpec, err error)
- func (orm *ORM) FindJobWithErrors(id models.JobID) (models.JobSpec, error)
- func (orm *ORM) FindLatestNodeVersion() (*models.NodeVersion, error)
- func (orm *ORM) FindOrCreateFluxMonitorRoundStats(aggregator common.Address, roundID uint32) (stats models.FluxMonitorRoundStats, err error)
- func (orm *ORM) FindServiceAgreement(id string) (sa models.ServiceAgreement, err error)
- func (orm *ORM) FindUser() (models.User, error)
- func (orm *ORM) FirstOrCreateEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
- func (orm *ORM) GetConfigBoolValue(field string) (*bool, error)
- func (orm *ORM) GetConfigValue(field string, value encoding.TextUnmarshaler) error
- func (orm *ORM) GetRoundRobinAddress(addresses ...common.Address) (address common.Address, err error)
- func (orm *ORM) HeadByHash(ctx context.Context, hash common.Hash) (*models.Head, error)
- func (orm *ORM) IdempotentInsertEthTaskRunTx(taskRunID uuid.UUID, fromAddress common.Address, toAddress common.Address, ...) error
- func (orm *ORM) IdempotentInsertHead(ctx context.Context, h models.Head) error
- func (orm *ORM) JobRunsCountFor(jobSpecID models.JobID) (int, error)
- func (orm *ORM) JobRunsCountForGivenStatus(jobSpecID models.JobID, status string) (int, error)
- func (orm *ORM) JobRunsFor(jobSpecID models.JobID, limit ...int) ([]models.JobRun, error)
- func (orm *ORM) JobRunsSorted(sort SortType, offset int, limit int) ([]models.JobRun, int, error)
- func (orm *ORM) JobRunsSortedFor(id models.JobID, order SortType, offset int, limit int) ([]models.JobRun, int, int, int, error)
- func (orm *ORM) Jobs(cb func(*models.JobSpec) bool, initrTypes ...string) error
- func (orm *ORM) JobsSorted(sort SortType, offset int, limit int) ([]models.JobSpec, int, error)
- func (orm *ORM) KeyByAddress(address common.Address) (models.Key, error)
- func (orm *ORM) KeyExists(address common.Address) (bool, error)
- func (orm *ORM) LastHead(ctx context.Context) (*models.Head, error)
- func (orm *ORM) LinkEarnedFor(spec *models.JobSpec) (*assets.Link, error)
- func (orm *ORM) MarkRan(i models.Initiator, ran bool) error
- func (orm *ORM) MostRecentFluxMonitorRoundID(aggregator common.Address) (uint32, error)
- func (orm *ORM) MustEnsureAdvisoryLock() error
- func (orm *ORM) MustSQLDB() *sql.DB
- func (orm *ORM) PendingBridgeType(jr models.JobRun) (bt models.BridgeType, err error)
- func (orm *ORM) RawDBWithAdvisoryLock(fn func(*gorm.DB) error) error
- func (orm *ORM) RemoveUnstartedTransactions() error
- func (orm *ORM) SaveJobRun(run *models.JobRun) error
- func (orm *ORM) SaveSession(session *models.Session) error
- func (orm *ORM) SaveUser(user *models.User) error
- func (orm *ORM) SendKeys() ([]models.Key, error)
- func (orm *ORM) Sessions(offset, limit int) ([]models.Session, error)
- func (orm *ORM) SetConfigStrValue(ctx context.Context, field string, value string) error
- func (orm *ORM) SetConfigValue(field string, value encoding.TextMarshaler) error
- func (orm *ORM) SetLogging(enabled bool)
- func (orm *ORM) Transaction(fc func(tx *gorm.DB) error) (err error)
- func (orm *ORM) TrimOldHeads(ctx context.Context, n uint) (err error)
- func (orm *ORM) Unscoped() *ORM
- func (orm *ORM) UnscopedJobRunsWithStatus(cb func(*models.JobRun), statuses ...models.RunStatus) error
- func (orm *ORM) UpdateBridgeType(bt *models.BridgeType, btr *models.BridgeTypeRequest) error
- func (orm *ORM) UpdateFluxMonitorRoundStats(aggregator common.Address, roundID uint32, jobRunID uuid.UUID) error
- func (orm *ORM) UpsertErrorFor(jobID models.JobID, description string)
- func (orm *ORM) UpsertNodeVersion(version models.NodeVersion) error
- type PostgresLockingStrategy
- type SecretGenerator
- type SortType
Constants ¶
const BatchSize = 100
BatchSize is the safe number of records to cache during Batch calls for SQLite without causing load problems. NOTE: Now we no longer support SQLite, perhaps this can be tuned?
Variables ¶
var ( ErrUnset = errors.New("env var unset") ErrInvalid = errors.New("env var invalid") // keyed by ChainID ChainSpecificDefaults map[int64]ChainSpecificDefaultSet // If the chain is unknown, fallback to the general defaults GeneralDefaults ChainSpecificDefaultSet )
var ( // ErrorNotFound is returned when finding a single value fails. ErrorNotFound = gorm.ErrRecordNotFound // ErrNoAdvisoryLock is returned when an advisory lock can't be acquired. ErrNoAdvisoryLock = errors.New("can't acquire advisory lock") // ErrReleaseLockFailed is returned when releasing the advisory lock fails. ErrReleaseLockFailed = errors.New("advisory lock release failed") // ErrOptimisticUpdateConflict is returned when a record update failed // because another update occurred while the model was in memory and the // differences must be reconciled. ErrOptimisticUpdateConflict = errors.New("conflict while updating record") )
Functions ¶
func EnvVarName ¶ added in v0.6.6
EnvVarName gets the environment variable name for a config schema field
Types ¶
type ChainSpecificDefaultSet ¶ added in v0.10.5
type ChainSpecificDefaultSet struct { EthGasBumpThreshold uint64 EthGasBumpWei *big.Int EthGasPriceDefault *big.Int EthMaxGasPriceWei *big.Int EthFinalityDepth uint EthHeadTrackerHistoryDepth uint EthBalanceMonitorBlockDelay uint16 EthTxResendAfterThreshold time.Duration GasUpdaterBatchSize *uint32 GasUpdaterBlockDelay uint16 GasUpdaterBlockHistorySize uint16 HeadTimeBudget time.Duration MinIncomingConfirmations uint32 MinRequiredOutgoingConfirmations uint64 }
ChainSpecificDefaultSet us a list of defaults specific to a particular chain ID
type Config ¶ added in v0.6.6
type Config struct { SecretGenerator SecretGenerator Dialect dialects.DialectName AdvisoryLockID int64 // contains filtered or unexported fields }
Config holds parameters used by the application which can be overridden by setting environment variables.
If you add an entry here which does not contain sensitive information, you should also update presenters.ConfigWhitelist and cmd_test.TestClient_RunNodeShowsEnv.
func NewConfig ¶ added in v0.6.6
func NewConfig() *Config
NewConfig returns the config with the environment variables set to their respective fields, or their defaults if environment variables are not set.
func (Config) AdminCredentialsFile ¶ added in v0.10.3
AdminCredentialsFile points to text file containing admnn credentials for logging in
func (Config) AllowOrigins ¶ added in v0.6.6
AllowOrigins returns the CORS hosts used by the frontend.
func (Config) AuthenticatedRateLimit ¶ added in v0.9.9
AuthenticatedRateLimit defines the threshold to which requests authenticated requests get limited
func (Config) AuthenticatedRateLimitPeriod ¶ added in v0.9.9
AuthenticatedRateLimitPeriod defines the period to which authenticated requests get limited
func (Config) BalanceMonitorEnabled ¶ added in v0.9.3
BalanceMonitorEnabled enables the balance monitor
func (Config) BlockBackfillDepth ¶ added in v0.8.5
BlockBackfillDepth specifies the number of blocks before the current HEAD that the log broadcaster will try to re-consume logs from
func (Config) BridgeResponseURL ¶ added in v0.6.6
BridgeResponseURL represents the URL for bridges to send a response to.
func (Config) CertFile ¶ added in v0.6.6
CertFile returns the path where the server certificate is kept
func (Config) ClientNodeURL ¶ added in v0.6.6
ClientNodeURL is the URL of the Ethereum node this Chainlink node should connect to.
func (Config) CreateProductionLogger ¶ added in v0.6.6
CreateProductionLogger returns a custom logger for the config's root directory and LogLevel, with pretty printing for stdout. If LOG_TO_DISK is false, the logger will only log to stdout.
func (Config) DatabaseBackupFrequency ¶ added in v0.10.4
DatabaseBackupFrequency turns on the periodic database backup if set to a positive value DatabaseBackupMode must be then set to a value other than "none"
func (Config) DatabaseBackupMode ¶ added in v0.10.4
func (c Config) DatabaseBackupMode() DatabaseBackupMode
DatabaseBackupMode sets the database backup mode
func (Config) DatabaseBackupURL ¶ added in v0.10.4
DatabaseBackupURL configures the URL for the database to backup, if it's to be different from the main on
func (Config) DatabaseListenerMaxReconnectDuration ¶ added in v0.9.3
func (Config) DatabaseListenerMinReconnectInterval ¶ added in v0.9.3
func (Config) DatabaseMaximumTxDuration ¶ added in v0.9.3
func (Config) DatabaseTimeout ¶ added in v0.6.6
DatabaseTimeout represents how long to tolerate non response from the DB.
func (Config) DatabaseURL ¶ added in v0.6.6
DatabaseURL configures the URL for chainlink to connect to. This must be a properly formatted URL, with a valid scheme (postgres://)
func (Config) DefaultHTTPAllowUnrestrictedNetworkAccess ¶ added in v0.9.3
DefaultHTTPAllowUnrestrictedNetworkAccess controls whether http requests are unrestricted by default It is recommended that this be left disabled
func (Config) DefaultHTTPLimit ¶ added in v0.6.6
DefaultHTTPLimit defines the size limit for HTTP requests and responses
func (Config) DefaultHTTPTimeout ¶ added in v0.8.2
DefaultHTTPTimeout defines the default timeout for http requests
func (Config) DefaultMaxHTTPAttempts ¶ added in v0.8.2
DefaultMaxHTTPAttempts defines the limit for HTTP requests.
func (Config) EnableExperimentalAdapters ¶ added in v0.8.2
EnableExperimentalAdapters enables support for experimental adapters
func (Config) EthBalanceMonitorBlockDelay ¶ added in v0.8.12
EthBalanceMonitorBlockDelay is the number of blocks that the balance monitor trails behind head. This is required e.g. for Infura because they will often announce a new head, then route a request to a different node which does not have this head yet.
func (Config) EthFinalityDepth ¶ added in v0.8.7
EthFinalityDepth is the number of blocks after which an ethereum transaction is considered "final" BlocksConsideredFinal determines how deeply we look back to ensure that transactions are confirmed onto the longest chain There is not a large performance penalty to setting this relatively high (on the order of hundreds) It is practically limited by the number of heads we store in the database and should be less than this with a comfortable margin. If a transaction is mined in a block more than this many blocks ago, and is reorged out, we will NOT retransmit this transaction and undefined behaviour can occur including gaps in the nonce sequence that require manual intervention to fix. Therefore this number represents a number of blocks we consider large enough that no re-org this deep will ever feasibly happen.
func (Config) EthGasBumpPercent ¶ added in v0.8.2
EthGasBumpPercent is the minimum percentage by which gas is bumped on each transaction attempt Change with care since values below geth's default will fail with "underpriced replacement transaction"
func (Config) EthGasBumpThreshold ¶ added in v0.6.6
EthGasBumpThreshold is the number of blocks to wait before bumping gas again on unconfirmed transactions Set to 0 to disable gas bumping
func (Config) EthGasBumpTxDepth ¶ added in v0.8.16
EthGasBumpTxDepth is the number of transactions to gas bump starting from oldest. Set to 0 for no limit (i.e. bump all)
func (Config) EthGasBumpWei ¶ added in v0.6.6
EthGasBumpWei is the minimum fixed amount of wei by which gas is bumped on each transaction attempt
func (Config) EthGasLimitDefault ¶ added in v0.8.2
EthGasLimitDefault sets the default gas limit for outgoing transactions.
func (Config) EthGasPriceDefault ¶ added in v0.6.6
EthGasPriceDefault is the starting gas price for every transaction
func (Config) EthHeadTrackerHistoryDepth ¶ added in v0.8.7
EthHeadTrackerHistoryDepth tracks the top N block numbers to keep in the `heads` database table. Note that this can easily result in MORE than N records since in the case of re-orgs we keep multiple heads for a particular block height. This number should be at least as large as `EthFinalityDepth`. There may be a small performance penalty to setting this to something very large (10,000+)
func (Config) EthHeadTrackerMaxBufferSize ¶ added in v0.8.15
EthHeadTrackerMaxBufferSize is the maximum number of heads that may be buffered in front of the head tracker before older heads start to be dropped. You may think of it as something like the maximum permittable "lag" for the head tracker before we start dropping heads to keep up.
func (Config) EthLogBackfillBatchSize ¶ added in v0.10.4
EthLogBackfillBatchSize sets the batch size for calling FilterLogs when we backfill missing logs
func (Config) EthMaxGasPriceWei ¶ added in v0.8.2
EthMaxGasPriceWei is the maximum amount in Wei that a transaction will be bumped to before abandoning it and marking it as errored.
func (Config) EthMaxUnconfirmedTransactions ¶ added in v0.10.3
EthMaxUnconfirmedTransactions is the maximum number of unconfirmed transactions per key that are allowed to be in flight before jobs will start failing and rejecting send of any further transactions. 0 value disables
func (Config) EthNonceAutoSync ¶ added in v0.10.4
EthNonceAutoSync enables/disables running the NonceSyncer on application start
func (Config) EthRPCDefaultBatchSize ¶ added in v0.10.4
EthRPCDefaultBatchSize controls the number of receipts fetched in each request in the EthConfirmer
func (Config) EthTxResendAfterThreshold ¶ added in v0.10.4
EthTxResendAfterThreshold controls how long the ethResender will wait before re-sending the latest eth_tx_attempt. This is designed a as a fallback to protect against the eth nodes dropping txes (it has been anecdotally observed to happen), networking issues or txes being ejected from the mempool. See eth_resender.go for more details
func (Config) EthereumDisabled ¶ added in v0.8.3
EthereumDisabled shows whether Ethereum interactions are supported.
func (Config) EthereumSecondaryURLs ¶ added in v0.9.6
EthereumSecondaryURLs is an optional backup RPC URL Must be http(s) format If specified, transactions will also be broadcast to this ethereum node
func (Config) EthereumURL ¶ added in v0.6.6
EthereumURL represents the URL of the Ethereum node to connect Chainlink to.
func (Config) ExplorerAccessKey ¶ added in v0.6.6
ExplorerAccessKey returns the access key for authenticating with explorer
func (Config) ExplorerSecret ¶ added in v0.6.6
ExplorerSecret returns the secret for authenticating with explorer
func (Config) ExplorerURL ¶ added in v0.6.6
ExplorerURL returns the websocket URL for this node to push stats to, or nil.
func (Config) FeatureCronV2 ¶ added in v0.10.5
FeatureCronV2 enables the Cron v2 feature.
func (Config) FeatureExternalInitiators ¶ added in v0.8.2
FeatureExternalInitiators enables the External Initiator feature.
func (Config) FeatureFluxMonitor ¶ added in v0.8.2
FeatureFluxMonitor enables the Flux Monitor feature.
func (Config) FeatureFluxMonitorV2 ¶ added in v0.10.3
FeatureFluxMonitorV2 enables the Flux Monitor v2 feature.
func (Config) FeatureOffchainReporting ¶ added in v0.9.3
FeatureOffchainReporting enables the Flux Monitor feature.
func (Config) FlagsContractAddress ¶ added in v0.9.0
FlagsContractAddress represents the Flags contract address
func (Config) GasUpdaterBatchSize ¶ added in v0.10.5
GasUpdaterBatchSize sets the maximum number of blocks to fetch in one batch in the gas updater If the env var GAS_UPDATER_BATCH_SIZE is unset, it defaults to ETH_RPC_DEFAULT_BATCH_SIZE
func (Config) GasUpdaterBlockDelay ¶ added in v0.8.2
GasUpdaterBlockDelay is the number of blocks that the gas updater trails behind head. E.g. if this is set to 3, and we receive block 10, gas updater will fetch block 7. CAUTION: You might be tempted to set this to 0 to use the latest possible block, but it is possible to receive a head BEFORE that block is actually available from the connected node via RPC. In this case you will get false "zero" blocks that are missing transactions.
func (Config) GasUpdaterBlockHistorySize ¶ added in v0.8.2
GasUpdaterBlockHistorySize is the number of past blocks to keep in memory to use as a basis for calculating a percentile gas price
func (Config) GasUpdaterEnabled ¶ added in v0.8.2
GasUpdaterEnabled turns on the automatic gas updater if set to true It is disabled by default
func (Config) GasUpdaterTransactionPercentile ¶ added in v0.8.2
GasUpdaterTransactionPercentile is the percentile gas price to choose. E.g. if the past transaction history contains four transactions with gas prices: [100, 200, 300, 400], picking 25 for this number will give a value of 200
func (Config) GetAdvisoryLockIDConfiguredOrDefault ¶ added in v0.8.4
func (Config) GetDatabaseDialectConfiguredOrDefault ¶ added in v0.8.4
func (c Config) GetDatabaseDialectConfiguredOrDefault() dialects.DialectName
func (Config) GlobalLockRetryInterval ¶ added in v0.9.9
GlobalLockRetryInterval represents how long to wait before trying again to get the global advisory lock.
func (Config) HTTPServerWriteTimeout ¶ added in v0.10.0
func (Config) HeadTimeBudget ¶ added in v0.10.4
HeadTimeBudget returns the time allowed for context timeout in head tracker
func (Config) InsecureFastScrypt ¶ added in v0.9.3
InsecureFastScrypt causes all key stores to encrypt using "fast" scrypt params instead This is insecure and only useful for local testing. DO NOT SET THIS IN PRODUCTION
func (Config) JSONConsole ¶ added in v0.6.6
JSONConsole enables the JSON console.
func (Config) JobPipelineMaxRunDuration ¶ added in v0.9.10
JobPipelineMaxRunDuration is the maximum time that a job run may take
func (Config) JobPipelineReaperInterval ¶ added in v0.9.3
func (Config) JobPipelineReaperThreshold ¶ added in v0.9.3
func (Config) JobPipelineResultWriteQueueDepth ¶ added in v0.10.3
func (Config) KeeperMaximumGracePeriod ¶ added in v0.10.4
func (Config) KeeperMinimumRequiredConfirmations ¶ added in v0.10.4
func (Config) KeeperRegistrySyncInterval ¶ added in v0.10.3
func (Config) KeysDir ¶ added in v0.6.6
KeysDir returns the path of the keys directory (used for keystore files).
func (Config) LinkContractAddress ¶ added in v0.6.6
LinkContractAddress represents the address
func (Config) LogLevel ¶ added in v0.6.6
LogLevel represents the maximum level of log messages to output.
func (Config) LogSQLMigrations ¶ added in v0.6.6
LogSQLMigrations tells chainlink to log all SQL migrations made using the default logger
func (Config) LogSQLStatements ¶ added in v0.6.6
LogSQLStatements tells chainlink to log all SQL statements made using the default logger
func (Config) MaximumServiceDuration ¶ added in v0.6.6
MaximumServiceDuration is the maximum time that a service agreement can run from after the time it is created. Default 1 year = 365 * 24h = 8760h
func (Config) MigrateDatabase ¶ added in v0.8.4
MigrateDatabase determines whether the database will be automatically migrated on application startup if set to true
func (Config) MinIncomingConfirmations ¶ added in v0.6.6
MinIncomingConfirmations represents the minimum number of block confirmations that need to be recorded since a job run started before a task can proceed.
func (Config) MinRequiredOutgoingConfirmations ¶ added in v0.8.8
MinRequiredOutgoingConfirmations represents the default minimum number of block confirmations that need to be recorded on an outgoing ethtx task before the run can move onto the next task. This can be overridden on a per-task basis by setting the `MinRequiredOutgoingConfirmations` parameter.
func (Config) MinimumContractPayment ¶ added in v0.6.6
MinimumContractPayment represents the minimum amount of LINK that must be supplied for a contract to be considered.
func (Config) MinimumRequestExpiration ¶ added in v0.6.6
MinimumRequestExpiration is the minimum allowed request expiration for a Service Agreement.
func (Config) MinimumServiceDuration ¶ added in v0.6.6
MinimumServiceDuration is the shortest duration from now that a service is allowed to run.
func (Config) OCRBlockchainTimeout ¶ added in v0.9.7
func (Config) OCRBootstrapCheckInterval ¶ added in v0.9.3
FIXME: Add comments to all of these
func (Config) OCRContractConfirmations ¶ added in v0.9.7
func (Config) OCRContractPollInterval ¶ added in v0.9.7
func (Config) OCRContractSubscribeInterval ¶ added in v0.9.7
func (Config) OCRContractTransmitterTransmitTimeout ¶ added in v0.9.3
func (Config) OCRDHTLookupInterval ¶ added in v0.9.3
func (Config) OCRDatabaseTimeout ¶ added in v0.9.3
func (Config) OCRIncomingMessageBufferSize ¶ added in v0.9.3
func (Config) OCRKeyBundleID ¶ added in v0.9.7
func (c Config) OCRKeyBundleID(override *models.Sha256Hash) (models.Sha256Hash, error)
func (Config) OCRMonitoringEndpoint ¶ added in v0.9.7
func (Config) OCRNewStreamTimeout ¶ added in v0.9.3
func (Config) OCRObservationGracePeriod ¶ added in v0.10.3
func (Config) OCRObservationTimeout ¶ added in v0.9.7
func (Config) OCROutgoingMessageBufferSize ¶ added in v0.9.3
func (Config) OCRTraceLogging ¶ added in v0.9.3
OCRTraceLogging determines whether OCR logs at TRACE level are enabled. The option to turn them off is given because they can be very verbose
func (Config) OCRTransmitterAddress ¶ added in v0.9.7
func (c Config) OCRTransmitterAddress(override *models.EIP55Address) (models.EIP55Address, error)
func (Config) ORMMaxIdleConns ¶ added in v0.9.9
func (Config) ORMMaxOpenConns ¶ added in v0.9.9
func (Config) OperatorContractAddress ¶ added in v0.9.0
OperatorContractAddress represents the address where the Operator.sol contract is deployed, this is used for filtering RunLog requests
func (Config) P2PAnnounceIP ¶ added in v0.9.6
P2PAnnounceIP is an optional override. If specified it will force the p2p layer to announce this IP as the externally reachable one to the DHT If this is set, P2PAnnouncePort MUST also be set.
func (Config) P2PAnnouncePort ¶ added in v0.9.6
P2PAnnouncePort is an optional override. If specified it will force the p2p layer to announce this port as the externally reachable one to the DHT. If this is set, P2PAnnounceIP MUST also be set.
func (Config) P2PBootstrapPeers ¶ added in v0.9.7
func (Config) P2PDHTAnnouncementCounterUserPrefix ¶ added in v0.9.7
P2PDHTAnnouncementCounterUserPrefix can be used to restore the node's ability to announce its IP/port on the P2P network after a database rollback. Make sure to only increase this value, and *never* decrease it. Don't use this variable unless you really know what you're doing, since you could semi-permanently exclude your node from the P2P network by misconfiguring it.
func (Config) P2PListenIP ¶ added in v0.9.6
P2PListenIP is the ip that libp2p willl bind to and listen on
func (Config) P2PListenPort ¶ added in v0.9.6
P2PListenPort is the port that libp2p willl bind to and listen on
func (Config) P2PPeerIDIsSet ¶ added in v0.9.9
func (Config) P2PPeerstoreWriteInterval ¶ added in v0.9.6
func (Config) Port ¶ added in v0.6.6
Port represents the port Chainlink should listen on for client requests.
func (Config) ReaperExpiration ¶ added in v0.6.6
ReaperExpiration represents
func (Config) ReplayFromBlock ¶ added in v0.6.10
func (Config) RootDir ¶ added in v0.6.6
RootDir represents the location on the file system where Chainlink should keep its files.
func (Config) SecureCookies ¶ added in v0.6.6
SecureCookies allows toggling of the secure cookies HTTP flag
func (Config) SessionOptions ¶ added in v0.6.6
SessionOptions returns the sesssions.Options struct used to configure the session store.
func (Config) SessionSecret ¶ added in v0.6.6
SessionSecret returns a sequence of bytes to be used as a private key for session signing or encryption.
func (Config) SessionTimeout ¶ added in v0.6.6
SessionTimeout is the maximum duration that a user session can persist without any activity.
func (Config) SetEthGasPriceDefault ¶ added in v0.6.6
SetEthGasPriceDefault saves a runtime value for the default gas price for transactions
func (Config) SetLogLevel ¶ added in v0.10.4
SetLogLevel saves a runtime value for the default logger level
func (Config) SetLogSQLStatements ¶ added in v0.10.4
SetLogSQLStatements saves a runtime value for enabling/disabling logging all SQL statements on the default logger
func (*Config) SetRuntimeStore ¶ added in v0.6.6
SetRuntimeStore tells the configuration system to use a store for retrieving configuration variables that can be configured at runtime.
func (Config) StatsPusherLogging ¶ added in v0.10.4
StatsPusherLogging toggles very verbose logging of raw messages for the StatsPusher (also telemetry)
func (Config) TLSCertPath ¶ added in v0.6.6
TLSCertPath represents the file system location of the TLS certificate Chainlink should use for HTTPS.
func (Config) TLSHost ¶ added in v0.6.6
TLSHost represents the hostname to use for TLS clients. This should match the TLS certificate.
func (Config) TLSKeyPath ¶ added in v0.6.6
TLSKeyPath represents the file system location of the TLS key Chainlink should use for HTTPS.
func (Config) TLSPort ¶ added in v0.6.6
TLSPort represents the port Chainlink should listen on for encrypted client requests.
func (Config) TLSRedirect ¶ added in v0.6.6
TLSRedirect forces TLS redirect for unencrypted connections
func (Config) TriggerFallbackDBPollInterval ¶ added in v0.9.6
func (Config) UnAuthenticatedRateLimit ¶ added in v0.9.9
UnAuthenticatedRateLimit defines the threshold to which requests unauthenticated requests get limited
func (Config) UnAuthenticatedRateLimitPeriod ¶ added in v0.9.9
UnAuthenticatedRateLimitPeriod defines the period to which unauthenticated requests get limited
type ConfigReader ¶ added in v0.6.6
type ConfigReader interface { AllowOrigins() string BlockBackfillDepth() uint64 BridgeResponseURL() *url.URL ChainID() *big.Int ClientNodeURL() string DatabaseTimeout() models.Duration DatabaseURL() url.URL DatabaseMaximumTxDuration() time.Duration DefaultMaxHTTPAttempts() uint DefaultHTTPLimit() int64 DefaultHTTPTimeout() models.Duration DefaultHTTPAllowUnrestrictedNetworkAccess() bool Dev() bool FeatureExternalInitiators() bool FeatureFluxMonitor() bool FeatureOffchainReporting() bool MaximumServiceDuration() models.Duration MinimumServiceDuration() models.Duration EnableExperimentalAdapters() bool EthBalanceMonitorBlockDelay() uint16 EthGasBumpPercent() uint16 EthGasBumpThreshold() uint64 EthGasBumpTxDepth() uint16 EthGasBumpWei() *big.Int EthGasLimitDefault() uint64 EthGasPriceDefault() *big.Int EthMaxGasPriceWei() *big.Int EthNonceAutoSync() bool EthFinalityDepth() uint EthRPCDefaultBatchSize() uint32 EthHeadTrackerHistoryDepth() uint EthHeadTrackerMaxBufferSize() uint EthTxResendAfterThreshold() time.Duration SetEthGasPriceDefault(value *big.Int) error EthereumURL() string EthereumSecondaryURLs() []url.URL GasUpdaterBlockDelay() uint16 GasUpdaterBlockHistorySize() uint16 GasUpdaterTransactionPercentile() uint16 JSONConsole() bool LinkContractAddress() string ExplorerURL() *url.URL ExplorerAccessKey() string ExplorerSecret() string OperatorContractAddress() common.Address LogLevel() LogLevel LogToDisk() bool LogSQLStatements() bool MinIncomingConfirmations() uint32 MinRequiredOutgoingConfirmations() uint64 MinimumContractPayment() *assets.Link MinimumRequestExpiration() uint64 MigrateDatabase() bool OCRTraceLogging() bool Port() uint16 ReaperExpiration() models.Duration RootDir() string SecureCookies() bool SessionTimeout() models.Duration TLSCertPath() string TLSHost() string TLSKeyPath() string TLSPort() uint16 TLSRedirect() bool KeysDir() string KeyFile() string CertFile() string CreateProductionLogger() *logger.Logger SessionSecret() ([]byte, error) SessionOptions() sessions.Options TriggerFallbackDBPollInterval() time.Duration EthLogBackfillBatchSize() uint32 // contains filtered or unexported methods }
ConfigReader represents just the read side of the config
type ConfigSchema ¶ added in v0.6.6
type ConfigSchema struct { AdminCredentialsFile string `env:"ADMIN_CREDENTIALS_FILE" default:"$ROOT/apicredentials"` AllowOrigins string `env:"ALLOW_ORIGINS" default:"http://localhost:3000,http://localhost:6688"` AuthenticatedRateLimit int64 `env:"AUTHENTICATED_RATE_LIMIT" default:"1000"` AuthenticatedRateLimitPeriod time.Duration `env:"AUTHENTICATED_RATE_LIMIT_PERIOD" default:"1m"` BalanceMonitorEnabled bool `env:"BALANCE_MONITOR_ENABLED" default:"true"` BlockBackfillDepth string `env:"BLOCK_BACKFILL_DEPTH" default:"10"` BridgeResponseURL url.URL `env:"BRIDGE_RESPONSE_URL"` ChainID big.Int `env:"ETH_CHAIN_ID" default:"1"` ClientNodeURL string `env:"CLIENT_NODE_URL" default:"http://localhost:6688"` DatabaseTimeout models.Duration `env:"DATABASE_TIMEOUT" default:"0"` DatabaseURL string `env:"DATABASE_URL"` DatabaseListenerMinReconnectInterval time.Duration `env:"DATABASE_LISTENER_MIN_RECONNECT_INTERVAL" default:"1m"` DatabaseListenerMaxReconnectDuration time.Duration `env:"DATABASE_LISTENER_MAX_RECONNECT_DURATION" default:"10m"` DatabaseMaximumTxDuration time.Duration `env:"DATABASE_MAXIMUM_TX_DURATION" default:"30m"` DatabaseBackupMode string `env:"DATABASE_BACKUP_MODE" default:"none"` DatabaseBackupFrequency time.Duration `env:"DATABASE_BACKUP_FREQUENCY" default:"0m"` DatabaseBackupURL *url.URL `env:"DATABASE_BACKUP_URL" default:""` DefaultHTTPLimit int64 `env:"DEFAULT_HTTP_LIMIT" default:"32768"` DefaultHTTPTimeout models.Duration `env:"DEFAULT_HTTP_TIMEOUT" default:"15s"` DefaultHTTPAllowUnrestrictedNetworkAccess bool `env:"DEFAULT_HTTP_ALLOW_UNRESTRICTED_NETWORK_ACCESS" default:"false"` Dev bool `env:"CHAINLINK_DEV" default:"false"` EnableExperimentalAdapters bool `env:"ENABLE_EXPERIMENTAL_ADAPTERS" default:"false"` FeatureCronV2 bool `env:"FEATURE_CRON_V2" default:"false"` FeatureExternalInitiators bool `env:"FEATURE_EXTERNAL_INITIATORS" default:"false"` FeatureFluxMonitor bool `env:"FEATURE_FLUX_MONITOR" default:"true"` FeatureFluxMonitorV2 bool `env:"FEATURE_FLUX_MONITOR_V2" default:"false"` FeatureOffchainReporting bool `env:"FEATURE_OFFCHAIN_REPORTING" default:"false"` GlobalLockRetryInterval models.Duration `env:"GLOBAL_LOCK_RETRY_INTERVAL" default:"1s"` MaximumServiceDuration models.Duration `env:"MAXIMUM_SERVICE_DURATION" default:"8760h" ` MinimumServiceDuration models.Duration `env:"MINIMUM_SERVICE_DURATION" default:"0s" ` EthGasBumpThreshold uint64 `env:"ETH_GAS_BUMP_THRESHOLD"` EthGasBumpWei big.Int `env:"ETH_GAS_BUMP_WEI"` EthGasBumpPercent uint16 `env:"ETH_GAS_BUMP_PERCENT" default:"20"` EthGasBumpTxDepth uint16 `env:"ETH_GAS_BUMP_TX_DEPTH" default:"10"` EthGasLimitDefault uint64 `env:"ETH_GAS_LIMIT_DEFAULT" default:"500000"` EthGasPriceDefault big.Int `env:"ETH_GAS_PRICE_DEFAULT"` EthMaxGasPriceWei big.Int `env:"ETH_MAX_GAS_PRICE_WEI"` EthMaxUnconfirmedTransactions uint64 `env:"ETH_MAX_UNCONFIRMED_TRANSACTIONS" default:"500"` EthNonceAutoSync bool `env:"ETH_NONCE_AUTO_SYNC" default:"true"` EthFinalityDepth uint `env:"ETH_FINALITY_DEPTH"` EthHeadTrackerHistoryDepth uint `env:"ETH_HEAD_TRACKER_HISTORY_DEPTH"` EthHeadTrackerMaxBufferSize uint `env:"ETH_HEAD_TRACKER_MAX_BUFFER_SIZE" default:"3"` EthBalanceMonitorBlockDelay uint16 `env:"ETH_BALANCE_MONITOR_BLOCK_DELAY"` EthRPCDefaultBatchSize uint32 `env:"ETH_RPC_DEFAULT_BATCH_SIZE" default:"100"` EthTxResendAfterThreshold time.Duration `env:"ETH_TX_RESEND_AFTER_THRESHOLD"` EthLogBackfillBatchSize uint32 `env:"ETH_LOG_BACKFILL_BATCH_SIZE" default:"100"` EthereumURL string `env:"ETH_URL" default:"ws://localhost:8546"` EthereumSecondaryURL string `env:"ETH_SECONDARY_URL" default:""` EthereumSecondaryURLs string `env:"ETH_SECONDARY_URLS" default:""` EthereumDisabled bool `env:"ETH_DISABLED" default:"false"` FlagsContractAddress string `env:"FLAGS_CONTRACT_ADDRESS"` GasUpdaterBatchSize uint32 `env:"GAS_UPDATER_BATCH_SIZE"` GasUpdaterBlockDelay uint16 `env:"GAS_UPDATER_BLOCK_DELAY"` GasUpdaterBlockHistorySize uint16 `env:"GAS_UPDATER_BLOCK_HISTORY_SIZE"` GasUpdaterTransactionPercentile uint16 `env:"GAS_UPDATER_TRANSACTION_PERCENTILE" default:"60"` GasUpdaterEnabled bool `env:"GAS_UPDATER_ENABLED" default:"true"` HeadTimeBudget time.Duration `env:"HEAD_TIME_BUDGET"` InsecureFastScrypt bool `env:"INSECURE_FAST_SCRYPT" default:"false"` JobPipelineMaxRunDuration time.Duration `env:"JOB_PIPELINE_MAX_RUN_DURATION" default:"10m"` JobPipelineResultWriteQueueDepth uint64 `env:"JOB_PIPELINE_RESULT_WRITE_QUEUE_DEPTH" default:"100"` JobPipelineReaperInterval time.Duration `env:"JOB_PIPELINE_REAPER_INTERVAL" default:"1h"` JobPipelineReaperThreshold time.Duration `env:"JOB_PIPELINE_REAPER_THRESHOLD" default:"24h"` JSONConsole bool `env:"JSON_CONSOLE" default:"false"` KeeperRegistrySyncInterval time.Duration `env:"KEEPER_REGISTRY_SYNC_INTERVAL" default:"30m"` KeeperMinimumRequiredConfirmations uint64 `env:"KEEPER_MINIMUM_REQUIRED_CONFIRMATIONS" default:"12"` KeeperMaximumGracePeriod int64 `env:"KEEPER_MAXIMUM_GRACE_PERIOD" default:"100"` LinkContractAddress string `env:"LINK_CONTRACT_ADDRESS" default:"0x514910771AF9Ca656af840dff83E8264EcF986CA"` ExplorerURL *url.URL `env:"EXPLORER_URL"` ExplorerAccessKey string `env:"EXPLORER_ACCESS_KEY"` ExplorerSecret string `env:"EXPLORER_SECRET"` LogLevel LogLevel `env:"LOG_LEVEL" default:"info"` LogToDisk bool `env:"LOG_TO_DISK" default:"true"` LogSQLStatements bool `env:"LOG_SQL" default:"false"` LogSQLMigrations bool `env:"LOG_SQL_MIGRATIONS" default:"true"` DefaultMaxHTTPAttempts uint `env:"MAX_HTTP_ATTEMPTS" default:"5"` MigrateDatabase bool `env:"MIGRATE_DATABASE" default:"true"` MinIncomingConfirmations uint32 `env:"MIN_INCOMING_CONFIRMATIONS"` MinRequiredOutgoingConfirmations uint64 `env:"MIN_OUTGOING_CONFIRMATIONS"` MinimumContractPayment assets.Link `env:"MINIMUM_CONTRACT_PAYMENT" default:"1000000000000000000"` MinimumRequestExpiration uint64 `env:"MINIMUM_REQUEST_EXPIRATION" default:"300"` OCRObservationTimeout time.Duration `env:"OCR_OBSERVATION_TIMEOUT" default:"12s"` OCRObservationGracePeriod time.Duration `env:"OCR_OBSERVATION_GRACE_PERIOD" default:"1s"` OCRBlockchainTimeout time.Duration `env:"OCR_BLOCKCHAIN_TIMEOUT" default:"20s"` OCRContractSubscribeInterval time.Duration `env:"OCR_CONTRACT_SUBSCRIBE_INTERVAL" default:"2m"` OCRContractPollInterval time.Duration `env:"OCR_CONTRACT_POLL_INTERVAL" default:"1m"` OCRContractConfirmations uint `env:"OCR_CONTRACT_CONFIRMATIONS" default:"3"` OCRBootstrapCheckInterval time.Duration `env:"OCR_BOOTSTRAP_CHECK_INTERVAL" default:"20s"` OCRContractTransmitterTransmitTimeout time.Duration `env:"OCR_CONTRACT_TRANSMITTER_TRANSMIT_TIMEOUT" default:"10s"` OCRTransmitterAddress string `env:"OCR_TRANSMITTER_ADDRESS"` OCRKeyBundleID string `env:"OCR_KEY_BUNDLE_ID"` OCRDatabaseTimeout time.Duration `env:"OCR_DATABASE_TIMEOUT" default:"10s"` OCRIncomingMessageBufferSize int `env:"OCR_INCOMING_MESSAGE_BUFFER_SIZE" default:"10"` OCROutgoingMessageBufferSize int `env:"OCR_OUTGOING_MESSAGE_BUFFER_SIZE" default:"10"` OCRNewStreamTimeout time.Duration `env:"OCR_NEW_STREAM_TIMEOUT" default:"10s"` OCRDHTLookupInterval int `env:"OCR_DHT_LOOKUP_INTERVAL" default:"10"` OCRTraceLogging bool `env:"OCR_TRACE_LOGGING" default:"false"` OCRMonitoringEndpoint string `env:"OCR_MONITORING_ENDPOINT"` OperatorContractAddress common.Address `env:"OPERATOR_CONTRACT_ADDRESS"` ORMMaxOpenConns int `env:"ORM_MAX_OPEN_CONNS" default:"20"` ORMMaxIdleConns int `env:"ORM_MAX_IDLE_CONNS" default:"10"` P2PAnnounceIP net.IP `env:"P2P_ANNOUNCE_IP"` P2PAnnouncePort uint16 `env:"P2P_ANNOUNCE_PORT"` P2PDHTAnnouncementCounterUserPrefix uint32 `env:"P2P_DHT_ANNOUNCEMENT_COUNTER_USER_PREFIX" default:"0"` P2PListenIP net.IP `env:"P2P_LISTEN_IP" default:"0.0.0.0"` P2PListenPort uint16 `env:"P2P_LISTEN_PORT"` P2PPeerstoreWriteInterval time.Duration `env:"P2P_PEERSTORE_WRITE_INTERVAL" default:"5m"` P2PPeerID models.PeerID `env:"P2P_PEER_ID"` P2PBootstrapPeers []string `env:"P2P_BOOTSTRAP_PEERS"` Port uint16 `env:"CHAINLINK_PORT" default:"6688"` ReaperExpiration models.Duration `env:"REAPER_EXPIRATION" default:"240h"` ReplayFromBlock int64 `env:"REPLAY_FROM_BLOCK" default:"-1"` RootDir string `env:"ROOT" default:"~/.chainlink"` SecureCookies bool `env:"SECURE_COOKIES" default:"true"` SessionTimeout models.Duration `env:"SESSION_TIMEOUT" default:"15m"` StatsPusherLogging string `env:"STATS_PUSHER_LOGGING" default:"false"` TriggerFallbackDBPollInterval time.Duration `env:"TRIGGER_FALLBACK_DB_POLL_INTERVAL" default:"30s"` TLSCertPath string `env:"TLS_CERT_PATH" ` TLSHost string `env:"CHAINLINK_TLS_HOST" ` TLSKeyPath string `env:"TLS_KEY_PATH" ` TLSPort uint16 `env:"CHAINLINK_TLS_PORT" default:"6689"` TLSRedirect bool `env:"CHAINLINK_TLS_REDIRECT" default:"false"` HTTPServerWriteTimeout time.Duration `env:"HTTP_SERVER_WRITE_TIMEOUT" default:"10s"` UnAuthenticatedRateLimit int64 `env:"UNAUTHENTICATED_RATE_LIMIT" default:"5"` UnAuthenticatedRateLimitPeriod time.Duration `env:"UNAUTHENTICATED_RATE_LIMIT_PERIOD" default:"20s"` }
ConfigSchema records the schema of configuration at the type level
type Connection ¶ added in v0.8.5
type Connection struct {
// contains filtered or unexported fields
}
Connection manages all of the possible database connection setup and config.
func NewConnection ¶ added in v0.8.5
func NewConnection(dialect dialects.DialectName, uri string, advisoryLockID int64, lockRetryInterval time.Duration, maxOpenConns, maxIdleConns int) (Connection, error)
NewConnection returns a Connection which holds all of the configuration necessary for managing the database connection.
type DatabaseBackupMode ¶ added in v0.10.4
type DatabaseBackupMode string
var ( DatabaseBackupModeNone DatabaseBackupMode = "none" DatabaseBackupModeLite DatabaseBackupMode = "lite" DatabaseBackupModeFull DatabaseBackupMode = "full" )
type LockingStrategy ¶
type LockingStrategy interface { Lock(timeout models.Duration) error Unlock(timeout models.Duration) error }
LockingStrategy employs the locking and unlocking of an underlying resource for exclusive access, usually a file or database.
func NewLockingStrategy ¶
func NewLockingStrategy(ct Connection) (LockingStrategy, error)
NewLockingStrategy returns the locking strategy for a particular dialect to ensure exlusive access to the orm.
func NewPostgresLockingStrategy ¶
func NewPostgresLockingStrategy(ct Connection) (LockingStrategy, error)
NewPostgresLockingStrategy returns a new instance of the PostgresLockingStrategy.
type ORM ¶
ORM contains the database object used by Chainlink.
func NewORM ¶
func NewORM(uri string, timeout models.Duration, shutdownSignal gracefulpanic.Signal, dialect dialects.DialectName, advisoryLockID int64, lockRetryInterval time.Duration, maxOpenConns, maxIdleConns int) (*ORM, error)
NewORM initializes the orm with the configured uri
func (*ORM) AllKeys ¶ added in v0.9.0
AllKeys returns all of the keys recorded in the database including the funding key. You should use SendKeys() to retrieve all but the funding keys.
func (*ORM) AnyJobWithType ¶
AnyJobWithType returns true if there is at least one job associated with the type name specified and false otherwise
func (*ORM) ArchiveEncryptedSecretVRFKey ¶ added in v0.9.3
func (orm *ORM) ArchiveEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
ArchiveEncryptedVRFKey soft-deletes k from the encrypted keys table, or errors
func (*ORM) ArchiveJob ¶
ArchiveJob soft deletes the job, job_runs and its initiator. It is idempotent, subsequent runs will do nothing and return no error
func (*ORM) AuthorizedUserWithSession ¶
func (orm *ORM) AuthorizedUserWithSession(sessionID string, sessionDuration time.Duration) (models.User, error)
AuthorizedUserWithSession will return the one API user if the Session ID exists and hasn't expired, and update session's LastUsed field.
func (*ORM) BridgeTypes ¶
BridgeTypes returns bridge types ordered by name filtered limited by the passed params.
func (*ORM) BulkDeleteRuns ¶
func (orm *ORM) BulkDeleteRuns(bulkQuery *models.BulkDeleteRunRequest) error
BulkDeleteRuns removes JobRuns and their related records: TaskRuns and RunResults.
RunResults and RunRequests are pointed at by JobRuns so we must use two CTEs to remove both parents in one hit.
TaskRuns are removed by ON DELETE CASCADE when the JobRuns and RunResults are deleted.
func (*ORM) Chain ¶ added in v0.8.5
Chain return the chain of heads starting at hash and up to lookback parents Returns RecordNotFound if no head with the given hash exists
func (*ORM) ClearNonCurrentSessions ¶
ClearNonCurrentSessions removes all sessions but the id passed in.
func (*ORM) ClearSessions ¶
ClearSessions removes all sessions.
func (*ORM) ClobberDiskKeyStoreWithDBKeys ¶
ClobberDiskKeyStoreWithDBKeys writes all keys stored in the orm to the keys folder on disk, deleting anything there prior.
func (*ORM) CreateBridgeType ¶
func (orm *ORM) CreateBridgeType(bt *models.BridgeType) error
CreateBridgeType saves the bridge type.
func (*ORM) CreateExternalInitiator ¶
func (orm *ORM) CreateExternalInitiator(externalInitiator *models.ExternalInitiator) error
CreateExternalInitiator inserts a new external initiator
func (*ORM) CreateInitiator ¶
CreateInitiator saves the initiator.
func (*ORM) CreateJobRun ¶
CreateJobRun inserts a new JobRun
func (*ORM) CreateKeyIfNotExists ¶ added in v0.8.12
CreateKeyIfNotExists inserts a key if a key with that address doesn't exist already If a key with this address exists, it does nothing
func (*ORM) CreateServiceAgreement ¶
func (orm *ORM) CreateServiceAgreement(sa *models.ServiceAgreement) error
CreateServiceAgreement saves a Service Agreement, its JobSpec and its associations to the database.
func (*ORM) CreateSession ¶
func (orm *ORM) CreateSession(sr models.SessionRequest) (string, error)
CreateSession will check the password in the SessionRequest against the hashed API User password in the db.
func (*ORM) DeleteBridgeType ¶
func (orm *ORM) DeleteBridgeType(bt *models.BridgeType) error
DeleteBridgeType removes the bridge type
func (*ORM) DeleteEncryptedSecretVRFKey ¶ added in v0.8.2
func (orm *ORM) DeleteEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
DeleteEncryptedVRFKey deletes k from the encrypted keys table, or errors
func (*ORM) DeleteExternalInitiator ¶
DeleteExternalInitiator removes an external initiator
func (*ORM) DeleteFluxMonitorRoundsBackThrough ¶ added in v0.8.7
DeleteFluxMonitorRoundsBackThrough deletes all the RoundStat records for a given oracle address starting from the most recent round back through the given round
func (*ORM) DeleteJobSpecError ¶ added in v0.8.9
DeleteJobSpecError removes a JobSpecError
func (*ORM) DeleteKey ¶ added in v0.8.4
DeleteKey deletes a key whose address matches the supplied bytes.
func (*ORM) DeleteStaleSessions ¶
DeleteStaleSessions deletes all sessions before the passed time.
func (*ORM) DeleteUser ¶
DeleteUser will delete the API User in the db.
func (*ORM) DeleteUserSession ¶
DeleteUserSession will erase the session ID for the sole API User.
func (*ORM) EthTransactionsWithAttempts ¶ added in v0.9.6
EthTransactionsWithAttempts returns all eth transactions with at least one attempt limited by passed parameters. Attempts are sorted by created_at.
func (*ORM) EthTxAttempts ¶ added in v0.9.6
EthTxAttempts returns the last tx attempts sorted by created_at descending.
func (*ORM) FindBridge ¶
FindBridge looks up a Bridge by its Name.
func (*ORM) FindBridgesByNames ¶ added in v0.8.2
func (orm *ORM) FindBridgesByNames(names []string) ([]models.BridgeType, error)
FindBridgesByNames finds multiple bridges by their names.
func (*ORM) FindEncryptedSecretVRFKeys ¶ added in v0.8.2
func (orm *ORM) FindEncryptedSecretVRFKeys(where ...vrfkey.EncryptedVRFKey) ( retrieved []*vrfkey.EncryptedVRFKey, err error)
FindEncryptedVRFKeys retrieves matches to where from the encrypted keys table, or errors
func (*ORM) FindEthTaskRunTxByTaskRunID ¶ added in v0.8.7
FindEthTaskRunTxByTaskRunID finds the EthTaskRunTx with its EthTxes and EthTxAttempts preloaded
func (*ORM) FindEthTxAttempt ¶ added in v0.9.6
FindEthTxAttempt returns an individual EthTxAttempt
func (*ORM) FindEthTxWithAttempts ¶ added in v0.8.7
FindEthTxWithAttempts finds the EthTx with its attempts and receipts preloaded
func (*ORM) FindExternalInitiator ¶
FindExternalInitiator finds an external initiator given an authentication request
func (*ORM) FindExternalInitiatorByName ¶ added in v0.6.6
func (orm *ORM) FindExternalInitiatorByName(iname string) (exi models.ExternalInitiator, err error)
FindExternalInitiatorByName finds an external initiator given an authentication request
func (*ORM) FindInitiator ¶
FindInitiator returns the single initiator defined by the passed ID.
func (*ORM) FindJobIDsWithBridge ¶ added in v0.10.3
func (*ORM) FindJobRun ¶
FindJobRun looks up a JobRun by its ID.
func (*ORM) FindJobRunIncludingArchived ¶ added in v0.10.0
func (*ORM) FindJobSpec ¶ added in v0.9.7
FindJob looks up a JobSpec by its ID.
func (*ORM) FindJobSpecError ¶ added in v0.8.9
func (orm *ORM) FindJobSpecError(jobID models.JobID, description string) (*models.JobSpecError, error)
FindJobSpecError looks for a JobSpecError record with the given jobID and description
func (*ORM) FindJobSpecUnscoped ¶ added in v0.10.0
func (*ORM) FindJobWithErrors ¶ added in v0.8.9
FindJobWithErrors looks up a Job by its ID and preloads JobSpecErrors.
func (*ORM) FindLatestNodeVersion ¶ added in v0.10.4
func (orm *ORM) FindLatestNodeVersion() (*models.NodeVersion, error)
FindLatestNodeVersion looks up the latest node version
func (*ORM) FindOrCreateFluxMonitorRoundStats ¶ added in v0.8.7
func (orm *ORM) FindOrCreateFluxMonitorRoundStats(aggregator common.Address, roundID uint32) (stats models.FluxMonitorRoundStats, err error)
FindOrCreateFluxMonitorRoundStats find the round stats record for a given oracle on a given round, or creates it if no record exists
func (*ORM) FindServiceAgreement ¶
func (orm *ORM) FindServiceAgreement(id string) (sa models.ServiceAgreement, err error)
FindServiceAgreement looks up a ServiceAgreement by its ID.
func (*ORM) FirstOrCreateEncryptedSecretVRFKey ¶ added in v0.8.2
func (orm *ORM) FirstOrCreateEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
FirstOrCreateEncryptedVRFKey returns the first key found or creates a new one in the orm.
func (*ORM) GetConfigBoolValue ¶ added in v0.10.4
GetConfigBoolValue returns a boolean value for a named configuration entry
func (*ORM) GetConfigValue ¶ added in v0.6.6
func (orm *ORM) GetConfigValue(field string, value encoding.TextUnmarshaler) error
GetConfigValue returns the value for a named configuration entry
func (*ORM) GetRoundRobinAddress ¶ added in v0.8.11
func (orm *ORM) GetRoundRobinAddress(addresses ...common.Address) (address common.Address, err error)
GetRoundRobinAddress queries the database for the address of a random ethereum key derived from the id. This takes an optional param for a slice of addresses it should pick from. Leave empty to pick from all addresses in the database. NOTE: We can add more advanced logic here later such as sorting by priority etc
func (*ORM) HeadByHash ¶ added in v0.8.8
HeadByHash fetches the head with the given hash from the db, returns nil if none exists
func (*ORM) IdempotentInsertEthTaskRunTx ¶ added in v0.8.7
func (orm *ORM) IdempotentInsertEthTaskRunTx(taskRunID uuid.UUID, fromAddress common.Address, toAddress common.Address, encodedPayload []byte, gasLimit uint64) error
IdempotentInsertEthTaskRunTx creates both eth_task_run_transaction and eth_tx in one hit It can be called multiple times without error as long as the outcome would have resulted in the same database state
func (*ORM) IdempotentInsertHead ¶ added in v0.8.5
IdempotentInsertHead inserts a head only if the hash is new. Will do nothing if hash exists already. No advisory lock required because this is thread safe.
func (*ORM) JobRunsCountFor ¶
JobRunsCountFor returns the current number of runs for the job
func (*ORM) JobRunsCountForGivenStatus ¶ added in v0.10.5
func (*ORM) JobRunsFor ¶
JobRunsFor fetches all JobRuns with a given Job ID, sorted by their created at time.
func (*ORM) JobRunsSorted ¶
JobRunsSorted returns job runs ordered and filtered by the passed params.
func (*ORM) JobRunsSortedFor ¶
func (orm *ORM) JobRunsSortedFor(id models.JobID, order SortType, offset int, limit int) ([]models.JobRun, int, int, int, error)
JobRunsSortedFor returns job runs for a specific job spec ordered and filtered by the passed params.
func (*ORM) JobsSorted ¶
JobsSorted returns many JobSpecs sorted by CreatedAt from the store adhering to the passed parameters.
func (*ORM) KeyByAddress ¶ added in v0.8.11
KeyByAddress returns the key matching provided address
func (*ORM) KeyExists ¶ added in v0.8.7
KeyExists returns true if a key exists in the database for this address
func (*ORM) LastHead ¶
LastHead returns the head with the highest number. In the case of ties (e.g. due to re-org) it returns the most recently seen head entry.
func (*ORM) LinkEarnedFor ¶ added in v0.6.6
LinkEarnedFor shows the total link earnings for a job
func (*ORM) MostRecentFluxMonitorRoundID ¶ added in v0.8.7
MostRecentFluxMonitorRoundID finds roundID of the most recent round that the provided oracle address submitted to
func (*ORM) MustEnsureAdvisoryLock ¶ added in v0.8.2
MustEnsureAdvisoryLock sends a shutdown signal to the ORM if it an advisory lock cannot be acquired.
func (*ORM) PendingBridgeType ¶
PendingBridgeType returns the bridge type of the current pending task, or error if not pending bridge.
func (*ORM) RawDBWithAdvisoryLock ¶ added in v0.10.3
func (*ORM) RemoveUnstartedTransactions ¶ added in v0.9.3
func (*ORM) SaveJobRun ¶
SaveJobRun updates UpdatedAt for a JobRun and updates its status, finished at and run results. It auto-inserts run results if none are existing already for the given jobrun/taskruns.
func (*ORM) SaveSession ¶
SaveSession saves the session.
func (*ORM) SendKeys ¶ added in v0.9.0
SendKeys will return only the keys that are not is_funding=true.
func (*ORM) SetConfigStrValue ¶ added in v0.10.4
SetConfigValue returns the value for a named configuration entry
func (*ORM) SetConfigValue ¶ added in v0.6.6
func (orm *ORM) SetConfigValue(field string, value encoding.TextMarshaler) error
SetConfigValue returns the value for a named configuration entry
func (*ORM) SetLogging ¶ added in v0.6.1
SetLogging turns on SQL statement logging
func (*ORM) Transaction ¶ added in v0.8.7
func (*ORM) TrimOldHeads ¶ added in v0.8.5
TrimOldHeads deletes heads such that only the top N block numbers remain
func (*ORM) Unscoped ¶
Unscoped returns a new instance of this ORM that includes soft deleted items.
func (*ORM) UnscopedJobRunsWithStatus ¶
func (orm *ORM) UnscopedJobRunsWithStatus(cb func(*models.JobRun), statuses ...models.RunStatus) error
UnscopedJobRunsWithStatus passes all JobRuns to a callback, one by one, including those that were soft deleted.
func (*ORM) UpdateBridgeType ¶
func (orm *ORM) UpdateBridgeType(bt *models.BridgeType, btr *models.BridgeTypeRequest) error
UpdateBridgeType updates the bridge type.
func (*ORM) UpdateFluxMonitorRoundStats ¶ added in v0.8.13
func (orm *ORM) UpdateFluxMonitorRoundStats(aggregator common.Address, roundID uint32, jobRunID uuid.UUID) error
UpdateFluxMonitorRoundStats trys to create a RoundStat record for the given oracle at the given round. If one already exists, it increments the num_submissions column.
func (*ORM) UpsertErrorFor ¶ added in v0.8.9
UpsertErrorFor upserts a JobSpecError record, incrementing the occurrences counter by 1 if the record is found
func (*ORM) UpsertNodeVersion ¶ added in v0.10.4
func (orm *ORM) UpsertNodeVersion(version models.NodeVersion) error
UpsertNodeVersion inserts a new NodeVersion
type PostgresLockingStrategy ¶
type PostgresLockingStrategy struct {
// contains filtered or unexported fields
}
PostgresLockingStrategy uses a postgres advisory lock to ensure exclusive access.
type SecretGenerator ¶ added in v0.6.6
SecretGenerator is the interface for objects that generate a secret used to sign or encrypt.