config

package
v2.1.0-beta0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEnvUnset = errors.New("env var unset")
)

nolint

View Source
var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{
	string(ChainArbitrum), string(ChainMetis), string(ChainOptimism), string(ChainXDai), string(ChainOptimismBedrock),
}, ", "))

Functions

func FriendlyBigInt

func FriendlyBigInt(n *big.Int) string

FriendlyBigInt returns a string printing the integer in both decimal and hexadecimal formats.

func ValidateDBURL

func ValidateDBURL(dbURI url.URL) error

Types

type BasicConfig

type BasicConfig interface {
	Validate() error
	LogConfiguration(log LogfFn)
	SetLogLevel(lvl zapcore.Level) error
	SetLogSQL(logSQL bool)
	SetPasswords(keystore, vrf *string)

	FeatureFlags
	audit.Config

	AllowOrigins() string
	AppID() uuid.UUID
	AuthenticatedRateLimit() int64
	AuthenticatedRateLimitPeriod() models.Duration
	AutoPprofBlockProfileRate() int
	AutoPprofCPUProfileRate() int
	AutoPprofGatherDuration() models.Duration
	AutoPprofGatherTraceDuration() models.Duration
	AutoPprofGoroutineThreshold() int
	AutoPprofMaxProfileSize() utils.FileSize
	AutoPprofMemProfileRate() int
	AutoPprofMemThreshold() utils.FileSize
	AutoPprofMutexProfileFraction() int
	AutoPprofPollInterval() models.Duration
	AutoPprofProfileRoot() string
	BridgeResponseURL() *url.URL
	BridgeCacheTTL() time.Duration
	CertFile() string
	DatabaseBackupDir() string
	DatabaseBackupFrequency() time.Duration
	DatabaseBackupMode() DatabaseBackupMode
	DatabaseBackupOnVersionUpgrade() bool
	DatabaseBackupURL() *url.URL
	DatabaseDefaultIdleInTxSessionTimeout() time.Duration
	DatabaseDefaultLockTimeout() time.Duration
	DatabaseDefaultQueryTimeout() time.Duration
	DatabaseListenerMaxReconnectDuration() time.Duration
	DatabaseListenerMinReconnectInterval() time.Duration
	DatabaseLockingMode() string
	DatabaseURL() url.URL
	DefaultChainID() *big.Int
	DefaultHTTPLimit() int64
	DefaultHTTPTimeout() models.Duration
	DefaultLogLevel() zapcore.Level
	Dev() bool
	ShutdownGracePeriod() time.Duration
	EthereumHTTPURL() *url.URL
	EthereumSecondaryURLs() []url.URL
	EthereumURL() string
	ExplorerAccessKey() string
	ExplorerSecret() string
	ExplorerURL() *url.URL
	FMDefaultTransactionQueueDepth() uint32
	FMSimulateTransactions() bool
	GetDatabaseDialectConfiguredOrDefault() dialects.DialectName
	HTTPServerWriteTimeout() time.Duration
	JSONConsole() bool
	JobPipelineMaxRunDuration() time.Duration
	JobPipelineMaxSuccessfulRuns() uint64
	JobPipelineReaperInterval() time.Duration
	JobPipelineReaperThreshold() time.Duration
	JobPipelineResultWriteQueueDepth() uint64
	KeeperDefaultTransactionQueueDepth() uint32
	KeeperGasPriceBufferPercent() uint16
	KeeperGasTipCapBufferPercent() uint16
	KeeperBaseFeeBufferPercent() uint16
	KeeperMaximumGracePeriod() int64
	KeeperRegistryCheckGasOverhead() uint32
	KeeperRegistryPerformGasOverhead() uint32
	KeeperRegistryMaxPerformDataSize() uint32
	KeeperRegistrySyncInterval() time.Duration
	KeeperRegistrySyncUpkeepQueueSize() uint32
	KeeperTurnLookBack() int64
	KeyFile() string
	KeystorePassword() string
	LeaseLockDuration() time.Duration
	LeaseLockRefreshInterval() time.Duration
	LogFileDir() string
	LogLevel() zapcore.Level
	LogSQL() bool
	LogFileMaxSize() utils.FileSize
	LogFileMaxAge() int64
	LogFileMaxBackups() int64
	LogUnixTimestamps() bool
	MigrateDatabase() bool
	ORMMaxIdleConns() int
	ORMMaxOpenConns() int
	Port() uint16
	PrometheusAuthToken() string
	PyroscopeAuthToken() string
	PyroscopeServerAddress() string
	PyroscopeEnvironment() string
	RPID() string
	RPOrigin() string
	ReaperExpiration() models.Duration
	RootDir() string
	SecureCookies() bool
	SentryDSN() string
	SentryDebug() bool
	SentryEnvironment() string
	SentryRelease() string
	SessionOptions() sessions.Options
	SessionTimeout() models.Duration
	TLSCertPath() string
	TLSDir() string
	TLSHost() string
	TLSKeyPath() string
	TLSPort() uint16
	TLSRedirect() bool
	TelemetryIngressLogging() bool
	TelemetryIngressUniConn() bool
	TelemetryIngressServerPubKey() string
	TelemetryIngressURL() *url.URL
	TelemetryIngressBufferSize() uint
	TelemetryIngressMaxBatchSize() uint
	TelemetryIngressSendInterval() time.Duration
	TelemetryIngressSendTimeout() time.Duration
	TelemetryIngressUseBatchSend() bool
	TriggerFallbackDBPollInterval() time.Duration
	UnAuthenticatedRateLimit() int64
	UnAuthenticatedRateLimitPeriod() models.Duration
	VRFPassword() string

	// Insecure config
	DevWebServer() bool
	InsecureFastScrypt() bool
	OCRDevelopmentMode() bool
	DisableRateLimiting() bool
	InfiniteDepthQueries() bool

	OCR1Config
	OCR2Config

	P2PNetworking
	P2PV1Networking
	P2PV2Networking
}

type ChainType

type ChainType string

ChainType denotes the chain or network to work with

const (
	ChainArbitrum        ChainType = "arbitrum"
	ChainMetis           ChainType = "metis"
	ChainOptimism        ChainType = "optimism"
	ChainOptimismBedrock ChainType = "optimismBedrock"
	ChainXDai            ChainType = "xdai"
)

nolint

func (ChainType) IsL2

func (c ChainType) IsL2() bool

IsL2 returns true if this chain is a Layer 2 chain. Notably:

  • the block numbers used for log searching are different from calling block.number
  • gas bumping is not supported, since there is no tx mempool

func (ChainType) IsValid

func (c ChainType) IsValid() bool

IsValid returns true if the ChainType value is known or empty.

type DatabaseBackupMode

type DatabaseBackupMode string
var (
	DatabaseBackupModeNone DatabaseBackupMode = "none"
	DatabaseBackupModeLite DatabaseBackupMode = "lite"
	DatabaseBackupModeFull DatabaseBackupMode = "full"
)

type FeatureFlags

type FeatureFlags interface {
	FeatureExternalInitiators() bool
	FeatureFeedsManager() bool
	FeatureOffchainReporting() bool
	FeatureOffchainReporting2() bool
	FeatureUICSAKeys() bool
	FeatureLogPoller() bool

	AutoPprofEnabled() bool
	EVMEnabled() bool
	EVMRPCEnabled() bool
	P2PEnabled() bool
	CosmosEnabled() bool
	SolanaEnabled() bool
	StarkNetEnabled() bool
}

FeatureFlags contains bools that toggle various features or chains TODO: document the new ones

type GeneralConfig

type GeneralConfig interface {
	BasicConfig
	ValidateDB() error
}

type LogfFn added in v2.1.0

type LogfFn func(string, ...any)

type OCR1Config

type OCR1Config interface {
	// OCR1 config, can override in jobs, only ethereum.
	OCRBlockchainTimeout() time.Duration
	OCRContractPollInterval() time.Duration
	OCRContractSubscribeInterval() time.Duration
	OCRKeyBundleID() (string, error)
	OCRObservationTimeout() time.Duration
	OCRSimulateTransactions() bool
	OCRTransmitterAddress() (ethkey.EIP55Address, error) // OCR2 can support non-evm changes
	// OCR1 config, cannot override in jobs
	OCRTraceLogging() bool
	OCRDefaultTransactionQueueDepth() uint32
	OCRCaptureEATelemetry() bool
}

OCR1Config is a subset of global config relevant to OCR v1.

type OCR2Config

type OCR2Config interface {
	// OCR2 config, can override in jobs, all chains
	OCR2ContractConfirmations() uint16
	OCR2ContractTransmitterTransmitTimeout() time.Duration
	OCR2BlockchainTimeout() time.Duration
	OCR2DatabaseTimeout() time.Duration
	OCR2ContractPollInterval() time.Duration
	OCR2ContractSubscribeInterval() time.Duration
	OCR2KeyBundleID() (string, error)
	// OCR2 config, cannot override in jobs
	OCR2TraceLogging() bool
	OCR2CaptureEATelemetry() bool
}

OCR2Config is a subset of global config relevant to OCR v2.

type P2PDeprecated

type P2PDeprecated interface {
	// contains filtered or unexported methods
}

type P2PNetworking

type P2PNetworking interface {
	P2PNetworkingStack() (n ocrnetworking.NetworkingStack)
	P2PNetworkingStackRaw() string
	P2PPeerID() p2pkey.PeerID
	P2PPeerIDRaw() string
	P2PIncomingMessageBufferSize() int
	P2POutgoingMessageBufferSize() int
}

P2PNetworking is a subset of global config relevant to p2p networking.

type P2PV1Networking

type P2PV1Networking interface {
	P2PAnnounceIP() net.IP
	P2PAnnouncePort() uint16
	P2PBootstrapPeers() ([]string, error)
	P2PDHTAnnouncementCounterUserPrefix() uint32
	P2PListenIP() net.IP
	P2PListenPort() uint16
	P2PListenPortRaw() string
	P2PNewStreamTimeout() time.Duration
	P2PBootstrapCheckInterval() time.Duration
	P2PDHTLookupInterval() int
	P2PPeerstoreWriteInterval() time.Duration
}

P2PV1Networking is a subset of global config relevant to p2p v1 networking.

type P2PV2Networking

type P2PV2Networking interface {
	P2PV2AnnounceAddresses() []string
	P2PV2Bootstrappers() (locators []ocrcommontypes.BootstrapperLocator)
	P2PV2BootstrappersRaw() []string
	P2PV2DeltaDial() models.Duration
	P2PV2DeltaReconcile() models.Duration
	P2PV2ListenAddresses() []string
}

P2PV2Networking is a subset of global config relevant to p2p v2 networking.

Directories

Path Synopsis
v2
docs/cmd/generate
Docs prints core node documentation and/or a list of errors.
Docs prints core node documentation and/or a list of errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL