config

package
v2.2.0-mercury-20230608 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 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.

Types

type AppConfig added in v2.2.0

type AppConfig interface {
	AppID() uuid.UUID
	RootDir() string
	ShutdownGracePeriod() time.Duration
	InsecureFastScrypt() bool

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

	Ethereum
	Explorer
	FeatureFlags
	Keystore
	OCR1Config
	OCR2Config
	P2PNetworking
	P2PV1Networking
	P2PV2Networking
	Prometheus
	Pyroscope
	Secrets

	Database() Database
	AuditLogger() AuditLogger
	Keeper() Keeper
	TelemetryIngress() TelemetryIngress
	Sentry() Sentry
	JobPipeline() JobPipeline
	Log() Log
	FluxMonitor() FluxMonitor
	WebServer() WebServer
	AutoPprof() AutoPprof
	Insecure() Insecure
}

type AuditLogger added in v2.3.0

type AuditLogger interface {
	Enabled() bool
	ForwardToUrl() (models.URL, error)
	Environment() string
	JsonWrapperKey() string
	Headers() (models.ServiceHeaders, error)
}

type AutoPprof added in v2.2.0

type AutoPprof interface {
	BlockProfileRate() int
	CPUProfileRate() int
	Enabled() bool
	GatherDuration() models.Duration
	GatherTraceDuration() models.Duration
	GoroutineThreshold() int
	MaxProfileSize() utils.FileSize
	MemProfileRate() int
	MemThreshold() utils.FileSize
	MutexProfileFraction() int
	PollInterval() models.Duration
	ProfileRoot() string
}

type Backup added in v2.3.0

type Backup interface {
	Dir() string
	Frequency() time.Duration
	Mode() DatabaseBackupMode
	OnVersionUpgrade() bool
	URL() *url.URL
}

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 Database added in v2.2.0

type Database interface {
	Backup() Backup
	Listener() Listener
	Lock() Lock

	DefaultIdleInTxSessionTimeout() time.Duration
	DefaultLockTimeout() time.Duration
	DefaultQueryTimeout() time.Duration
	Dialect() dialects.DialectName
	LogSQL() bool
	MaxIdleConns() int
	MaxOpenConns() int
	MigrateDatabase() bool
	URL() url.URL
}

type DatabaseBackupMode

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

type Ethereum added in v2.2.0

type Ethereum interface {
	EthereumHTTPURL() *url.URL
	EthereumSecondaryURLs() []url.URL
	EthereumURL() string
	DefaultChainID() *big.Int
}

type Explorer added in v2.2.0

type Explorer interface {
	ExplorerAccessKey() string
	ExplorerSecret() string
	ExplorerURL() *url.URL
}

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 File added in v2.3.0

type File interface {
	Dir() string
	MaxSize() utils.FileSize
	MaxAgeDays() int64
	MaxBackups() int64
}

type FluxMonitor added in v2.2.0

type FluxMonitor interface {
	DefaultTransactionQueueDepth() uint32
	SimulateTransactions() bool
}

type Insecure added in v2.2.0

type Insecure interface {
	DevWebServer() bool
	OCRDevelopmentMode() bool
	DisableRateLimiting() bool
	InfiniteDepthQueries() bool
}

type JobPipeline added in v2.2.0

type JobPipeline interface {
	DefaultHTTPLimit() int64
	DefaultHTTPTimeout() models.Duration
	MaxRunDuration() time.Duration
	MaxSuccessfulRuns() uint64
	ReaperInterval() time.Duration
	ReaperThreshold() time.Duration
	ResultWriteQueueDepth() uint64
	ExternalInitiatorsEnabled() bool
}

type Keeper added in v2.2.0

type Keeper interface {
	DefaultTransactionQueueDepth() uint32
	GasPriceBufferPercent() uint16
	GasTipCapBufferPercent() uint16
	BaseFeeBufferPercent() uint16
	MaxGracePeriod() int64
	TurnLookBack() int64
	Registry() Registry
}

type Keystore added in v2.2.0

type Keystore interface {
	KeystorePassword() string
}

type Listener added in v2.3.0

type Listener interface {
	MaxReconnectDuration() time.Duration
	MinReconnectInterval() time.Duration
	FallbackPollInterval() time.Duration
}

type Lock added in v2.3.0

type Lock interface {
	LockingMode() string
	LeaseDuration() time.Duration
	LeaseRefreshInterval() time.Duration
}

type Log added in v2.3.0

type Log interface {
	DefaultLevel() zapcore.Level
	JSONConsole() bool
	Level() zapcore.Level
	UnixTimestamps() bool

	File() File
}

type LogfFn added in v2.1.0

type LogfFn func(string, ...any)

type MFA added in v2.3.0

type MFA interface {
	RPID() string
	RPOrigin() string
}

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
	OCR2DefaultTransactionQueueDepth() uint32
	OCR2SimulateTransactions() 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.

type Prometheus added in v2.2.0

type Prometheus interface {
	PrometheusAuthToken() string
}

type Pyroscope added in v2.2.0

type Pyroscope interface {
	PyroscopeAuthToken() string
	PyroscopeServerAddress() string
	PyroscopeEnvironment() string
}

type RateLimit added in v2.3.0

type RateLimit interface {
	Authenticated() int64
	AuthenticatedPeriod() time.Duration
	Unauthenticated() int64
	UnauthenticatedPeriod() time.Duration
}

type Registry added in v2.3.0

type Registry interface {
	CheckGasOverhead() uint32
	PerformGasOverhead() uint32
	MaxPerformDataSize() uint32
	SyncInterval() time.Duration
	SyncUpkeepQueueSize() uint32
}

type Secrets added in v2.2.0

type Secrets interface {
	MercuryCredentials(credName string) *ocr2models.MercuryCredentials
	ThresholdKeyShare() string
	VRFPassword() string
}

type Sentry added in v2.2.0

type Sentry interface {
	DSN() string
	Debug() bool
	Environment() string
	Release() string
}

type TLS added in v2.3.0

type TLS interface {
	Dir() string
	Host() string
	ForceRedirect() bool
	CertFile() string
	KeyFile() string
	HTTPSPort() uint16
}

type TelemetryIngress added in v2.2.0

type TelemetryIngress interface {
	Logging() bool
	UniConn() bool
	ServerPubKey() string
	URL() *url.URL
	BufferSize() uint
	MaxBatchSize() uint
	SendInterval() time.Duration
	SendTimeout() time.Duration
	UseBatchSend() bool
}

type WebServer added in v2.3.0

type WebServer interface {
	AllowOrigins() string
	BridgeCacheTTL() time.Duration
	BridgeResponseURL() *url.URL
	HTTPMaxSize() int64
	StartTimeout() time.Duration
	HTTPWriteTimeout() time.Duration
	HTTPPort() uint16
	SessionReaperExpiration() models.Duration
	SecureCookies() bool
	SessionOptions() sessions.Options
	SessionTimeout() models.Duration

	TLS() TLS
	RateLimit() RateLimit
	MFA() MFA
}

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