toml

package
v2.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("unsupported with config v2")

Functions

This section is empty.

Types

type AuditLogger

type AuditLogger struct {
	Enabled        *bool
	ForwardToUrl   *models.URL
	JsonWrapperKey *string
	Headers        *[]models.ServiceHeader
}

func (*AuditLogger) SetFrom

func (p *AuditLogger) SetFrom(f *AuditLogger)

type AutoPprof

type AutoPprof struct {
	Enabled              *bool
	ProfileRoot          *string
	PollInterval         *models.Duration
	GatherDuration       *models.Duration
	GatherTraceDuration  *models.Duration
	MaxProfileSize       *utils.FileSize
	CPUProfileRate       *int64 // runtime.SetCPUProfileRate
	MemProfileRate       *int64 // runtime.MemProfileRate
	BlockProfileRate     *int64 // runtime.SetBlockProfileRate
	MutexProfileFraction *int64 // runtime.SetMutexProfileFraction
	MemThreshold         *utils.FileSize
	GoroutineThreshold   *int64
}

type Core

type Core struct {
	// General/misc
	AppID               uuid.UUID `toml:"-"` // random or test
	InsecureFastScrypt  *bool
	RootDir             *string
	ShutdownGracePeriod *models.Duration

	Feature          Feature          `toml:",omitempty"`
	Database         Database         `toml:",omitempty"`
	TelemetryIngress TelemetryIngress `toml:",omitempty"`
	AuditLogger      AuditLogger      `toml:",omitempty"`
	Log              Log              `toml:",omitempty"`
	WebServer        WebServer        `toml:",omitempty"`
	JobPipeline      JobPipeline      `toml:",omitempty"`
	FluxMonitor      FluxMonitor      `toml:",omitempty"`
	OCR2             OCR2             `toml:",omitempty"`
	OCR              OCR              `toml:",omitempty"`
	P2P              P2P              `toml:",omitempty"`
	Keeper           Keeper           `toml:",omitempty"`
	AutoPprof        AutoPprof        `toml:",omitempty"`
	Pyroscope        Pyroscope        `toml:",omitempty"`
	Sentry           Sentry           `toml:",omitempty"`
	Insecure         Insecure         `toml:",omitempty"`
	Tracing          Tracing          `toml:",omitempty"`
	Mercury          Mercury          `toml:",omitempty"`
}

Core holds the core configuration. See chainlink.Config for more information.

func (*Core) SetFrom

func (c *Core) SetFrom(f *Core)

SetFrom updates c with any non-nil values from f. (currently TOML field only!)

func (*Core) ValidateConfig

func (c *Core) ValidateConfig() (err error)

type Database

type Database struct {
	DefaultIdleInTxSessionTimeout *models.Duration
	DefaultLockTimeout            *models.Duration
	DefaultQueryTimeout           *models.Duration
	Dialect                       dialects.DialectName `toml:"-"`
	LogQueries                    *bool
	MaxIdleConns                  *int64
	MaxOpenConns                  *int64
	MigrateOnStartup              *bool

	Backup   DatabaseBackup   `toml:",omitempty"`
	Listener DatabaseListener `toml:",omitempty"`
	Lock     DatabaseLock     `toml:",omitempty"`
}

type DatabaseBackup

type DatabaseBackup struct {
	Dir              *string
	Frequency        *models.Duration
	Mode             *config.DatabaseBackupMode
	OnVersionUpgrade *bool
}

DatabaseBackup

Note: url is stored in Secrets.DatabaseBackupURL

type DatabaseListener

type DatabaseListener struct {
	MaxReconnectDuration *models.Duration
	MinReconnectInterval *models.Duration
	FallbackPollInterval *models.Duration
}

type DatabaseLock

type DatabaseLock struct {
	Enabled              *bool
	LeaseDuration        *models.Duration
	LeaseRefreshInterval *models.Duration
}

func (*DatabaseLock) Mode

func (l *DatabaseLock) Mode() string

func (*DatabaseLock) ValidateConfig

func (l *DatabaseLock) ValidateConfig() (err error)

type DatabaseSecrets

type DatabaseSecrets struct {
	URL                  *models.SecretURL
	BackupURL            *models.SecretURL
	AllowSimplePasswords *bool
}

func (*DatabaseSecrets) SetFrom

func (d *DatabaseSecrets) SetFrom(f *DatabaseSecrets) (err error)

func (*DatabaseSecrets) ValidateConfig

func (d *DatabaseSecrets) ValidateConfig() (err error)

type Feature

type Feature struct {
	FeedsManager *bool
	LogPoller    *bool
	UICSAKeys    *bool
}

type FluxMonitor

type FluxMonitor struct {
	DefaultTransactionQueueDepth *uint32
	SimulateTransactions         *bool
}

type Insecure

type Insecure struct {
	DevWebServer         *bool
	OCRDevelopmentMode   *bool
	InfiniteDepthQueries *bool
	DisableRateLimiting  *bool
}

func (*Insecure) ValidateConfig

func (ins *Insecure) ValidateConfig() (err error)

type JobPipeline

type JobPipeline struct {
	ExternalInitiatorsEnabled *bool
	MaxRunDuration            *models.Duration
	MaxSuccessfulRuns         *uint64
	ReaperInterval            *models.Duration
	ReaperThreshold           *models.Duration
	ResultWriteQueueDepth     *uint32

	HTTPRequest JobPipelineHTTPRequest `toml:",omitempty"`
}

type JobPipelineHTTPRequest

type JobPipelineHTTPRequest struct {
	DefaultTimeout *models.Duration
	MaxSize        *utils.FileSize
}

type Keeper

type Keeper struct {
	DefaultTransactionQueueDepth *uint32
	GasPriceBufferPercent        *uint16
	GasTipCapBufferPercent       *uint16
	BaseFeeBufferPercent         *uint16
	MaxGracePeriod               *int64
	TurnLookBack                 *int64

	Registry KeeperRegistry `toml:",omitempty"`
}

type KeeperRegistry

type KeeperRegistry struct {
	CheckGasOverhead    *uint32
	PerformGasOverhead  *uint32
	MaxPerformDataSize  *uint32
	SyncInterval        *models.Duration
	SyncUpkeepQueueSize *uint32
}

type Log

type Log struct {
	Level       *LogLevel
	JSONConsole *bool
	UnixTS      *bool

	File LogFile `toml:",omitempty"`
}

type LogFile

type LogFile struct {
	Dir        *string
	MaxSize    *utils.FileSize
	MaxAgeDays *int64
	MaxBackups *int64
}

type LogLevel

type LogLevel zapcore.Level

LogLevel replaces dpanic with crit/CRIT

func (LogLevel) CapitalString

func (l LogLevel) CapitalString() string

func (LogLevel) MarshalText

func (l LogLevel) MarshalText() ([]byte, error)

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) UnmarshalText

func (l *LogLevel) UnmarshalText(text []byte) error

type Mercury added in v2.8.0

type Mercury struct {
	Cache MercuryCache `toml:",omitempty"`
}

type MercuryCache added in v2.8.0

type MercuryCache struct {
	LatestReportTTL      *models.Duration
	MaxStaleAge          *models.Duration
	LatestReportDeadline *models.Duration
}

type MercuryCredentials

type MercuryCredentials struct {
	// LegacyURL is the legacy base URL for mercury v0.2 API
	LegacyURL *models.SecretURL
	// URL is the base URL for mercury v0.3 API
	URL *models.SecretURL
	// Username is the user id for mercury credential
	Username *models.Secret
	// Password is the user secret key for mercury credential
	Password *models.Secret
}

type MercurySecrets

type MercurySecrets struct {
	Credentials map[string]MercuryCredentials
}

func (*MercurySecrets) SetFrom

func (m *MercurySecrets) SetFrom(f *MercurySecrets) (err error)

func (*MercurySecrets) ValidateConfig

func (m *MercurySecrets) ValidateConfig() (err error)

type OCR

type OCR struct {
	Enabled                      *bool
	ObservationTimeout           *models.Duration
	BlockchainTimeout            *models.Duration
	ContractPollInterval         *models.Duration
	ContractSubscribeInterval    *models.Duration
	DefaultTransactionQueueDepth *uint32
	// Optional
	KeyBundleID          *models.Sha256Hash
	SimulateTransactions *bool
	TransmitterAddress   *ethkey.EIP55Address
	CaptureEATelemetry   *bool
	TraceLogging         *bool
}

type OCR2

type OCR2 struct {
	Enabled                            *bool
	ContractConfirmations              *uint32
	BlockchainTimeout                  *models.Duration
	ContractPollInterval               *models.Duration
	ContractSubscribeInterval          *models.Duration
	ContractTransmitterTransmitTimeout *models.Duration
	DatabaseTimeout                    *models.Duration
	KeyBundleID                        *models.Sha256Hash
	CaptureEATelemetry                 *bool
	CaptureAutomationCustomTelemetry   *bool
	DefaultTransactionQueueDepth       *uint32
	SimulateTransactions               *bool
	TraceLogging                       *bool
}

type P2P

type P2P struct {
	IncomingMessageBufferSize *int64
	OutgoingMessageBufferSize *int64
	PeerID                    *p2pkey.PeerID
	TraceLogging              *bool

	V1 P2PV1 `toml:",omitempty"`
	V2 P2PV2 `toml:",omitempty"`
}

func (*P2P) NetworkStack

func (p *P2P) NetworkStack() ocrnetworking.NetworkingStack

type P2PV1

type P2PV1 struct {
	Enabled                          *bool
	AnnounceIP                       *net.IP
	AnnouncePort                     *uint16
	BootstrapCheckInterval           *models.Duration
	DefaultBootstrapPeers            *[]string
	DHTAnnouncementCounterUserPrefix *uint32
	DHTLookupInterval                *int64
	ListenIP                         *net.IP
	ListenPort                       *uint16
	NewStreamTimeout                 *models.Duration
	PeerstoreWriteInterval           *models.Duration
}

func (*P2PV1) ValidateConfig

func (p *P2PV1) ValidateConfig() (err error)

type P2PV2

type P2PV2 struct {
	Enabled              *bool
	AnnounceAddresses    *[]string
	DefaultBootstrappers *[]ocrcommontypes.BootstrapperLocator
	DeltaDial            *models.Duration
	DeltaReconcile       *models.Duration
	ListenAddresses      *[]string
}

type Passwords

type Passwords struct {
	Keystore *models.Secret
	VRF      *models.Secret
}

func (*Passwords) SetFrom

func (p *Passwords) SetFrom(f *Passwords) (err error)

func (*Passwords) ValidateConfig

func (p *Passwords) ValidateConfig() (err error)

type PrometheusSecrets

type PrometheusSecrets struct {
	AuthToken *models.Secret
}

func (*PrometheusSecrets) SetFrom

func (p *PrometheusSecrets) SetFrom(f *PrometheusSecrets) (err error)

type Pyroscope

type Pyroscope struct {
	ServerAddress *string
	Environment   *string
}

type PyroscopeSecrets

type PyroscopeSecrets struct {
	AuthToken *models.Secret
}

func (*PyroscopeSecrets) SetFrom

func (p *PyroscopeSecrets) SetFrom(f *PyroscopeSecrets) (err error)

type Secrets

type Secrets struct {
	Database   DatabaseSecrets          `toml:",omitempty"`
	Password   Passwords                `toml:",omitempty"`
	WebServer  WebServerSecrets         `toml:",omitempty"`
	Pyroscope  PyroscopeSecrets         `toml:",omitempty"`
	Prometheus PrometheusSecrets        `toml:",omitempty"`
	Mercury    MercurySecrets           `toml:",omitempty"`
	Threshold  ThresholdKeyShareSecrets `toml:",omitempty"`
}

type Sentry

type Sentry struct {
	Debug       *bool
	DSN         *string
	Environment *string
	Release     *string
}

type TelemetryIngress

type TelemetryIngress struct {
	UniConn      *bool
	Logging      *bool
	BufferSize   *uint16
	MaxBatchSize *uint16
	SendInterval *models.Duration
	SendTimeout  *models.Duration
	UseBatchSend *bool
	Endpoints    []TelemetryIngressEndpoint `toml:",omitempty"`

	URL          *models.URL `toml:",omitempty"` // Deprecated: Use TelemetryIngressEndpoint.URL instead, this field will be removed in future versions
	ServerPubKey *string     `toml:",omitempty"` // Deprecated: Use TelemetryIngressEndpoint.ServerPubKey instead, this field will be removed in future versions
}

func (*TelemetryIngress) ValidateConfig added in v2.7.0

func (t *TelemetryIngress) ValidateConfig() (err error)

type TelemetryIngressEndpoint added in v2.7.0

type TelemetryIngressEndpoint struct {
	Network      *string
	ChainID      *string
	URL          *models.URL
	ServerPubKey *string
}

type ThresholdKeyShareSecrets

type ThresholdKeyShareSecrets struct {
	ThresholdKeyShare *models.Secret
}

func (*ThresholdKeyShareSecrets) SetFrom

type Tracing added in v2.7.0

type Tracing struct {
	Enabled         *bool
	CollectorTarget *string
	NodeID          *string
	SamplingRatio   *float64
	Mode            *string
	TLSCertPath     *string
	Attributes      map[string]string `toml:",omitempty"`
}

func (*Tracing) ValidateConfig added in v2.7.0

func (t *Tracing) ValidateConfig() (err error)

type WebServer

type WebServer struct {
	AuthenticationMethod    *string
	AllowOrigins            *string
	BridgeResponseURL       *models.URL
	BridgeCacheTTL          *models.Duration
	HTTPWriteTimeout        *models.Duration
	HTTPPort                *uint16
	SecureCookies           *bool
	SessionTimeout          *models.Duration
	SessionReaperExpiration *models.Duration
	HTTPMaxSize             *utils.FileSize
	StartTimeout            *models.Duration
	ListenIP                *net.IP

	LDAP      WebServerLDAP      `toml:",omitempty"`
	MFA       WebServerMFA       `toml:",omitempty"`
	RateLimit WebServerRateLimit `toml:",omitempty"`
	TLS       WebServerTLS       `toml:",omitempty"`
}

func (*WebServer) ValidateConfig added in v2.8.0

func (w *WebServer) ValidateConfig() (err error)

type WebServerLDAP added in v2.8.0

type WebServerLDAP struct {
	ServerTLS                   *bool
	SessionTimeout              *models.Duration
	QueryTimeout                *models.Duration
	BaseUserAttr                *string
	BaseDN                      *string
	UsersDN                     *string
	GroupsDN                    *string
	ActiveAttribute             *string
	ActiveAttributeAllowedValue *string
	AdminUserGroupCN            *string
	EditUserGroupCN             *string
	RunUserGroupCN              *string
	ReadUserGroupCN             *string
	UserApiTokenEnabled         *bool
	UserAPITokenDuration        *models.Duration
	UpstreamSyncInterval        *models.Duration
	UpstreamSyncRateLimit       *models.Duration
}

type WebServerLDAPSecrets added in v2.8.0

type WebServerLDAPSecrets struct {
	ServerAddress     *models.SecretURL
	ReadOnlyUserLogin *models.Secret
	ReadOnlyUserPass  *models.Secret
}

type WebServerMFA

type WebServerMFA struct {
	RPID     *string
	RPOrigin *string
}

type WebServerRateLimit

type WebServerRateLimit struct {
	Authenticated         *int64
	AuthenticatedPeriod   *models.Duration
	Unauthenticated       *int64
	UnauthenticatedPeriod *models.Duration
}

type WebServerSecrets added in v2.8.0

type WebServerSecrets struct {
	LDAP WebServerLDAPSecrets `toml:",omitempty"`
}

func (*WebServerSecrets) SetFrom added in v2.8.0

func (w *WebServerSecrets) SetFrom(f *WebServerSecrets) error

type WebServerTLS

type WebServerTLS struct {
	CertPath      *string
	ForceRedirect *bool
	Host          *string
	HTTPSPort     *uint16
	KeyPath       *string
	ListenIP      *net.IP
}

Jump to

Keyboard shortcuts

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