Documentation
¶
Index ¶
- Constants
- Variables
- func APIPluginPort(selection hostplugin.Selection) uint
- func ApplyFlags(cmd *cobra.Command, cfg *Config) error
- func FieldExists(cfg *Config, path string) bool
- func FullPotRewardsStandardNetwork(network string, networkMagic uint32) (string, bool)
- func GatedFieldPaths() []string
- func GetTopologyConfig() *topology.TopologyConfig
- func LoadTopologyConfig() (*topology.TopologyConfig, error)
- func LoadTopologyConfigFor(cfg *Config) (*topology.TopologyConfig, error)
- func MusashiNetworkIdentityConflict(network string, networkMagic uint32) (string, bool)
- func MusashiPrototypeNetwork(network string, networkMagic uint32) bool
- func PublishConfig(cfg *Config)
- func ReapplyMidnightNetworkDefaults(cfg *Config, previousNetwork string)
- func RegisterFlags(cmd *cobra.Command)
- func ValidateNetworkName(network string) error
- func WithContext(ctx context.Context, cfg *Config) context.Context
- type APIConfig
- type APIPluginsConfig
- type CacheConfig
- type ChainsyncConfig
- type Config
- func (c *Config) ApplyDefaults()
- func (c *Config) DebugListenAddress() string
- func (c *Config) LogValue() slog.Value
- func (c *Config) MempoolSettings() (int64, float64, float64)
- func (c *Config) Provenance() Provenance
- func (c *Config) RecordSourceProvenance(configFile string) error
- func (c *Config) SetProvenanceForTest(field string, source Source)
- func (c *Config) Validate(effectiveMode RunMode) error
- type DatabaseLifecycleConfig
- type GenesisBootstrapConfig
- type HistoryExpiryConfig
- type KoiosParityConfig
- type LoggingConfig
- type MidnightConfig
- type MithrilConfig
- type OffchainMetadataConfig
- type PluginsConfig
- type Provenance
- type RunMode
- type Source
- type StartEra
- type StoragePluginsConfig
- type TokenRegistryConfig
Constants ¶
const ( DefaultBlobPlugin = "badger" DefaultDebugBindAddr = "127.0.0.1" DefaultMetadataPlugin = "sqlite" DefaultEvictionWatermark = 0.0 DefaultRejectionWatermark = 1.0 DefaultForgeSyncToleranceSlots = 100 DefaultForgeStaleGapThresholdSlots = 1000 DefaultHealthPort = 12799 // DefaultHealthReadyGapSlots matches // DefaultForgeStaleGapThresholdSlots: both answer "has this node // stopped following the chain?", and a readiness probe that flapped // more readily than the forger's own staleness gate would evict a // node the forger still considers current. At Cardano's f=0.05 an // empty 1000-slot stretch is not something a live chain produces, so // crossing it means the tip is genuinely stuck, not merely quiet. DefaultHealthReadyGapSlots = 1000 // DefaultForgePrimaryChainTipToleranceSlots bounds how far the // ledger-applied tip may trail this node's own primary chain tip before // forging is skipped. Small by design: both tips are local and are meant // to describe the same chain position, unlike ForgeSyncToleranceSlots // which tolerates trailing the network while catching up. DefaultForgePrimaryChainTipToleranceSlots = 5 // DefaultForgeUpstreamStalenessSlots is 0, which disables the upstream // staleness bound. It is opt-in because the newest block this node holds // is a BLOCK while the upstream target is published at HEADER admission, // so the two legitimately differ by the inter-block gap and a small // always-on bound refuses leader slots during ordinary operation. DefaultForgeUpstreamStalenessSlots = 0 // DefaultForgeAppliedTipStalenessSlots is 0, which disables the wall-clock // staleness backstop. It is off by default because "how old is my newest // block" tracks the block interval, so any fixed bound refuses constantly // on a low-throughput chain; set it only where the block interval is known // and bounded. DefaultForgeAppliedTipStalenessSlots = 0 // DefaultForgeEndorserBlockStalenessSlots is 0, which disables the // endorser-block staleness bound. It is opt-in for the same reason the // other two are: the corroborated endorser-block slot is a network-stage // watermark published at leios-notify announcement time, while the applied // tip is a locally applied BLOCK, so the two legitimately differ during // ordinary operation. The watermark is also monotonic and never lowered on // a fork, so an always-on bound can withhold leader slots for as long as // the local chain sits below a slot corroborated for a chain this node // does not adopt. DefaultForgeEndorserBlockStalenessSlots = 0 DefaultMempoolCapacityPraos = 1048576 // 1 MiB DefaultMempoolCapacityLeios = 26214400 // 25 MiB DefaultMempoolRevalidationDeltaCap = 64 DefaultMempoolImplementation = "fifo" )
const DefaultLedgerCatchupTimeout = "30m"
DefaultLedgerCatchupTimeout is the maximum time LoadWithDB will wait for the ledger to process all blocks before returning an error.
const DefaultShutdownTimeout = "30s"
Variables ¶
var AcceptedChainsyncStrategies = []string{
"", "primary", "parallel", "round-robin", "roundrobin", "round_robin",
}
AcceptedChainsyncStrategies mirrors chainsync.AcceptedHeaderSyncStrategyNames (the accepted-name list chainsync.ParseHeaderSyncStrategy is derived from). internal/config cannot import chainsync without pulling node subsystems into the config package, so the two lists are kept in sync by a parity test in cmd/dingo (which can import both).
var AcceptedMithrilBackends = []string{"", "v1", "v2"}
AcceptedMithrilBackends mirrors mithril.AcceptedBackends plus the empty string (which selects the default v2), matching cmd/dingo's resolveMithrilBackend. Kept in sync by the same parity test in cmd/dingo as AcceptedChainsyncStrategies.
Functions ¶
func APIPluginPort ¶ added in v0.68.0
func APIPluginPort(selection hostplugin.Selection) uint
APIPluginPort returns the configured port for a built-in API selection.
func ApplyFlags ¶ added in v0.37.0
ApplyFlags writes explicitly set flags back to cfg. Flags the user did not pass are ignored so YAML and env-var values survive.
func FieldExists ¶ added in v0.69.0
FieldExists reports whether path resolves to a field on cfg, so that a future rename of a gated field cannot silently disable its gate. It wraps the unexported fieldByPath walk flag registration already uses (flags.go), rather than duplicating it.
func FullPotRewardsStandardNetwork ¶ added in v0.67.0
FullPotRewardsStandardNetwork reports whether network/networkMagic identifies a predefined non-devnet network where CIP-0163 full-pot rewards must not be enabled accidentally. Network magic is checked too, so a custom name cannot opt in while still pointing at a public network magic.
func GatedFieldPaths ¶ added in v0.69.0
func GatedFieldPaths() []string
GatedFieldPaths returns the dotted Config field paths that gate provenance tracks. The returned slice is a defensive copy.
func GetTopologyConfig ¶
func GetTopologyConfig() *topology.TopologyConfig
func LoadTopologyConfig ¶
func LoadTopologyConfig() (*topology.TopologyConfig, error)
func LoadTopologyConfigFor ¶ added in v0.51.0
func LoadTopologyConfigFor(cfg *Config) (*topology.TopologyConfig, error)
func MusashiNetworkIdentityConflict ¶ added in v0.70.0
MusashiNetworkIdentityConflict reports whether network/networkMagic mixes the experimental Musashi network (the IOG Leios prototype) with a *different* predefined network, returning the name of the network it collides with.
This matters because Musashi is identified by either half of its identity — the name "musashi" or network magic 164 — and that identity switches on consensus/ledger trust bypasses (SkipLeaderStakeThresholdCheck, SkipDijkstraTxValidation). Either half alone is enough to enable them, so a half-matching configuration is dangerous in both directions:
- network "preview" with magic 164 runs the prototype's non-validating rules on a node the operator configured as preview; and
- network "musashi" with magic 2 is worse still, because the handshake uses the magic: the node actually joins preview while trusting the prototype's rules.
A custom name or an unregistered magic is not a conflict — those are private prototype deployments (e.g. a Musashi mirror). Devnet is excluded for the same reason it is excluded from FullPotRewardsStandardNetwork: it is a local test network, not a production-like profile.
func MusashiPrototypeNetwork ¶ added in v0.70.0
MusashiPrototypeNetwork reports whether network/networkMagic unambiguously identifies the Musashi prototype network, and is therefore permitted to run with the prototype's consensus/ledger trust bypasses.
A conflicting identity (see MusashiNetworkIdentityConflict) is deliberately *not* the prototype network. Startup validation rejects those configurations outright, but returning false here keeps the bypasses off even for an embedder that builds a Config directly and never calls Validate.
func PublishConfig ¶ added in v0.69.0
func PublishConfig(cfg *Config)
PublishConfig replaces the process-wide configuration snapshot returned by GetConfig with a clone of cfg. LoadConfig and ApplyFlags already publish their own results this way; call PublishConfig after any later mutation of a *Config a caller is threading through by pointer, since consumers such as LoadTopologyConfig read the package-level snapshot via GetConfig, not the caller's own pointer, and would otherwise silently see a stale value.
func ReapplyMidnightNetworkDefaults ¶ added in v0.69.0
ReapplyMidnightNetworkDefaults re-derives the network-keyed Midnight defaults after a caller has changed cfg.Network. ApplyFlags already does this inline for a CLI flag that changes Network; this exported wrapper gives any other caller that changes cfg.Network after LoadConfig/ApplyFlags have run (e.g. internal/settingsresolve.Apply resuming Network from a persisted gate) the same re-derivation, so the previous network's constants do not linger under the new network. Explicitly configured values are preserved: clearMidnightNetworkDefaults skips any field the config file set (midnightYAMLFieldSet), and applyMidnightNetworkDefaults only fills fields that are still empty.
func RegisterFlags ¶ added in v0.37.0
RegisterFlags registers persistent CLI flags for every Config field.
func ValidateNetworkName ¶ added in v0.22.0
ValidateNetworkName checks that a network name contains only permitted characters and returns an error if it does not.
Types ¶
type APIConfig ¶ added in v0.70.0
APIConfig holds the shared TLS policy defaults applied to every selected plugins.api.* provider (Blockfrost, Mesh, UTxORPC) unless that provider's own plugins.api.<name>.config.tls overrides a field. See ARCHITECTURE.md's "API security" section and internal/apiconfig for the merge/validation rules; composition (node.go) performs the actual per-provider merge, not this package.
bindAddr, debugBindAddr, and corsAllowedOrigins deliberately stay at the Config root rather than moving under this section: bindAddr is not API-specific (the relay/NtN and metrics listeners use it too), debugBindAddr controls the separate pprof listener, and corsAllowedOrigins already applies uniformly to all three API providers today with no override need identified by dingo#2996/#2998, so duplicating any of them here would only add a second source of truth for no behavioral gain.
type APIPluginsConfig ¶ added in v0.68.0
type APIPluginsConfig struct {
Blockfrost hostplugin.Selection `yaml:"blockfrost"`
Mesh hostplugin.Selection `yaml:"mesh"`
Utxorpc hostplugin.Selection `yaml:"utxorpc"`
}
type CacheConfig ¶ added in v0.22.0
type CacheConfig struct {
// HotUtxoEntries is the maximum number of UTxO CBOR entries in the hot
// cache.
HotUtxoEntries int `yaml:"hotUtxoEntries" envconfig:"DINGO_CACHE_HOT_UTXO_ENTRIES"`
// HotTxEntries is the maximum number of transaction CBOR entries in the hot
// cache.
HotTxEntries int `yaml:"hotTxEntries" envconfig:"DINGO_CACHE_HOT_TX_ENTRIES"`
// HotTxMaxBytes is the maximum memory in bytes for the hot transaction
// cache.
HotTxMaxBytes int64 `yaml:"hotTxMaxBytes" envconfig:"DINGO_CACHE_HOT_TX_MAX_BYTES"`
// BlockLRUEntries is the maximum number of blocks in the LRU cache.
BlockLRUEntries int `yaml:"blockLruEntries" envconfig:"DINGO_CACHE_BLOCK_LRU_ENTRIES"`
// WarmupBlocks is the number of recent blocks to scan during cache warmup.
WarmupBlocks int `yaml:"warmupBlocks" envconfig:"DINGO_CACHE_WARMUP_BLOCKS"`
// WarmupSync blocks startup until cache warmup is complete when true.
WarmupSync bool `yaml:"warmupSync" envconfig:"DINGO_CACHE_WARMUP_SYNC"`
}
CacheConfig holds configuration for the tiered CBOR cache system.
func DefaultCacheConfig ¶ added in v0.22.0
func DefaultCacheConfig() CacheConfig
DefaultCacheConfig returns the default cache configuration values.
type ChainsyncConfig ¶ added in v0.22.0
type ChainsyncConfig struct {
// MaxClients is the maximum number of concurrent chainsync client
// connections. Default: 3.
MaxClients int `yaml:"maxClients" envconfig:"DINGO_CHAINSYNC_MAX_CLIENTS"`
// StallTimeout is the duration after which a client with no
// activity is considered stalled. Default: "2m".
StallTimeout string `yaml:"stallTimeout" envconfig:"DINGO_CHAINSYNC_STALL_TIMEOUT"`
// Strategy selects how headers from multiple eligible peers drive
// ledger ingress: "primary", "parallel", or "round-robin".
// Default: "primary".
Strategy string `yaml:"strategy" envconfig:"DINGO_CHAINSYNC_STRATEGY"`
}
ChainsyncConfig holds configuration for the multi-client chainsync subsystem.
func DefaultChainsyncConfig ¶ added in v0.22.0
func DefaultChainsyncConfig() ChainsyncConfig
DefaultChainsyncConfig returns the default chainsync configuration. StallTimeout must match chainsync.DefaultStallTimeout and the fallback in internal/node/node.go.
type Config ¶
type Config struct {
Plugins PluginsConfig `yaml:"plugins"`
// API holds shared TLS policy defaults for every selected
// plugins.api.* provider. See APIConfig's own doc comment.
API APIConfig `yaml:"api"`
TlsKeyFilePath string `yaml:"tlsKeyFilePath" envconfig:"TLS_KEY_FILE_PATH"`
Topology string `yaml:"topology"`
CardanoConfig string `yaml:"cardanoConfig" envconfig:"config"`
DatabasePath string `yaml:"databasePath" split_words:"true"`
SocketPath string `yaml:"socketPath" split_words:"true"`
TlsCertFilePath string `yaml:"tlsCertFilePath" envconfig:"TLS_CERT_FILE_PATH"`
BindAddr string `yaml:"bindAddr" split_words:"true"`
PrivateBindAddr string `yaml:"privateBindAddr" split_words:"true"`
ShutdownTimeout string `yaml:"shutdownTimeout" split_words:"true"`
LedgerCatchupTimeout string `yaml:"ledgerCatchupTimeout" envconfig:"DINGO_LEDGER_CATCHUP_TIMEOUT"`
Network string `yaml:"network"`
NetworkMagic uint32 `yaml:"networkMagic" split_words:"true"`
PrivatePort uint `yaml:"privatePort" split_words:"true"`
RelayPort uint `yaml:"relayPort" envconfig:"port"`
BarkBaseUrl string `yaml:"barkBaseUrl" envconfig:"DINGO_BARK_BASE_URL"`
BarkBlockDownloadHosts []string `yaml:"barkBlockDownloadHosts" envconfig:"DINGO_BARK_BLOCK_DOWNLOAD_HOSTS"`
BarkPort uint `yaml:"barkPort" envconfig:"DINGO_BARK_PORT"`
// BarkHost is the interface Bark binds to. Left empty, node.go defaults
// it to loopback-only (127.0.0.1) whenever the database lifecycle
// service (Restore/Truncate and friends — gated on BarkClientCAFilePath,
// see its own doc comment) is mounted, rather than bark's own
// all-interfaces "0.0.0.0" default; set explicitly to widen that on
// purpose.
BarkHost string `yaml:"barkHost" envconfig:"DINGO_BARK_HOST"`
// BarkClientCAFilePath is a PEM CA bundle Bark verifies client
// certificates (mTLS) against. Required whenever the database lifecycle
// service is mounted (databaseLifecycle.snapshotDir set alongside
// barkPort): every DatabaseService RPC requires a certificate verified
// against this CA. Destructive methods additionally require an explicit
// BarkOperatorCertificateFingerprints match. Also requires
// TlsCertFilePath/TlsKeyFilePath to be set.
BarkClientCAFilePath string `yaml:"barkClientCaFilePath" envconfig:"DINGO_BARK_CLIENT_CA_FILE_PATH"`
// BarkOperatorCertificateFingerprints is the explicit operator allowlist
// for destructive DatabaseService RPCs. Every DatabaseService caller must
// authenticate with BarkClientCAFilePath; only these SHA-256 certificate
// fingerprints may invoke destructive methods.
BarkOperatorCertificateFingerprints []string `yaml:"barkOperatorCertificateFingerprints" envconfig:"DINGO_BARK_OPERATOR_CERTIFICATE_FINGERPRINTS"`
CORSAllowedOrigins []string `yaml:"corsAllowedOrigins" envconfig:"DINGO_CORS_ALLOWED_ORIGINS"`
MetricsPort uint `yaml:"metricsPort" split_words:"true"`
// DebugBindAddr is the interface used by the unauthenticated pprof
// listener. It defaults to loopback independently of BindAddr and
// PrivateBindAddr; operators must set this field explicitly to expose
// pprof on a wildcard or management-network address.
DebugBindAddr string `yaml:"debugBindAddr" envconfig:"DINGO_DEBUG_BIND_ADDR"`
DebugPort uint `yaml:"debugPort" envconfig:"DINGO_DEBUG_PORT"`
// HealthPort serves the liveness (/health, /healthz) and readiness
// (/readyz) probes on a listener of their own, so an operator can
// expose them to an orchestrator or load balancer without also
// exposing Prometheus metrics, pprof, or any API. It binds BindAddr,
// the same address the relay and metrics listeners use and distinct
// from the API listeners' own bind address: a probe is operational
// surface, not API surface. 0 disables the listener.
HealthPort uint `yaml:"healthPort" envconfig:"DINGO_HEALTH_PORT"`
// HealthReadyGapSlots is how far the chain tip may trail the
// wall-clock slot while /readyz still reports ready. Liveness ignores
// it entirely; see internal/health for why the two are separate.
HealthReadyGapSlots uint `yaml:"healthReadyGapSlots" envconfig:"DINGO_HEALTH_READY_GAP_SLOTS"`
IntersectTip bool `yaml:"intersectTip" split_words:"true"`
// ValidateHistorical validates the complete replay from the selected
// intersection. The default from-origin sync path must not trust peers to
// have validated historical blocks for us.
ValidateHistorical bool `yaml:"validateHistorical" split_words:"true"`
// StrictUtxoValidation errors out (instead of silently skipping) when a
// consumed UTxO cannot be found or recovered for a block past the
// recorded Mithril sync boundary. A non-genesis intersect without a
// Mithril snapshot should explicitly opt out when pre-intersect UTxOs are
// intentionally unavailable.
StrictUtxoValidation bool `yaml:"strictUtxoValidation" split_words:"true"`
// SkipRewardLiveStakeBackfillCheck skips the startup consistency check
// between reward_live_stake and the live UTxO/account set. That check
// scans the entire live UTxO table every startup regardless of whether
// anything needs fixing, which is expensive on a mainnet-scale database.
// Unsafe to leave enabled permanently -- it exists to catch a stale or
// pre-migration reward_live_stake table -- so this is for advanced/
// diagnostic use only (e.g. repeated restarts against a database already
// known to be consistent).
//
// It does not affect the stake-snapshot provenance check that runs in the
// same startup step: that one is cheap, indexed, and fails closed, so it
// runs unconditionally.
SkipRewardLiveStakeBackfillCheck bool `yaml:"skipRewardLiveStakeBackfillCheck" split_words:"true"`
// Tracing enables OpenTelemetry tracing. Disabled by default: with no
// collector listening, the OTLP exporter logs noisy connection errors.
// Spans are sent via OTLP HTTP; configure the destination with the
// standard OTEL_EXPORTER_OTLP_* env vars.
Tracing bool `yaml:"tracing" envconfig:"DINGO_TRACING_ENABLED"`
// TracingStdout redirects spans to stdout instead of OTLP. Requires
// Tracing to also be enabled. Mostly useful for local debugging.
TracingStdout bool `yaml:"tracingStdout" envconfig:"DINGO_TRACING_STDOUT"`
RunMode RunMode `yaml:"runMode" envconfig:"DINGO_RUN_MODE"`
StartEra StartEra `yaml:"startEra" envconfig:"DINGO_START_ERA"`
ImmutableDbPath string `yaml:"immutableDbPath" envconfig:"DINGO_IMMUTABLE_DB_PATH"`
// Database worker pool tuning (worker count and task queue size)
DatabaseWorkers int `yaml:"databaseWorkers" envconfig:"DINGO_DATABASE_WORKERS"`
DatabaseQueueSize int `yaml:"databaseQueueSize" envconfig:"DINGO_DATABASE_QUEUE_SIZE"`
BackfillBatchSize int `yaml:"backfillBatchSize" envconfig:"DINGO_BACKFILL_BATCH_SIZE"`
// BlockPipelineEnabled turns on parallel block decode in the chainsync
// replay loop that reads blocks back from the primary chain and applies
// them to the ledger. Not consensus-affecting -- it only changes how
// CBOR decode work is scheduled, not validation or apply behavior -- but
// defaults off until throughput and stability are proven (issue #1894
// phase 1). See ARCHITECTURE.md ("Block Processing Pipeline").
BlockPipelineEnabled bool `yaml:"blockPipelineEnabled" envconfig:"DINGO_BLOCK_PIPELINE_ENABLED"`
// BlockPipelineValidateEnabled adds parallel VRF/KES and OpCert checks to
// block-pipeline replay (issue #1894 phase 3). It requires
// BlockPipelineEnabled. Admission-time header validation remains the
// authoritative gate because ls.chain is visible to downstream readers
// before replay reaches this stage. See ARCHITECTURE.md ("Block Processing
// Pipeline").
BlockPipelineValidateEnabled bool `yaml:"blockPipelineValidateEnabled" envconfig:"DINGO_BLOCK_PIPELINE_VALIDATE_ENABLED"`
// Peer targets (0 = use default, -1 = unlimited)
TargetNumberOfKnownPeers int `yaml:"targetNumberOfKnownPeers" envconfig:"DINGO_TARGET_KNOWN_PEERS"`
TargetNumberOfEstablishedPeers int `yaml:"targetNumberOfEstablishedPeers" envconfig:"DINGO_TARGET_ESTABLISHED_PEERS"`
TargetNumberOfActivePeers int `yaml:"targetNumberOfActivePeers" envconfig:"DINGO_TARGET_ACTIVE_PEERS"`
TargetNumberOfRootPeers int `yaml:"targetNumberOfRootPeers" envconfig:"DINGO_TARGET_ROOT_PEERS"`
// Per-source quotas for active peers (0 = use default, negative = disable)
ActivePeersTopologyQuota int `yaml:"activePeersTopologyQuota" envconfig:"DINGO_ACTIVE_PEERS_TOPOLOGY_QUOTA"`
ActivePeersGossipQuota int `yaml:"activePeersGossipQuota" envconfig:"DINGO_ACTIVE_PEERS_GOSSIP_QUOTA"`
ActivePeersLedgerQuota int `yaml:"activePeersLedgerQuota" envconfig:"DINGO_ACTIVE_PEERS_LEDGER_QUOTA"`
// Peer governor tuning (0 = use default)
MinHotPeers int `yaml:"minHotPeers" envconfig:"DINGO_MIN_HOT_PEERS"`
ReconcileInterval time.Duration `yaml:"reconcileInterval" envconfig:"DINGO_RECONCILE_INTERVAL"`
InactivityTimeout time.Duration `yaml:"inactivityTimeout" envconfig:"DINGO_INACTIVITY_TIMEOUT"`
InboundWarmTarget int `yaml:"inboundWarmTarget" envconfig:"DINGO_INBOUND_WARM_TARGET"`
InboundHotQuota int `yaml:"inboundHotQuota" envconfig:"DINGO_INBOUND_HOT_QUOTA"`
InboundMinTenure time.Duration `yaml:"inboundMinTenure" envconfig:"DINGO_INBOUND_MIN_TENURE"`
InboundHotScoreThreshold float64 `yaml:"inboundHotScoreThreshold" envconfig:"DINGO_INBOUND_HOT_SCORE_THRESHOLD"`
InboundPruneAfter time.Duration `yaml:"inboundPruneAfter" envconfig:"DINGO_INBOUND_PRUNE_AFTER"`
InboundDuplexOnlyForHot bool `yaml:"inboundDuplexOnlyForHot" envconfig:"DINGO_INBOUND_DUPLEX_ONLY_FOR_HOT"`
InboundCooldown time.Duration `yaml:"inboundCooldown" envconfig:"DINGO_INBOUND_COOLDOWN"`
MaxConnectionsPerIP int `yaml:"maxConnectionsPerIP" envconfig:"DINGO_MAX_CONNECTIONS_PER_IP"`
MaxInboundConns int `yaml:"maxInboundConns" envconfig:"DINGO_MAX_INBOUND_CONNS"`
// Cache configuration for the tiered CBOR cache system
Cache CacheConfig `yaml:"cache"`
// Chainsync configuration for multi-client support
Chainsync ChainsyncConfig `yaml:"chainsync"`
// Genesis bootstrap configuration for from-origin chain selection.
GenesisBootstrap GenesisBootstrapConfig `yaml:"genesisBootstrap"`
// History expiry configuration for local immutable block CBOR expiry.
HistoryExpiry HistoryExpiryConfig `yaml:"historyExpiry"`
// KoiosParity configures the optional in-process Koios reward-parity
// observer (dingo #3098). Disabled by default.
KoiosParity KoiosParityConfig `yaml:"koiosParity"`
// Off-chain metadata fetcher configuration.
OffchainMetadata OffchainMetadataConfig `yaml:"offchainMetadata"`
// CIP-26 off-chain token registry sync (API mode).
TokenRegistry TokenRegistryConfig `yaml:"tokenRegistry"`
// Logging configuration (output format and level)
Logging LoggingConfig `yaml:"logging"`
// Midnight indexer and gRPC API configuration.
Midnight MidnightConfig `yaml:"midnight"`
// KES (Key Evolving Signature) configuration for block production
// SlotsPerKESPeriod is the number of slots in a KES period.
// After this many slots, the KES key must be evolved to the next period.
// Default: 129600 (mainnet value = 1.5 days at 1 second per slot)
SlotsPerKESPeriod uint64 `yaml:"slotsPerKESPeriod" envconfig:"DINGO_SLOTS_PER_KES_PERIOD"`
// MaxKESEvolutions is the maximum number of times a KES key can evolve.
// For Cardano's KES depth of 6, this is 2^6 - 2 = 62 evolutions.
// After this many evolutions, a new operational certificate must be issued.
// Default: 62
MaxKESEvolutions uint64 `yaml:"maxKESEvolutions" envconfig:"DINGO_MAX_KES_EVOLUTIONS"`
// Block production configuration (SPO mode)
// Environment variables match cardano-node naming convention for compatibility
// Note: envconfig.Process("cardano", ...) adds "CARDANO_" prefix automatically
BlockProducer bool `yaml:"blockProducer" envconfig:"BLOCK_PRODUCER"`
ShelleyVRFKey string `yaml:"shelleyVrfKey" envconfig:"SHELLEY_VRF_KEY"`
ShelleyKESKey string `yaml:"shelleyKesKey" envconfig:"SHELLEY_KES_KEY"`
ShelleyOperationalCertificate string `yaml:"shelleyOperationalCertificate" envconfig:"SHELLEY_OPERATIONAL_CERTIFICATE"`
ForgeSyncToleranceSlots uint64 `yaml:"forgeSyncToleranceSlots" envconfig:"DINGO_FORGE_SYNC_TOLERANCE_SLOTS"`
ForgeStaleGapThresholdSlots uint64 `yaml:"forgeStaleGapThresholdSlots" envconfig:"DINGO_FORGE_STALE_GAP_THRESHOLD_SLOTS"`
// ForgePrimaryChainTipToleranceSlots bounds how far the ledger-applied tip
// may trail this node's own primary chain tip before forging is skipped.
// Raise it only if the ledger pipeline is legitimately slow on this
// deployment; raising it lets the node forge blocks whose contents were
// chosen against an older chain position than their parent.
ForgePrimaryChainTipToleranceSlots uint64 `yaml:"forgePrimaryChainTipToleranceSlots" envconfig:"DINGO_FORGE_PRIMARY_CHAIN_TIP_TOLERANCE_SLOTS"`
// ForgeUpstreamStalenessSlots bounds how far the newest block this node
// holds may trail the corroborated upstream sync target before forging is
// skipped. 0 (the default) disables it.
//
// Opt-in because the comparison is not like-for-like: the newest block
// this node holds is a BLOCK, while the upstream target is published when
// a HEADER is admitted, so the two differ by the inter-block gap during
// ordinary operation. Set it well above the expected gap for the network.
ForgeUpstreamStalenessSlots uint64 `yaml:"forgeUpstreamStalenessSlots" envconfig:"DINGO_FORGE_UPSTREAM_STALENESS_SLOTS"`
// ForgeAppliedTipStalenessSlots bounds how many slots older than the
// current slot the newest block this node holds may be before forging is
// skipped. 0 (the default) disables this wall-clock backstop; it is
// off by default because on a low-throughput chain a fixed bound refuses
// constantly. Set it only where the block interval is known and bounded.
ForgeAppliedTipStalenessSlots uint64 `yaml:"forgeAppliedTipStalenessSlots" envconfig:"DINGO_FORGE_APPLIED_TIP_STALENESS_SLOTS"`
// ForgeEndorserBlockStalenessSlots bounds how far a corroborated Leios
// endorser block may lead the ledger-applied tip before forging is
// skipped. 0 (the default) disables it.
//
// Opt-in and separate from ForgePrimaryChainTipToleranceSlots, which
// bounds a purely local block-against-block comparison. This one compares
// a network-stage announcement watermark against a local applied tip, and
// that watermark is monotonic and never lowered, so an always-on bound
// sharing the local tolerance would tie two unrelated risk budgets to one
// number and could withhold leader slots indefinitely.
ForgeEndorserBlockStalenessSlots uint64 `yaml:"forgeEndorserBlockStalenessSlots" envconfig:"DINGO_FORGE_ENDORSER_BLOCK_STALENESS_SLOTS"`
// ValidateForgedBlock self-validates locally-forged blocks before
// adoption and diffusion. Defaults to true (fail closed); set to false
// only to explicitly opt out.
ValidateForgedBlock bool `yaml:"validateForgedBlock" envconfig:"DINGO_VALIDATE_FORGED_BLOCK"`
// MinPoolMargin is the CIP-23 minimum pool margin (minimum variable fee) in
// basis points, [0, 10000] (150 = 1.5%); 0 disables it. Consensus-affecting
// and off by default; effective only in Dijkstra and later. Enable a nonzero
// value only where every node also enables the same value. See
// ARCHITECTURE.md ("Reward Calculation And Precomputation").
MinPoolMargin uint `yaml:"minPoolMargin" envconfig:"DINGO_MIN_POOL_MARGIN"`
// CIP-50 pledge-leverage staking rewards. Consensus-affecting; defaults
// off. PledgeLeverageEnabled turns on the L*pledge reward cap and
// PledgeLeverage is L in [1, 10000]. Enable only on a network where every
// node also enables it. See ARCHITECTURE.md ("Reward Calculation And
// Precomputation").
PledgeLeverageEnabled bool `yaml:"pledgeLeverageEnabled" envconfig:"DINGO_PLEDGE_LEVERAGE_ENABLED"`
PledgeLeverage uint `yaml:"pledgeLeverage" envconfig:"DINGO_PLEDGE_LEVERAGE"`
// CIP-0163 full-pot reward distribution. Consensus-affecting; defaults
// off. When enabled the entire epoch reward pot is distributed to eligible
// pools and delegators instead of returning the residual to reserves.
// Enable only on a network where every node also enables it. See
// ARCHITECTURE.md ("Reward Calculation And Precomputation").
FullPotRewardsEnabled bool `yaml:"fullPotRewardsEnabled" envconfig:"DINGO_FULL_POT_REWARDS_ENABLED"`
// UnsafeFullPotRewardsOnStandardNetworks is an explicit unsafe override
// for running CIP-0163 full-pot rewards on predefined public networks.
// Leave false except for controlled off-consensus experiments.
UnsafeFullPotRewardsOnStandardNetworks bool `yaml:"unsafeFullPotRewardsOnStandardNetworks" envconfig:"DINGO_UNSAFE_FULL_POT_REWARDS_ON_STANDARD_NETWORKS"`
// CIP-0163 reward-account inactivity expiry. Consensus-affecting; defaults
// off. See ARCHITECTURE.md ("Stake Snapshots", CIP-0163 reward-account
// inactivity).
DelegatorInactivityEnabled bool `yaml:"delegatorInactivityEnabled" envconfig:"DINGO_DELEGATOR_INACTIVITY_ENABLED"`
DelegatorInactivity uint64 `yaml:"delegatorInactivity" envconfig:"DINGO_DELEGATOR_INACTIVITY"`
// Leios voting configuration (experimental, leios runMode only).
// LeiosVoteSigningKeyFile is the path to a Cardano text-envelope
// BLS12-381 vote signing key (or a legacy raw hex scalar). When set on
// a block producer whose pool is a committee member, the node emits
// Leios votes for endorser blocks.
LeiosVoteSigningKeyFile string `yaml:"leiosVoteSigningKeyFile" envconfig:"DINGO_LEIOS_VOTE_SIGNING_KEY_FILE"`
// PeerSharing enables the peer sharing protocol, allowing this node
// to advertise known peers to other nodes on request. Pointer
// distinguishes "operator did not set this" (nil) from "explicitly
// false". On a block producer the resolved default is false unless
// this field is explicitly set to true.
PeerSharing *bool `yaml:"peerSharing" envconfig:"DINGO_PEER_SHARING"`
// Storage mode: "core" (default) or "api".
// "core" stores only consensus data
// (UTxOs, certs, pools, pparams).
// "api" additionally stores witnesses, scripts,
// datums, redeemers, and tx metadata.
// APIs (blockfrost, utxorpc, mesh) require
// "api" mode.
StorageMode string `yaml:"storageMode" envconfig:"DINGO_STORAGE_MODE"`
// Mithril snapshot bootstrap configuration
Mithril MithrilConfig `yaml:"mithril"`
// Database lifecycle (snapshot/restore/truncate) configuration
DatabaseLifecycle DatabaseLifecycleConfig `yaml:"databaseLifecycle"`
// contains filtered or unexported fields
}
func FromContext ¶ added in v0.5.0
func LoadConfig ¶
func (*Config) ApplyDefaults ¶ added in v0.66.0
func (c *Config) ApplyDefaults()
ApplyDefaults fills in unset values whose defaults depend on other settings in the fully merged configuration — most notably MempoolCapacity, whose default is chosen by RunMode. It must run after every configuration source has been merged (defaults, YAML, environment, and CLI flags via ApplyFlags): defaulting earlier would derive values from settings a higher-precedence source is still allowed to change. Call it before Validate; Validate rejects any value that is still invalid after defaulting.
func (*Config) DebugListenAddress ¶ added in v0.70.1
DebugListenAddress returns the dedicated pprof TCP listen address. The listener remains disabled when DebugPort is zero; callers check that before binding.
func (*Config) LogValue ¶ added in v0.70.1
LogValue renders c for structured logging with every secret-bearing value replaced by redactedPlaceholder, so `slog` never persists a Koios API key, a provider password, or a DSN credential. Unexported fields are not rendered at all.
The walk is uniform and does not defer to a nested type's own slog.LogValuer implementation: one classification table with one exhaustiveness test is the only thing that decides what is logged, so a nested LogValue cannot become a second, untested source of truth.
func (*Config) MempoolSettings ¶ added in v0.68.0
MempoolSettings returns the canonical default-provider settings after ApplyDefaults has run.
func (*Config) Provenance ¶ added in v0.69.0
func (c *Config) Provenance() Provenance
Provenance returns a copy of the provenance recorded for c's gated fields so far. A gated field never recorded is simply absent from the result (equivalent to SourceDefault via IsExplicit).
func (*Config) RecordSourceProvenance ¶ added in v0.69.0
RecordSourceProvenance records, for gated fields only, whether c's current values came from a YAML config file or an environment variable (see Provenance/IsExplicit). ApplyFlags layers SourceFlag for any CLI-set field on top afterward, and unconditionally overwrites any entry RecordSourceProvenance made for the same field, so callers must invoke this before ApplyFlags for CLI > env > YAML precedence to hold (see cmd/dingo/main.go, which calls it between LoadConfig and ApplyFlags).
This is deliberately NOT called by LoadConfig itself: TestLoad_CompareFullStruct (config_test.go) DeepEquals the whole *Config LoadConfig returns against a hand-built struct literal, and a literal cannot populate an unexported field, so LoadConfig populating provenance would break that test. LoadConfig leaving provenance nil is pinned by TestLoadConfig_LeavesProvenanceEmpty (provenance_internal_test.go).
configFile is resolved exactly as LoadConfig resolves it — via the shared resolveConfigFile (config.go) — so this inspects the same file LoadConfig actually read. A configFile that resolves to "" (none explicitly given and neither the user nor system default path exists) or that has since been removed is not an error: dingo runs fine with no config file, in which case only the environment layer is recorded.
func (*Config) SetProvenanceForTest ¶ added in v0.69.0
SetProvenanceForTest directly sets a gated field's recorded provenance, bypassing CLI/env/YAML detection entirely.
Test-only: production code must only ever populate provenance through ApplyFlags' and RecordSourceProvenance's own detection, and must only ever observe it through Provenance/IsExplicit.
func (*Config) Validate ¶ added in v0.66.0
Validate checks the fully merged configuration (defaults, YAML, environment, CLI flags) for invalid values and nonsensical combinations. Every problem found is returned, joined into a single error, so the operator can fix them all in one pass. It is called from cmd/dingo after CLI flags have been applied and ApplyDefaults has filled in derived defaults, before any services start; LoadConfig alone does not see CLI flag values.
effectiveMode is the run mode the invocation will actually execute. For the bare `dingo` process it is c.RunMode, but the one-shot subcommands (load, sync, mithril) run a fixed operation regardless of the configured runMode, so cmd/dingo passes the mode reflecting what the command does. It governs which listeners and sources are required.
type DatabaseLifecycleConfig ¶ added in v0.69.0
type DatabaseLifecycleConfig struct {
// SnapshotEnabled controls whether automatic epoch-boundary database
// snapshots are captured. It is unsupported when the primary blob provider
// is s3 or gcs because their backup walk would hold the commit barrier for
// an unbounded remote-object read. Manual snapshots via the CLI are always
// available regardless of this setting.
SnapshotEnabled bool `yaml:"snapshotEnabled" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_ENABLED"`
// SnapshotDir is the local filesystem directory automatic snapshots
// are written under (one subdirectory per snapshot). Required if
// SnapshotEnabled is true.
SnapshotDir string `yaml:"snapshotDir" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_DIR"`
// SnapshotCloudDestination optionally mirrors every snapshot (manual
// or automatic) to an object-storage location in addition to
// SnapshotDir, as a URI: s3://<bucket>/<prefix> or
// gcs://<bucket>/<prefix> (matching the scheme
// database/plugin/blob/gcs already uses, not gs://). Requires dingo to
// be built with the dingo_extra_plugins tag. Empty disables cloud
// upload. Credentials are resolved from the ambient AWS/GCS SDK
// credential chain (env vars, IAM role, ADC, etc.) — there is no
// separate credential config here, matching how the existing s3/gcs
// blob store plugins work.
//
// Each snapshot is uploaded under its own sub-path — <this URI>/
// <snapshotID> — not flat directly under this URI, so more than one
// snapshot can exist at the same configured destination without
// overwriting each other. Restore accepts that same per-snapshot URI
// directly in place of a local snapshot directory: it downloads the
// snapshot into a local temp directory first, then proceeds exactly
// as a local restore. This is also how a snapshot created on one node
// can be restored onto another.
SnapshotCloudDestination string `yaml:"snapshotCloudDestination" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_CLOUD_DESTINATION"`
// SnapshotCloudDestinationPrefix is an additional path segment appended
// after SnapshotCloudDestination and before each snapshot's own ID
// (e.g. epoch-<N> for automatic snapshots), so multiple nodes can point
// at the very same SnapshotCloudDestination (a shared disaster-recovery
// bucket, say) without their automatic epoch-boundary snapshots
// colliding at the same remote key: every node captures its epoch-<N>
// snapshot under the identical deterministic name, so without a
// distinct prefix per node, two nodes sharing one destination would
// race to upload to the same path, and an interleaving could even
// leave one node's manifest.json paired with another node's backup
// files at the same remote location. Leave unset for a single node (or
// multiple nodes each already using distinct SnapshotCloudDestination
// values); operators sharing one destination across nodes must set
// this to a distinct value per node.
SnapshotCloudDestinationPrefix string `yaml:"snapshotCloudDestinationPrefix" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_CLOUD_DESTINATION_PREFIX"`
// SnapshotRetention is the number of most-recent automatic snapshots
// to keep before pruning older ones. Zero keeps all of them.
SnapshotRetention int `yaml:"snapshotRetention" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_RETENTION"`
// SnapshotEveryNEpochs captures an automatic snapshot every N epoch
// boundaries instead of every single one.
SnapshotEveryNEpochs int `yaml:"snapshotEveryNEpochs" envconfig:"DINGO_DB_LIFECYCLE_SNAPSHOT_EVERY_N_EPOCHS"`
}
DatabaseLifecycleConfig holds configuration for automatic epoch-boundary database snapshots and the `dingo database` snapshot/restore/truncate CLI surface. Every snapshot is always written locally under SnapshotDir; if SnapshotCloudDestination is also set, it is additionally uploaded there — the cloud copy is a mirror alongside the local one, not a replacement for it.
type GenesisBootstrapConfig ¶ added in v0.37.0
type GenesisBootstrapConfig struct {
// Enabled controls whether Genesis bootstrap mode is used when the node
// starts from origin.
Enabled bool `yaml:"enabled" envconfig:"DINGO_GENESIS_BOOTSTRAP_ENABLED"`
// WindowSlots overrides the Genesis density comparison window in slots.
// A zero value derives the window from Shelley genesis parameters (3k/f).
WindowSlots uint64 `yaml:"windowSlots" envconfig:"DINGO_GENESIS_BOOTSTRAP_WINDOW_SLOTS"`
// PromotionMinDiversityGroups sets the minimum number of diversity groups
// to prefer while promoting peers during bootstrap.
PromotionMinDiversityGroups int `yaml:"promotionMinDiversityGroups" envconfig:"DINGO_GENESIS_BOOTSTRAP_PROMOTION_MIN_DIVERSITY_GROUPS"`
// CorroborationPeers sets the number of independent peers that must report
// the same recent blocks before a fast (shallow) block source may drive
// Genesis-mode chain selection. This is the Ouroboros Genesis trust control
// for biased fast-sync sources: an uncorroborated or divergent fast source
// is denied selection and stalls rather than steering the local chain. A
// zero value disables corroboration (density-only Genesis selection).
CorroborationPeers int `yaml:"corroborationPeers" envconfig:"DINGO_GENESIS_BOOTSTRAP_CORROBORATION_PEERS"`
}
GenesisBootstrapConfig holds configuration for Genesis-mode chain selection and bootstrap-time peer promotion.
func DefaultGenesisBootstrapConfig ¶ added in v0.37.0
func DefaultGenesisBootstrapConfig() GenesisBootstrapConfig
DefaultGenesisBootstrapConfig returns the default Genesis bootstrap configuration values.
type HistoryExpiryConfig ¶ added in v0.52.0
type HistoryExpiryConfig struct {
// Enabled starts the background expiry worker when true.
Enabled bool `yaml:"enabled" envconfig:"DINGO_HISTORY_EXPIRY_ENABLED"`
// Frequency controls how often the worker scans for expired block CBOR.
Frequency time.Duration `yaml:"frequency" envconfig:"DINGO_HISTORY_EXPIRY_FREQUENCY"`
}
HistoryExpiryConfig controls local expiry of immutable block history.
func DefaultHistoryExpiryConfig ¶ added in v0.52.0
func DefaultHistoryExpiryConfig() HistoryExpiryConfig
DefaultHistoryExpiryConfig returns the default history expiry settings.
type KoiosParityConfig ¶ added in v0.69.0
type KoiosParityConfig struct {
// Enabled subscribes the observer to epoch.transition when true.
Enabled bool `yaml:"enabled" envconfig:"DINGO_KOIOS_PARITY_ENABLED"`
// Network is the Koios network to validate against: "preview" or
// "preprod". Empty defaults to the node's own configured Network.
Network string `yaml:"network" envconfig:"DINGO_KOIOS_PARITY_NETWORK"`
// CachePath is the Koios reference cache.db path. Empty defaults to
// {DatabasePath}/.koios/cache.db, matching cmd/koios-parity's own
// default cache location.
CachePath string `yaml:"cachePath" envconfig:"DINGO_KOIOS_PARITY_CACHE_PATH"`
// APIKey is the Koios Bearer token for higher-rate-limit access. Empty
// uses Koios's unauthenticated rate limit.
APIKey string `yaml:"apiKey" envconfig:"DINGO_KOIOS_PARITY_API_KEY"`
// BaseURL overrides the public koios.rest host for the network, for a
// self-hosted or mirrored Koios instance. Full v1 API root, e.g.
// "https://preview-koios.example.com/api/v1". Empty selects the public
// host. A custom host is not subject to the public tier's burst cap; see
// koiosparity.NewKoiosClient.
BaseURL string `yaml:"baseUrl" envconfig:"DINGO_KOIOS_PARITY_BASE_URL"`
// AllowInsecureHTTP permits a plain-HTTP BaseURL. The client attaches the
// APIKey as a Bearer token to every request, so cleartext transport would
// expose it, and the reference data this tool compares against would be
// tamperable in flight -- a MITM could induce a false PASS. Local dev and
// test only, mirroring Mithril.AllowInsecureHTTP.
AllowInsecureHTTP bool `yaml:"allowInsecureHttp" envconfig:"DINGO_KOIOS_PARITY_ALLOW_INSECURE_HTTP"`
// Strict stops/cancels the node on the first Koios/tool error or exact
// parity mismatch, rather than logging it and continuing normal node
// operation.
Strict bool `yaml:"strict" envconfig:"DINGO_KOIOS_PARITY_STRICT"`
// GraceHours is the window after an epoch closes during which a
// Dingo-side row still missing is treated as reference/sync lag rather
// than a failure. 0 selects the default (24).
GraceHours int `yaml:"graceHours" envconfig:"DINGO_KOIOS_PARITY_GRACE_HOURS"`
// Accounts additionally runs #3097's per-account exact-parity fetch+check
// phase for every epoch the observer processes, alongside the existing
// epoch-aggregate/pool phases. Defaults to true (see
// DefaultKoiosParityConfig): the in-process observer is the
// operationally-real, continuously-driven path #3098 exists to make
// possible, unlike the standalone koios-parity CLI's `--accounts` flag,
// which stays opt-in-only for cost/compatibility reasons (see
// cmd/koios-parity's addAccountsFlag). Set false explicitly to keep the
// observer pool-level-only, e.g. to bound Koios request volume on a
// resource-constrained deployment.
Accounts bool `yaml:"accounts" envconfig:"DINGO_KOIOS_PARITY_ACCOUNTS"`
// AccountChunkSize/AccountChunkMaxBytes (dingo #3099) bound each
// /account_reward_history request issued by the Accounts phase above, by
// both address count and encoded body size. 0 for either selects the
// package default (koiosparity.koiosAccountChunkSize/
// koiosAccountChunkMaxBytesDefault). Unused when Accounts is false.
AccountChunkSize int `yaml:"accountChunkSize" envconfig:"DINGO_KOIOS_PARITY_ACCOUNT_CHUNK_SIZE"`
AccountChunkMaxBytes int `yaml:"accountChunkMaxBytes" envconfig:"DINGO_KOIOS_PARITY_ACCOUNT_CHUNK_MAX_BYTES"`
}
KoiosParityConfig controls the in-process Koios reward-parity observer (dingo #3098). When enabled, Dingo subscribes an epoch-boundary observer to its own EventBus (event.EpochTransitionEventType) and validates each newly closed epoch's committed reward state directly against Koios reference data as the node advances, instead of requiring a separate koios-parity CLI process polling a second, independently synced copy of the metadata database. See internal/koiosparity and ARCHITECTURE.md's "Koios Parity Tracker" section. This is a one-off validation aid, not a permanent subsystem — leave it disabled for normal node operation.
func DefaultKoiosParityConfig ¶ added in v0.69.0
func DefaultKoiosParityConfig() KoiosParityConfig
DefaultKoiosParityConfig returns the default (disabled) Koios parity observer settings. Strict and Accounts both default to true: once an operator opts into the feature at all (Enabled), the safety-motivated fail-stop behavior (Strict) and the complete per-account exact-parity coverage (Accounts, #3097) it exists for are both on unless explicitly disabled with --koios-parity-strict=false/--koios-parity-accounts=false or their DINGO_KOIOS_PARITY_STRICT/DINGO_KOIOS_PARITY_ACCOUNTS env var equivalents — matching KoiosParityConfig.Strict/Accounts's and internal/koiosparity.Observer's own doc comments, which already describe both as the operator default.
type LoggingConfig ¶ added in v0.51.0
type LoggingConfig struct {
// Format selects the log output handler: "text" (default) or "json".
// JSON is intended for machine-parseable ingestion (ELK/Loki).
Format string `yaml:"format" envconfig:"DINGO_LOGGING_FORMAT"`
// Level is the minimum log level: "debug", "info" (default), "warn",
// or "error". The --debug flag, when set, overrides this to "debug".
Level string `yaml:"level" envconfig:"DINGO_LOGGING_LEVEL"`
}
LoggingConfig holds log output configuration.
func DefaultLoggingConfig ¶ added in v0.51.0
func DefaultLoggingConfig() LoggingConfig
DefaultLoggingConfig returns the default logging configuration.
type MidnightConfig ¶ added in v0.55.0
type MidnightConfig struct {
// Enabled opts into running the Midnight indexer. Default false: an
// api-mode deployment that wants Midnight indexing must set this
// explicitly.
Enabled bool `yaml:"enabled" envconfig:"DINGO_MIDNIGHT_ENABLED"`
// ServerEnabled independently opts into the Midnight gRPC listener.
// Indexing and serving persisted Midnight rows are separate operations.
ServerEnabled bool `yaml:"serverEnabled" envconfig:"DINGO_MIDNIGHT_SERVER_ENABLED"`
// ReflectionEnabled exposes gRPC service discovery when the server is
// enabled. It defaults off because reflection broadens the public surface.
ReflectionEnabled bool `yaml:"reflectionEnabled" envconfig:"DINGO_MIDNIGHT_REFLECTION_ENABLED"`
Port uint `yaml:"port" envconfig:"DINGO_MIDNIGHT_PORT"`
Host string `yaml:"host" envconfig:"DINGO_MIDNIGHT_HOST"`
CNightPolicyID string `yaml:"cnightPolicyId"`
CNightAssetName string `yaml:"cnightAssetName"`
MappingValidatorAddress string `yaml:"mappingValidatorAddress"`
AuthTokenPolicyID string `yaml:"authTokenPolicyId"`
AuthTokenAssetName string `yaml:"authTokenAssetName"`
CommitteeCandidateAddress string `yaml:"committeeCandidateAddress"`
TechnicalCommitteeAddress string `yaml:"technicalCommitteeAddress"`
TechnicalCommitteePolicyID string `yaml:"technicalCommitteePolicyId"`
CouncilAddress string `yaml:"councilAddress"`
CouncilPolicyID string `yaml:"councilPolicyId"`
PermissionedCandidatePolicy string `yaml:"permissionedCandidatePolicy"`
}
MidnightConfig holds configuration for the Midnight indexer and its optional gRPC API surface. Indexing is only active when Enabled is true AND Dingo is running in API storage mode -- both are required, since the indexer depends on the API-mode indexes to function; Validate rejects Enabled without API storage mode. ServerEnabled independently opts into serving the stored Midnight state; when enabled, Port must be non-zero.
func DefaultMidnightConfig ¶ added in v0.55.0
func DefaultMidnightConfig() MidnightConfig
DefaultMidnightConfig returns the default Midnight indexer settings.
type MithrilConfig ¶ added in v0.22.0
type MithrilConfig struct {
// Enabled controls whether Mithril integration is available.
Enabled bool `yaml:"enabled" envconfig:"DINGO_MITHRIL_ENABLED"`
// AggregatorURL overrides the default aggregator URL for the network.
// If empty, the URL is auto-detected from the configured network.
AggregatorURL string `yaml:"aggregatorUrl" envconfig:"DINGO_MITHRIL_AGGREGATOR_URL"`
// AllowInsecureHTTP permits AggregatorURL and the snapshot artifact
// locations the aggregator returns to use plain HTTP instead of
// HTTPS. Defaults to false; this is an explicit escape hatch for
// local development and tests against a plaintext aggregator and
// should not be enabled in production.
AllowInsecureHTTP bool `yaml:"allowInsecureHttp" envconfig:"DINGO_MITHRIL_ALLOW_INSECURE_HTTP"`
// Backend selects the Mithril artifact backend: "v2" (default) uses
// incremental Cardano database artifacts; "v1" uses the legacy full
// snapshot archives, which upstream Mithril is phasing out.
Backend string `yaml:"backend" envconfig:"DINGO_MITHRIL_BACKEND"`
// DownloadDir is the directory where snapshot archives are downloaded.
// If empty, a randomized temporary directory is created automatically.
DownloadDir string `yaml:"downloadDir" envconfig:"DINGO_MITHRIL_DOWNLOAD_DIR"`
// DownloadIdleTimeout is the maximum idle time to wait for snapshot
// response headers or body bytes before retrying. Empty uses the
// downloader default; a negative duration disables idle detection.
DownloadIdleTimeout string `yaml:"downloadIdleTimeout" envconfig:"DINGO_MITHRIL_DOWNLOAD_IDLE_TIMEOUT"`
// DownloadMaxIdleRetries is the number of consecutive idle retries
// allowed without additional bytes. Zero uses the downloader default.
DownloadMaxIdleRetries int `yaml:"downloadMaxIdleRetries" envconfig:"DINGO_MITHRIL_DOWNLOAD_MAX_IDLE_RETRIES"`
// CleanupAfterLoad controls whether temporary files are removed
// after the ImmutableDB has been loaded.
CleanupAfterLoad bool `yaml:"cleanupAfterLoad" envconfig:"DINGO_MITHRIL_CLEANUP"`
// VerifyCertificates enables STM certificate-chain verification during
// bootstrap. When true, bootstrap requires the Cardano network config's
// pinned Mithril genesis verification key and verifies the chain back to it.
// False explicitly selects the unverified bootstrap flow.
VerifyCertificates bool `yaml:"verifyCertificates" envconfig:"DINGO_MITHRIL_VERIFY_CERTS"`
}
MithrilConfig holds configuration for Mithril snapshot bootstrapping.
type OffchainMetadataConfig ¶ added in v0.54.0
type OffchainMetadataConfig struct {
// Interval controls how often the fetcher discovers and fetches due rows.
Interval time.Duration `yaml:"interval" envconfig:"DINGO_OFFCHAIN_METADATA_INTERVAL"`
// RequestTimeout limits each HTTP(S) metadata request.
RequestTimeout time.Duration `yaml:"requestTimeout" envconfig:"DINGO_OFFCHAIN_METADATA_REQUEST_TIMEOUT"`
// UserAgent is sent with outbound metadata requests.
UserAgent string `yaml:"userAgent" envconfig:"DINGO_OFFCHAIN_METADATA_USER_AGENT"`
// IPFSGatewayURL is the gateway prefix used for ipfs:// URLs.
IPFSGatewayURL string `yaml:"ipfsGatewayUrl" envconfig:"DINGO_OFFCHAIN_METADATA_IPFS_GATEWAY_URL"`
// BatchSize bounds the number of due rows claimed per fetcher pass.
BatchSize int `yaml:"batchSize" envconfig:"DINGO_OFFCHAIN_METADATA_BATCH_SIZE"`
// MaxBytes bounds the response body bytes read from each document.
MaxBytes int64 `yaml:"maxBytes" envconfig:"DINGO_OFFCHAIN_METADATA_MAX_BYTES"`
// AllowPrivateAddresses permits fetching private, loopback, and link-local
// addresses. Leave false for the default SSRF guard.
AllowPrivateAddresses bool `yaml:"allowPrivateAddresses" envconfig:"DINGO_OFFCHAIN_METADATA_ALLOW_PRIVATE_ADDRESSES"`
}
OffchainMetadataConfig holds API-mode off-chain metadata fetcher settings. Zero values fall back to the fetcher's internal defaults.
type PluginsConfig ¶ added in v0.68.0
type PluginsConfig struct {
Storage StoragePluginsConfig `yaml:"storage"`
Mempool hostplugin.Selection `yaml:"mempool"`
API APIPluginsConfig `yaml:"api"`
}
PluginsConfig is the canonical configuration tree for compiled-in plugin capabilities.
type Provenance ¶ added in v0.69.0
Provenance records, for each gated Config field (keyed by dotted field path, e.g. "HistoryExpiry.Enabled"), whether its value came from an operator or is still the built-in default.
func (Provenance) IsExplicit ¶ added in v0.69.0
func (p Provenance) IsExplicit(field string) bool
IsExplicit reports whether field was set by an operator (CLI flag, environment variable, or YAML file) rather than left at its built-in default. A field that was never recorded is absent from the map, which looks up as SourceDefault (the zero value) and is therefore not explicit.
type RunMode ¶ added in v0.21.0
type RunMode string
RunMode represents the operational mode of the dingo node
const ( RunModeServe RunMode = "serve" // Full node with network connectivity (default) RunModeLoad RunMode = "load" // Batch import from ImmutableDB RunModeDev RunMode = "dev" // Development mode (isolated, no outbound) RunModeLeios RunMode = "leios" // Full node with experimental Leios capabilities // RunModeSync, RunModeMithril, and RunModeDatabase are effective run // modes used only for validation, not configurable runMode values // (RunMode.Valid rejects them); cmd/dingo passes the one matching the // invoked command to Config.Validate. None of them starts the // relay/private serving listeners or the API listeners. They differ // in their auxiliary-listener surface: RunModeSync is the Mithril // snapshot sync operation (via `dingo sync --mithril` or `dingo // mithril sync`), which starts a Prometheus metrics listener and an // optional pprof debug listener; RunModeMithril is the read-only // Mithril query subcommands (`list`, `show`, and bare `mithril`), // which start no listeners at all; RunModeDatabase is the offline // `dingo database snapshot|restore|truncate` maintenance commands, // which also start no listeners. Keeping them distinct lets Validate // check exactly the ports each invocation binds. RunModeSync RunMode = "sync" RunModeMithril RunMode = "mithril" RunModeDatabase RunMode = "database" )
func (RunMode) IsDevMode ¶ added in v0.21.0
IsDevMode returns true if the mode enables development behaviors (forge blocks, disable outbound, skip topology)
func (RunMode) RequiresListeners ¶ added in v0.66.0
RequiresListeners reports whether an (effective) run mode runs as a serving node, starting the relay and private (NtN/NtC) listeners. The serving modes (serve, dev, leios, and the empty default) do; the load and one-shot sync/mithril utilities do not. (The metrics and debug listeners are gated separately by Validate: serving modes and the Mithril sync operation start them, the read-only Mithril subcommands do not.)
type Source ¶ added in v0.69.0
type Source int
Source identifies where a gated configuration field's value came from.
const ( // SourceDefault means the field still holds its built-in default; no // operator-supplied value (CLI flag, environment variable, or YAML // key) was ever observed for it. SourceDefault Source = iota // SourceYAML means the field was set by a key in the loaded YAML // config file. A config file is an operator statement, so YAML counts // as explicit, the same as a flag or environment variable. SourceYAML // SourceEnv means the field was set by an environment variable. SourceEnv // SourceFlag means the field was set by an explicit CLI flag. SourceFlag )
type StartEra ¶ added in v0.51.0
type StartEra string
StartEra controls experimental direct startup in a later ledger era.
func (StartEra) IsDijkstra ¶ added in v0.51.0
type StoragePluginsConfig ¶ added in v0.68.0
type StoragePluginsConfig struct {
Blob hostplugin.Selection `yaml:"blob"`
Metadata hostplugin.Selection `yaml:"metadata"`
}
type TokenRegistryConfig ¶ added in v0.70.1
type TokenRegistryConfig struct {
// Enabled turns the sync on. Only effective in API storage mode.
Enabled bool `yaml:"enabled" envconfig:"DINGO_TOKEN_REGISTRY_ENABLED"`
// SourceURL overrides the network-derived registry tarball URL, for
// operators running a mirror. Empty selects by network: the Cardano
// Foundation registry for mainnet, the IOG testnet registry otherwise.
SourceURL string `yaml:"sourceUrl" envconfig:"DINGO_TOKEN_REGISTRY_SOURCE_URL"`
// Interval controls how often the registry is re-checked. Each check
// is a conditional request, so an unchanged registry costs no download.
// Values below one minute are raised to it.
Interval time.Duration `yaml:"interval" envconfig:"DINGO_TOKEN_REGISTRY_INTERVAL"`
// RequestTimeout bounds the whole download, not one request round trip.
RequestTimeout time.Duration `yaml:"requestTimeout" envconfig:"DINGO_TOKEN_REGISTRY_REQUEST_TIMEOUT"`
// UserAgent is sent with the registry request.
UserAgent string `yaml:"userAgent" envconfig:"DINGO_TOKEN_REGISTRY_USER_AGENT"`
// MaxBytes bounds the compressed registry download.
MaxBytes int64 `yaml:"maxBytes" envconfig:"DINGO_TOKEN_REGISTRY_MAX_BYTES"`
// MaxEntryBytes bounds a single registry mapping document.
MaxEntryBytes int64 `yaml:"maxEntryBytes" envconfig:"DINGO_TOKEN_REGISTRY_MAX_ENTRY_BYTES"`
// StoreLogos persists base64 logo payloads, which are roughly 90% of
// registry bytes. Off by default; text properties are what wallets need.
StoreLogos bool `yaml:"storeLogos" envconfig:"DINGO_TOKEN_REGISTRY_STORE_LOGOS"`
// AllowPrivateAddresses permits syncing from private, loopback, and
// link-local addresses. Leave false for the default SSRF guard.
AllowPrivateAddresses bool `yaml:"allowPrivateAddresses" envconfig:"DINGO_TOKEN_REGISTRY_ALLOW_PRIVATE_ADDRESSES"`
}
TokenRegistryConfig holds API-mode CIP-26 token registry sync settings. The sync populates the `metadata` field of GET /assets/{asset} from the off-chain token registry, so wallets can show a token's name, ticker, and decimals without a per-asset lookup against a remote metadata server -- which would reveal which assets the user holds. Zero values fall back to the syncer's internal defaults.
Disabled by default: the mainnet registry is a roughly 240MB download, so enabling it is an explicit operator decision rather than something a node starts doing on upgrade.