Documentation ¶
Index ¶
- Variables
- func EnvVarName(field string) string
- type ConfigSchema
- type DatabaseBackupMode
- type EVMConfig
- type EVMOnlyConfig
- type FilePersistedSecretGenerator
- type GeneralConfig
- type LogLevel
- type ORM
- func (orm *ORM) GetConfigBoolValue(field string) (*bool, error)
- func (orm *ORM) GetConfigValue(field string, value encoding.TextUnmarshaler) error
- func (orm *ORM) SetConfigStrValue(ctx context.Context, field string, value string) error
- func (orm *ORM) SetConfigValue(field string, value encoding.TextMarshaler) error
- type SecretGenerator
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnset = errors.New("env var unset") ErrInvalid = errors.New("env var invalid") )
Functions ¶
func EnvVarName ¶
EnvVarName gets the environment variable name for a config schema field
Types ¶
type ConfigSchema ¶
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 uint64 `env:"BLOCK_BACKFILL_DEPTH" default:"10"` BlockBackfillSkip bool `env:"BLOCK_BACKFILL_SKIP" default:"false"` BlockHistoryEstimatorBatchSize uint32 `env:"BLOCK_HISTORY_ESTIMATOR_BATCH_SIZE"` BlockHistoryEstimatorBlockDelay uint16 `env:"BLOCK_HISTORY_ESTIMATOR_BLOCK_DELAY"` BlockHistoryEstimatorBlockHistorySize uint16 `env:"BLOCK_HISTORY_ESTIMATOR_BLOCK_HISTORY_SIZE"` BlockHistoryEstimatorTransactionPercentile uint16 `env:"BLOCK_HISTORY_ESTIMATOR_TRANSACTION_PERCENTILE"` 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"` DatabaseBackupDir string `env:"DATABASE_BACKUP_DIR" default:""` DatabaseBackupFrequency time.Duration `env:"DATABASE_BACKUP_FREQUENCY" default:"1h"` DatabaseBackupMode string `env:"DATABASE_BACKUP_MODE" default:"none"` DatabaseBackupURL *url.URL `env:"DATABASE_BACKUP_URL" default:""` DatabaseListenerMaxReconnectDuration time.Duration `env:"DATABASE_LISTENER_MAX_RECONNECT_DURATION" default:"10m"` DatabaseListenerMinReconnectInterval time.Duration `env:"DATABASE_LISTENER_MIN_RECONNECT_INTERVAL" default:"1m"` DatabaseMaximumTxDuration time.Duration `env:"DATABASE_MAXIMUM_TX_DURATION" default:"30m"` DatabaseTimeout models.Duration `env:"DATABASE_TIMEOUT" default:"0"` DatabaseURL string `env:"DATABASE_URL"` DefaultHTTPAllowUnrestrictedNetworkAccess bool `env:"DEFAULT_HTTP_ALLOW_UNRESTRICTED_NETWORK_ACCESS" default:"false"` DefaultHTTPLimit int64 `env:"DEFAULT_HTTP_LIMIT" default:"32768"` DefaultHTTPTimeout models.Duration `env:"DEFAULT_HTTP_TIMEOUT" default:"15s"` DefaultMaxHTTPAttempts uint `env:"MAX_HTTP_ATTEMPTS" default:"5"` Dev bool `env:"CHAINLINK_DEV" default:"false"` EthereumDisabled bool `env:"ETH_DISABLED" default:"false"` EthereumHTTPURL string `env:"ETH_HTTP_URL"` EthereumSecondaryURL string `env:"ETH_SECONDARY_URL" default:""` EthereumSecondaryURLs string `env:"ETH_SECONDARY_URLS" default:""` EthereumURL string `env:"ETH_URL" default:"ws://localhost:8546"` // TODO: EvmGasPriceDefault left only for compatibility with old way of saving config, will be removed in: // https://app.clubhouse.io/chainlinklabs/story/12739/generalise-necessary-models-tables-on-the-send-side-to-support-the-concept-of-multiple-chains EvmGasPriceDefault string `env:"ETH_GAS_PRICE_DEFAULT"` ExplorerAccessKey string `env:"EXPLORER_ACCESS_KEY"` ExplorerSecret string `env:"EXPLORER_SECRET"` ExplorerURL *url.URL `env:"EXPLORER_URL"` FMDefaultTransactionQueueDepth uint32 `env:"FM_DEFAULT_TRANSACTION_QUEUE_DEPTH" default:"1"` FeatureCronV2 bool `env:"FEATURE_CRON_V2" default:"true"` FeatureExternalInitiators bool `env:"FEATURE_EXTERNAL_INITIATORS" default:"false"` FeatureFluxMonitorV2 bool `env:"FEATURE_FLUX_MONITOR_V2" default:"true"` FeatureOffchainReporting bool `env:"FEATURE_OFFCHAIN_REPORTING" default:"false"` FeatureUICSAKeys bool `env:"FEATURE_UI_CSA_KEYS" default:"false"` FeatureUIFeedsManager bool `env:"FEATURE_UI_FEEDS_MANAGER" default:"false"` FeatureWebhookV2 bool `env:"FEATURE_WEBHOOK_V2" default:"false"` GasEstimatorMode string `env:"GAS_ESTIMATOR_MODE"` GasUpdaterBatchSize uint32 `env:"GAS_UPDATER_BATCH_SIZE"` GasUpdaterBlockDelay uint16 `env:"GAS_UPDATER_BLOCK_DELAY"` GasUpdaterBlockHistorySize uint16 `env:"GAS_UPDATER_BLOCK_HISTORY_SIZE"` GasUpdaterEnabled bool `env:"GAS_UPDATER_ENABLED"` GasUpdaterTransactionPercentile uint16 `env:"GAS_UPDATER_TRANSACTION_PERCENTILE" default:"60"` GlobalLockRetryInterval models.Duration `env:"GLOBAL_LOCK_RETRY_INTERVAL" default:"1s"` HTTPServerWriteTimeout time.Duration `env:"HTTP_SERVER_WRITE_TIMEOUT" default:"10s"` InsecureFastScrypt bool `env:"INSECURE_FAST_SCRYPT" default:"false"` InsecureSkipVerify bool `env:"INSECURE_SKIP_VERIFY" default:"false"` JSONConsole bool `env:"JSON_CONSOLE" default:"false"` JobPipelineMaxRunDuration time.Duration `env:"JOB_PIPELINE_MAX_RUN_DURATION" default:"10m"` JobPipelineReaperInterval time.Duration `env:"JOB_PIPELINE_REAPER_INTERVAL" default:"1h"` JobPipelineReaperThreshold time.Duration `env:"JOB_PIPELINE_REAPER_THRESHOLD" default:"24h"` JobPipelineResultWriteQueueDepth uint64 `env:"JOB_PIPELINE_RESULT_WRITE_QUEUE_DEPTH" default:"100"` KeeperDefaultTransactionQueueDepth uint32 `env:"KEEPER_DEFAULT_TRANSACTION_QUEUE_DEPTH" default:"1"` KeeperMaximumGracePeriod int64 `env:"KEEPER_MAXIMUM_GRACE_PERIOD" default:"100"` KeeperMinimumRequiredConfirmations uint64 `env:"KEEPER_MINIMUM_REQUIRED_CONFIRMATIONS" default:"12"` KeeperRegistryCheckGasOverhead uint64 `env:"KEEPER_REGISTRY_CHECK_GAS_OVERHEAD" default:"200000"` KeeperRegistryPerformGasOverhead uint64 `env:"KEEPER_REGISTRY_PERFORM_GAS_OVERHEAD" default:"150000"` KeeperRegistrySyncInterval time.Duration `env:"KEEPER_REGISTRY_SYNC_INTERVAL" default:"30m"` Layer2Type string `env:"LAYER_2_TYPE"` LinkContractAddress string `env:"LINK_CONTRACT_ADDRESS"` FlagsContractAddress string `env:"FLAGS_CONTRACT_ADDRESS"` LogLevel LogLevel `env:"LOG_LEVEL" default:"info"` LogSQLMigrations bool `env:"LOG_SQL_MIGRATIONS" default:"true"` LogSQLStatements bool `env:"LOG_SQL" default:"false"` LogToDisk bool `env:"LOG_TO_DISK" default:"true"` 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_LINK_JUELS"` OCRBlockchainTimeout time.Duration `env:"OCR_BLOCKCHAIN_TIMEOUT" default:"20s"` OCRBootstrapCheckInterval time.Duration `env:"OCR_BOOTSTRAP_CHECK_INTERVAL" default:"20s"` OCRContractConfirmations uint `env:"OCR_CONTRACT_CONFIRMATIONS"` OCRContractPollInterval time.Duration `env:"OCR_CONTRACT_POLL_INTERVAL" default:"1m"` OCRContractSubscribeInterval time.Duration `env:"OCR_CONTRACT_SUBSCRIBE_INTERVAL" default:"2m"` OCRContractTransmitterTransmitTimeout time.Duration `env:"OCR_CONTRACT_TRANSMITTER_TRANSMIT_TIMEOUT" default:"10s"` OCRDHTLookupInterval int `env:"OCR_DHT_LOOKUP_INTERVAL" default:"10"` OCRDatabaseTimeout time.Duration `env:"OCR_DATABASE_TIMEOUT" default:"10s"` OCRDefaultTransactionQueueDepth uint32 `env:"OCR_DEFAULT_TRANSACTION_QUEUE_DEPTH" default:"1"` OCRIncomingMessageBufferSize int `env:"OCR_INCOMING_MESSAGE_BUFFER_SIZE" default:"10"` OCRKeyBundleID string `env:"OCR_KEY_BUNDLE_ID"` OCRMonitoringEndpoint string `env:"OCR_MONITORING_ENDPOINT"` OCRNewStreamTimeout time.Duration `env:"OCR_NEW_STREAM_TIMEOUT" default:"10s"` OCRObservationGracePeriod time.Duration `env:"OCR_OBSERVATION_GRACE_PERIOD" default:"1s"` OCRObservationTimeout time.Duration `env:"OCR_OBSERVATION_TIMEOUT" default:"12s"` OCROutgoingMessageBufferSize int `env:"OCR_OUTGOING_MESSAGE_BUFFER_SIZE" default:"10"` OCRTraceLogging bool `env:"OCR_TRACE_LOGGING" default:"false"` OCRTransmitterAddress string `env:"OCR_TRANSMITTER_ADDRESS"` ORMMaxIdleConns int `env:"ORM_MAX_IDLE_CONNS" default:"10"` ORMMaxOpenConns int `env:"ORM_MAX_OPEN_CONNS" default:"20"` P2PAnnounceIP net.IP `env:"P2P_ANNOUNCE_IP"` P2PAnnouncePort uint16 `env:"P2P_ANNOUNCE_PORT"` P2PBootstrapPeers []string `env:"P2P_BOOTSTRAP_PEERS"` 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"` P2PNetworkingStack ocrnetworking.NetworkingStack `env:"P2P_NETWORKING_STACK" default:"V1"` P2PPeerID p2pkey.PeerID `env:"P2P_PEER_ID"` P2PPeerstoreWriteInterval time.Duration `env:"P2P_PEERSTORE_WRITE_INTERVAL" default:"5m"` P2PV2AnnounceAddresses []string `env:"P2PV2_ANNOUNCE_ADDRESSES"` P2PV2Bootstrappers []string `env:"P2PV2_BOOTSTRAPPERS"` P2PV2DeltaDial models.Duration `env:"P2PV2_DELTA_DIAL" default:"15s"` P2PV2DeltaReconcile models.Duration `env:"P2PV2_DELTA_RECONCILE" default:"1m"` P2PV2ListenAddresses []string `env:"P2PV2_LISTEN_ADDRESSES"` 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"` TelemetryIngressLogging bool `env:"TELEMETRY_INGRESS_LOGGING" default:"false"` TelemetryIngressServerPubKey string `env:"TELEMETRY_INGRESS_SERVER_PUB_KEY"` TelemetryIngressURL *url.URL `env:"TELEMETRY_INGRESS_URL"` 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"` TriggerFallbackDBPollInterval time.Duration `env:"TRIGGER_FALLBACK_DB_POLL_INTERVAL" default:"30s"` 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 DatabaseBackupMode ¶
type DatabaseBackupMode string
var ( DatabaseBackupModeNone DatabaseBackupMode = "none" DatabaseBackupModeLite DatabaseBackupMode = "lite" DatabaseBackupModeFull DatabaseBackupMode = "full" )
type EVMConfig ¶ added in v1.0.0
type EVMConfig interface { GeneralConfig EVMOnlyConfig }
EVMConfig contains configuration values specific to a particular chain
func NewEVMConfig ¶ added in v1.0.0
func NewEVMConfig(cfg GeneralConfig) EVMConfig
type EVMOnlyConfig ¶ added in v1.0.0
type EVMOnlyConfig interface { BalanceMonitorEnabled() bool BlockEmissionIdleWarningThreshold() time.Duration BlockHistoryEstimatorBatchSize() (size uint32) BlockHistoryEstimatorBlockDelay() uint16 BlockHistoryEstimatorBlockHistorySize() uint16 BlockHistoryEstimatorTransactionPercentile() uint16 EthTxReaperInterval() time.Duration EthTxReaperThreshold() time.Duration EthTxResendAfterThreshold() time.Duration EvmDefaultBatchSize() uint32 EvmFinalityDepth() uint EvmGasBumpPercent() uint16 EvmGasBumpThreshold() uint64 EvmGasBumpTxDepth() uint16 EvmGasBumpWei() *big.Int EvmGasLimitDefault() uint64 EvmGasLimitMultiplier() float32 EvmGasLimitTransfer() uint64 EvmGasPriceDefault() *big.Int EvmHeadTrackerHistoryDepth() uint EvmHeadTrackerMaxBufferSize() uint EvmHeadTrackerSamplingInterval() time.Duration EvmLogBackfillBatchSize() uint32 EvmMaxGasPriceWei() *big.Int EvmMaxInFlightTransactions() uint32 EvmMaxQueuedTransactions() uint64 EvmMinGasPriceWei() *big.Int EvmNonceAutoSync() bool EvmRPCDefaultBatchSize() uint32 FlagsContractAddress() string GasEstimatorMode() string LinkContractAddress() string MinIncomingConfirmations() uint32 MinRequiredOutgoingConfirmations() uint64 MinimumContractPayment() *assets.Link OCRContractConfirmations() uint16 SetEvmGasPriceDefault(value *big.Int) error Validate() error }
type FilePersistedSecretGenerator ¶ added in v1.0.0
type FilePersistedSecretGenerator struct{}
type GeneralConfig ¶ added in v1.0.0
type GeneralConfig interface { AdminCredentialsFile() string AllowOrigins() string AuthenticatedRateLimit() int64 AuthenticatedRateLimitPeriod() models.Duration BlockBackfillDepth() uint64 BlockBackfillSkip() bool BridgeResponseURL() *url.URL CertFile() string // FIXME: ChainID and Chain will be removed along with https://app.clubhouse.io/chainlinklabs/story/12739/generalise-necessary-models-tables-on-the-send-side-to-support-the-concept-of-multiple-chains Chain() *chains.Chain ChainID() *big.Int ClientNodeURL() string CreateProductionLogger() *logger.Logger DatabaseBackupDir() string DatabaseBackupFrequency() time.Duration DatabaseBackupMode() DatabaseBackupMode DatabaseBackupURL() *url.URL DatabaseListenerMaxReconnectDuration() time.Duration DatabaseListenerMinReconnectInterval() time.Duration HTTPServerWriteTimeout() time.Duration DatabaseMaximumTxDuration() time.Duration DatabaseTimeout() models.Duration DatabaseURL() url.URL DefaultHTTPAllowUnrestrictedNetworkAccess() bool DefaultHTTPLimit() int64 DefaultHTTPTimeout() models.Duration DefaultMaxHTTPAttempts() uint Dev() bool EthereumDisabled() bool EthereumHTTPURL() *url.URL EthereumSecondaryURLs() []url.URL EthereumURL() string ExplorerAccessKey() string ExplorerSecret() string ExplorerURL() *url.URL FMDefaultTransactionQueueDepth() uint32 FeatureCronV2() bool FeatureUICSAKeys() bool FeatureUIFeedsManager() bool FeatureExternalInitiators() bool FeatureFluxMonitorV2() bool FeatureOffchainReporting() bool FeatureWebhookV2() bool GetAdvisoryLockIDConfiguredOrDefault() int64 GetDatabaseDialectConfiguredOrDefault() dialects.DialectName GlobalLockRetryInterval() models.Duration InsecureFastScrypt() bool InsecureSkipVerify() bool JSONConsole() bool JobPipelineMaxRunDuration() time.Duration JobPipelineReaperInterval() time.Duration JobPipelineReaperThreshold() time.Duration JobPipelineResultWriteQueueDepth() uint64 KeeperDefaultTransactionQueueDepth() uint32 KeeperMaximumGracePeriod() int64 KeeperMinimumRequiredConfirmations() uint64 KeeperRegistryCheckGasOverhead() uint64 KeeperRegistryPerformGasOverhead() uint64 KeeperRegistrySyncInterval() time.Duration KeyFile() string Layer2Type() string LogLevel() LogLevel LogSQLMigrations() bool LogSQLStatements() bool LogToDisk() bool MigrateDatabase() bool OCRBlockchainTimeout() time.Duration OCRBootstrapCheckInterval() time.Duration OCRContractPollInterval() time.Duration OCRContractSubscribeInterval() time.Duration OCRContractTransmitterTransmitTimeout() time.Duration OCRDHTLookupInterval() int OCRDatabaseTimeout() time.Duration OCRDefaultTransactionQueueDepth() uint32 OCRIncomingMessageBufferSize() int OCRKeyBundleID() (string, error) OCRMonitoringEndpoint() string OCRNewStreamTimeout() time.Duration OCRObservationGracePeriod() time.Duration OCRObservationTimeout() time.Duration OCROutgoingMessageBufferSize() int OCRTraceLogging() bool OCRTransmitterAddress() (ethkey.EIP55Address, error) ORMMaxIdleConns() int ORMMaxOpenConns() int P2PAnnounceIP() net.IP P2PAnnouncePort() uint16 P2PBootstrapPeers() ([]string, error) P2PDHTAnnouncementCounterUserPrefix() uint32 P2PListenIP() net.IP P2PListenPort() uint16 P2PListenPortRaw() string P2PNetworkingStack() (n ocrnetworking.NetworkingStack) P2PNetworkingStackRaw() string P2PPeerID() p2pkey.PeerID P2PPeerIDRaw() string P2PPeerstoreWriteInterval() time.Duration P2PV2AnnounceAddresses() []string P2PV2AnnounceAddressesRaw() []string P2PV2Bootstrappers() (locators []ocrtypes.BootstrapperLocator) P2PV2BootstrappersRaw() []string P2PV2DeltaDial() models.Duration P2PV2DeltaReconcile() models.Duration P2PV2ListenAddresses() []string Port() uint16 ReaperExpiration() models.Duration ReplayFromBlock() int64 RootDir() string SecureCookies() bool SessionOptions() sessions.Options SessionSecret() ([]byte, error) SessionTimeout() models.Duration SetDB(*gorm.DB) SetLogLevel(ctx context.Context, value string) error SetLogSQLStatements(ctx context.Context, sqlEnabled bool) error SetDialect(dialects.DialectName) StatsPusherLogging() bool TelemetryIngressLogging() bool TelemetryIngressServerPubKey() string TelemetryIngressURL() *url.URL TLSCertPath() string TLSDir() string TLSHost() string TLSKeyPath() string TLSPort() uint16 TLSRedirect() bool TriggerFallbackDBPollInterval() time.Duration UnAuthenticatedRateLimit() int64 UnAuthenticatedRateLimitPeriod() models.Duration Validate() error }
func NewGeneralConfig ¶ added in v1.0.0
func NewGeneralConfig() GeneralConfig
NewGeneralConfig returns the config with the environment variables set to their respective fields, or their defaults if environment variables are not set. FIXME: It ought to take a DB
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
func (*ORM) GetConfigBoolValue ¶
GetConfigBoolValue returns a boolean value for a named configuration entry
func (*ORM) GetConfigValue ¶
func (orm *ORM) GetConfigValue(field string, value encoding.TextUnmarshaler) error
GetConfigValue returns the value for a named configuration entry
func (*ORM) SetConfigStrValue ¶
SetConfigValue returns the value for a named configuration entry
func (*ORM) SetConfigValue ¶
func (orm *ORM) SetConfigValue(field string, value encoding.TextMarshaler) error
SetConfigValue returns the value for a named configuration entry
type SecretGenerator ¶
SecretGenerator is the interface for objects that generate a secret used to sign or encrypt.