Documentation
¶
Overview ¶
Package dingo implements a Cardano blockchain node.
It composes ledger validation, chain synchronization and selection, networking, block production, storage, and optional API services into a single Node. A Node owns its configuration, event bus, and plugin host; providers are registered explicitly during composition.
Index ¶
- type Config
- func (c *Config) API() internalconfig.APIConfig
- func (c *Config) APIConfig() internalconfig.APIConfig
- func (c *Config) ActivePeersGossipQuota() int
- func (c *Config) ActivePeersLedgerQuota() int
- func (c *Config) ActivePeersTopologyQuota() int
- func (c *Config) BackfillBatchSize() int
- func (c *Config) BarkBaseUrl() string
- func (c *Config) BarkBlockDownloadHosts() []string
- func (c *Config) BarkOperatorCertificateFingerprints() []string
- func (c *Config) BarkPort() uint
- func (c *Config) BindAddr() string
- func (c *Config) BlobPlugin() string
- func (c *Config) BlockProducer() bool
- func (c *Config) BlockfrostPort() uint
- func (c *Config) CORSAllowedOrigins() []string
- func (c *Config) Cache() internalconfig.CacheConfig
- func (c *Config) CardanoConfig() string
- func (c *Config) CardanoNodeConfig() *cardano.CardanoNodeConfig
- func (c *Config) Chainsync() internalconfig.ChainsyncConfig
- func (c *Config) ChainsyncStallTimeoutDuration() time.Duration
- func (c *Config) DatabasePath() string
- func (c *Config) DatabaseQueueSize() int
- func (c *Config) DatabaseWorkers() int
- func (c *Config) DebugPort() uint
- func (c *Config) EvictionWatermark() float64
- func (c *Config) ForgeAppliedTipStalenessSlots() uint64
- func (c *Config) ForgeEndorserBlockStalenessSlots() uint64
- func (c *Config) ForgePrimaryChainTipToleranceSlots() uint64
- func (c *Config) ForgeStaleGapThresholdSlots() uint64
- func (c *Config) ForgeSyncToleranceSlots() uint64
- func (c *Config) ForgeUpstreamStalenessSlots() uint64
- func (c *Config) GenesisBootstrap() internalconfig.GenesisBootstrapConfig
- func (c *Config) HistoryExpiry() internalconfig.HistoryExpiryConfig
- func (c *Config) ImmutableDbPath() string
- func (c *Config) InactivityTimeout() time.Duration
- func (c *Config) InboundCooldown() time.Duration
- func (c *Config) InboundDuplexOnlyForHot() bool
- func (c *Config) InboundHotQuota() int
- func (c *Config) InboundHotScoreThreshold() float64
- func (c *Config) InboundMinTenure() time.Duration
- func (c *Config) InboundPruneAfter() time.Duration
- func (c *Config) InboundWarmTarget() int
- func (c *Config) IntersectPoints() []ocommon.Point
- func (c *Config) IntersectTip() bool
- func (c *Config) LedgerCatchupTimeout() string
- func (c *Config) LedgerPeerTarget() int
- func (c *Config) LeiosPipelineTiming() *leios.PipelineTiming
- func (c *Config) LeiosVoteSigningKeyFile() string
- func (c *Config) Listeners() []ListenerConfig
- func (c *Config) Logger() *slog.Logger
- func (c *Config) Logging() internalconfig.LoggingConfig
- func (c *Config) MaxConnectionsPerIP() int
- func (c *Config) MaxInboundConns() int
- func (c *Config) MaxKESEvolutions() uint64
- func (c *Config) MempoolCapacity() int64
- func (c *Config) MeshPort() uint
- func (c *Config) MetadataPlugin() string
- func (c *Config) MetricsPort() uint
- func (c *Config) Midnight() internalconfig.MidnightConfig
- func (c *Config) MinHotPeers() int
- func (c *Config) Mithril() internalconfig.MithrilConfig
- func (c *Config) Network() string
- func (c *Config) NetworkMagic() uint32
- func (c *Config) OffchainMetadata() internalconfig.OffchainMetadataConfig
- func (c *Config) PeerSharing() *bool
- func (c *Config) PrivateBindAddr() string
- func (c *Config) PrivatePort() uint
- func (c *Config) PrometheusRegistry() prometheus.Registerer
- func (c *Config) ReconcileInterval() time.Duration
- func (c *Config) RejectionWatermark() float64
- func (c *Config) RelayPort() uint
- func (c *Config) RunMode() internalconfig.RunMode
- func (c *Config) SetStorageMode(mode string)
- func (c *Config) SetTargetNumberOfActivePeers(n int)
- func (c *Config) SetTargetNumberOfEstablishedPeers(n int)
- func (c *Config) SetTargetNumberOfKnownPeers(n int)
- func (c *Config) ShelleyKESKey() string
- func (c *Config) ShelleyOperationalCertificate() string
- func (c *Config) ShelleyVRFKey() string
- func (c *Config) ShutdownTimeout() string
- func (c *Config) ShutdownTimeoutDuration() (time.Duration, error)
- func (c *Config) SlotsPerKESPeriod() uint64
- func (c *Config) SocketPath() string
- func (c *Config) StartEra() internalconfig.StartEra
- func (c *Config) StorageMode() string
- func (c *Config) StorageModeEnum() StorageMode
- func (c *Config) StrictUtxoValidation() bool
- func (c *Config) TargetNumberOfActivePeers() int
- func (c *Config) TargetNumberOfEstablishedPeers() int
- func (c *Config) TargetNumberOfKnownPeers() int
- func (c *Config) TargetNumberOfRootPeers() int
- func (c *Config) TlsCertFilePath() string
- func (c *Config) TlsKeyFilePath() string
- func (c *Config) TokenRegistry() internalconfig.TokenRegistryConfig
- func (c *Config) Topology() string
- func (c *Config) TopologyConfig() *topology.TopologyConfig
- func (c *Config) Tracing() bool
- func (c *Config) TracingStdout() bool
- func (c *Config) UtxorpcPort() uint
- func (c *Config) ValidateForgedBlock() bool
- func (c *Config) ValidateHistorical() bool
- type ConfigOptionFunc
- func WithAPIConfig(cfg internalconfig.APIConfig) ConfigOptionFunc
- func WithActivePeersQuotas(topologyQuota, gossipQuota, ledgerQuota int) ConfigOptionFunc
- func WithBarkBaseUrl(baseUrl string) ConfigOptionFunc
- func WithBarkBlockDownloadHosts(hosts []string) ConfigOptionFunc
- func WithBarkClientCAFilePath(path string) ConfigOptionFunc
- func WithBarkHost(host string) ConfigOptionFunc
- func WithBarkOperatorCertificateFingerprints(fingerprints []string) ConfigOptionFunc
- func WithBarkPort(port uint) ConfigOptionFunc
- func WithBindAddr(addr string) ConfigOptionFunc
- func WithBlobPlugin(plugin string) ConfigOptionFunc
- func WithBlockProducer(enabled bool) ConfigOptionFunc
- func WithBlockfrostPort(port uint) ConfigOptionFunc
- func WithBootstrapPromotionMinDiversityGroups(n int) ConfigOptionFunc
- func WithCORSAllowedOrigins(origins []string) ConfigOptionFunc
- func WithCacheConfig(blockLRU, hotUtxo, hotTx int, hotTxMaxBytes int64) ConfigOptionFunc
- func WithCardanoNodeConfig(cardanoNodeConfig *cardano.CardanoNodeConfig) ConfigOptionFunc
- func WithChainsyncHeaderStrategy(strategy chainsync.HeaderSyncStrategy) ConfigOptionFunc
- func WithChainsyncMaxClients(maxClients int) ConfigOptionFunc
- func WithChainsyncStallTimeout(timeout time.Duration) ConfigOptionFunc
- func WithDatabaseLifecycle(cfg internalconfig.DatabaseLifecycleConfig) ConfigOptionFunc
- func WithDatabasePath(dataDir string) ConfigOptionFunc
- func WithDatabaseWorkerPoolConfig(cfg ledger.DatabaseWorkerPoolConfig) ConfigOptionFunc
- func WithDelegatorInactivity(enabled bool, epochs uint64) ConfigOptionFunc
- func WithEvictionWatermark(watermark float64) ConfigOptionFunc
- func WithForgeAppliedTipStalenessSlots(slots uint64) ConfigOptionFunc
- func WithForgeEndorserBlockStalenessSlots(slots uint64) ConfigOptionFunc
- func WithForgePrimaryChainTipToleranceSlots(slots uint64) ConfigOptionFunc
- func WithForgeStaleGapThresholdSlots(slots uint64) ConfigOptionFunc
- func WithForgeSyncToleranceSlots(slots uint64) ConfigOptionFunc
- func WithForgeUpstreamStalenessSlots(slots uint64) ConfigOptionFunc
- func WithFullPotRewards(enabled bool) ConfigOptionFunc
- func WithGenesisBootstrap(enabled bool) ConfigOptionFunc
- func WithGenesisCorroborationPeers(peers int) ConfigOptionFunc
- func WithGenesisWindowSlots(slots uint64) ConfigOptionFunc
- func WithHistoryExpiry(cfg HistoryExpiryConfig) ConfigOptionFunc
- func WithInactivityTimeout(d time.Duration) ConfigOptionFunc
- func WithInboundPeerGovernance(warmTarget int, hotQuota int, minTenure time.Duration, ...) ConfigOptionFunc
- func WithIntersectPoints(points []ocommon.Point) ConfigOptionFunc
- func WithIntersectTip(intersectTip bool) ConfigOptionFunc
- func WithKoiosParity(cfg KoiosParityConfig) ConfigOptionFunc
- func WithLedgerPeerTarget(n int) ConfigOptionFunc
- func WithLeiosPipelineTiming(timing leios.PipelineTiming) ConfigOptionFunc
- func WithLeiosVoteSigningKeyFile(path string) ConfigOptionFunc
- func WithListeners(listeners ...ListenerConfig) ConfigOptionFunc
- func WithLogger(logger *slog.Logger) ConfigOptionFunc
- func WithMaxConnectionsPerIP(n int) ConfigOptionFunc
- func WithMaxInboundConns(n int) ConfigOptionFunc
- func WithMempoolCapacity(capacity int64) ConfigOptionFunc
- func WithMeshPort(port uint) ConfigOptionFunc
- func WithMetadataPlugin(plugin string) ConfigOptionFunc
- func WithMidnightConfig(cfg MidnightConfig) ConfigOptionFunc
- func WithMinHotPeers(n int) ConfigOptionFunc
- func WithMinPoolMargin(v uint) ConfigOptionFunc
- func WithNetwork(network string) ConfigOptionFunc
- func WithNetworkMagic(networkMagic uint32) ConfigOptionFunc
- func WithOffchainMetadataConfig(cfg OffchainMetadataConfig) ConfigOptionFunc
- func WithOutboundSourcePort(port uint) ConfigOptionFunc
- func WithPeerSharing(peerSharing bool) ConfigOptionFunc
- func WithPeerTargets(targetKnown, targetEstablished, targetActive int) ConfigOptionFunc
- func WithPledgeLeverage(enabled bool, v uint) ConfigOptionFunc
- func WithPluginSelection(capability hostplugin.Capability, selection hostplugin.Selection) ConfigOptionFunc
- func WithPrometheusRegistry(registry prometheus.Registerer) ConfigOptionFunc
- func WithReconcileInterval(d time.Duration) ConfigOptionFunc
- func WithRejectionWatermark(watermark float64) ConfigOptionFunc
- func WithRootPeerTarget(targetRoot int) ConfigOptionFunc
- func WithRunMode(mode string) ConfigOptionFunc
- func WithShelleyKESKey(path string) ConfigOptionFunc
- func WithShelleyOperationalCertificate(path string) ConfigOptionFunc
- func WithShelleyVRFKey(path string) ConfigOptionFunc
- func WithShutdownTimeout(timeout time.Duration) ConfigOptionFunc
- func WithStartEra(startEra string) ConfigOptionFunc
- func WithStorageMode(mode StorageMode) ConfigOptionFunc
- func WithStrictUtxoValidation(strict bool) ConfigOptionFunc
- func WithTokenRegistryConfig(cfg TokenRegistryConfig) ConfigOptionFunc
- func WithTopologyConfig(topologyConfig *topology.TopologyConfig) ConfigOptionFunc
- func WithTracing(tracing bool) ConfigOptionFunc
- func WithTracingStdout(stdout bool) ConfigOptionFunc
- func WithUnsafeFullPotRewardsOnStandardNetworks(enabled bool) ConfigOptionFunc
- func WithUtxorpcPort(port uint) ConfigOptionFunc
- func WithUtxorpcTlsCertFilePath(path string) ConfigOptionFunc
- func WithUtxorpcTlsKeyFilePath(path string) ConfigOptionFunc
- func WithValidateForgedBlock(enabled bool) ConfigOptionFunc
- func WithValidateHistorical(validate bool) ConfigOptionFunc
- type HistoryExpiryConfig
- type KoiosParityConfig
- type ListenerConfig
- type MidnightConfig
- type Node
- func (n *Node) Restore(ctx context.Context, snapshotDir string) (lifecycle.Manifest, error)
- func (n *Node) Run(ctx context.Context) (runErr error)
- func (n *Node) Snapshot(ctx context.Context, destDir string, name string, description string) (lifecycle.Manifest, error)
- func (n *Node) Stop() error
- func (n *Node) Truncate(ctx context.Context, target dblifecycle.TruncateTarget) (uint64, error)
- type OffchainMetadataConfig
- type StorageMode
- type TokenRegistryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DatabaseWorkerPoolConfig ledger.DatabaseWorkerPoolConfig
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(opts ...ConfigOptionFunc) Config
NewConfig creates a new dingo config with the specified options. This is primarily for programmatic use (library API).
func NewConfigFromInternal ¶ added in v0.69.0
func NewConfigFromInternal( cfg *internalconfig.Config, logger *slog.Logger, cardanoCfg *cardano.CardanoNodeConfig, topoCfg *topology.TopologyConfig, promRegistry prometheus.Registerer, ) (Config, error)
NewConfigFromInternal creates a Config from an already-loaded internal configuration, along with runtime-only dependencies (logger, cardano config, topology). This is the main path for the dingo CLI and node startup, eliminating manual field-by-field mapping.
func (*Config) API ¶ added in v0.70.0
func (c *Config) API() internalconfig.APIConfig
API returns the shared api.tls policy defaults applied to every selected plugins.api.* provider. See WithAPIConfig.
func (*Config) APIConfig ¶ added in v0.70.0
func (c *Config) APIConfig() internalconfig.APIConfig
APIConfig returns the shared api.tls policy defaults applied to every selected plugins.api.* provider unless overridden. See WithAPIConfig and ARCHITECTURE.md's "API security" section.
func (*Config) ActivePeersGossipQuota ¶ added in v0.69.0
ActivePeersGossipQuota returns the per-source quota for gossip peers.
func (*Config) ActivePeersLedgerQuota ¶ added in v0.69.0
ActivePeersLedgerQuota returns the per-source quota for ledger peers.
func (*Config) ActivePeersTopologyQuota ¶ added in v0.69.0
ActivePeersTopologyQuota returns the per-source quota for topology peers.
func (*Config) BackfillBatchSize ¶ added in v0.69.0
BackfillBatchSize returns the batch size for database backfill operations.
func (*Config) BarkBaseUrl ¶ added in v0.69.0
BarkBaseUrl returns the base URL for the Bark service.
func (*Config) BarkBlockDownloadHosts ¶ added in v0.69.0
BarkBlockDownloadHosts returns the list of allowed hosts for block downloads via Bark.
func (*Config) BarkOperatorCertificateFingerprints ¶ added in v0.70.2
BarkOperatorCertificateFingerprints returns the SHA-256 client certificate fingerprints authorized to invoke destructive Bark DatabaseService RPCs.
func (*Config) BarkPort ¶ added in v0.69.0
BarkPort returns the Bark API port. 0 disables the server.
func (*Config) BindAddr ¶ added in v0.69.0
BindAddr returns the IP address for relay and metrics listeners.
func (*Config) BlobPlugin ¶ added in v0.69.0
BlobPlugin returns the configured blob storage plugin name.
func (*Config) BlockProducer ¶ added in v0.69.0
BlockProducer returns whether block production mode is enabled.
func (*Config) BlockfrostPort ¶ added in v0.69.0
BlockfrostPort returns the Blockfrost API port. 0 disables the server.
func (*Config) CORSAllowedOrigins ¶ added in v0.69.0
CORSAllowedOrigins returns the CORS allowed origins list.
func (*Config) Cache ¶ added in v0.69.0
func (c *Config) Cache() internalconfig.CacheConfig
Cache returns the cache configuration.
func (*Config) CardanoConfig ¶ added in v0.69.0
CardanoConfig returns the path to the cardano-node config JSON file.
func (*Config) CardanoNodeConfig ¶ added in v0.69.0
func (c *Config) CardanoNodeConfig() *cardano.CardanoNodeConfig
CardanoNodeConfig returns the loaded Cardano node configuration.
func (*Config) Chainsync ¶ added in v0.69.0
func (c *Config) Chainsync() internalconfig.ChainsyncConfig
Chainsync returns the chainsync configuration.
func (*Config) ChainsyncStallTimeoutDuration ¶ added in v0.69.0
ChainsyncStallTimeoutDuration returns the parsed chainsync stall timeout.
func (*Config) DatabasePath ¶ added in v0.69.0
DatabasePath returns the persistent data directory path.
func (*Config) DatabaseQueueSize ¶ added in v0.69.0
DatabaseQueueSize returns the database task queue size.
func (*Config) DatabaseWorkers ¶ added in v0.69.0
DatabaseWorkers returns the number of database worker goroutines.
func (*Config) DebugPort ¶ added in v0.69.0
DebugPort returns the pprof debug endpoint port. 0 disables the endpoint.
func (*Config) EvictionWatermark ¶ added in v0.69.0
EvictionWatermark returns the mempool eviction watermark (0.0-1.0).
func (*Config) ForgeAppliedTipStalenessSlots ¶ added in v0.70.10
ForgeAppliedTipStalenessSlots returns how many slots older than the current slot the newest block this node holds may be before forging is skipped. 0 disables the wall-clock backstop.
func (*Config) ForgeEndorserBlockStalenessSlots ¶ added in v0.70.10
ForgeEndorserBlockStalenessSlots returns how far a corroborated Leios endorser block may lead the ledger-applied tip before forging is skipped. 0 disables the bound.
func (*Config) ForgePrimaryChainTipToleranceSlots ¶ added in v0.70.10
ForgePrimaryChainTipToleranceSlots returns how far the ledger-applied tip may trail this node's own primary chain tip before forging is skipped.
func (*Config) ForgeStaleGapThresholdSlots ¶ added in v0.69.0
ForgeStaleGapThresholdSlots returns the stale gap threshold for warnings.
func (*Config) ForgeSyncToleranceSlots ¶ added in v0.69.0
ForgeSyncToleranceSlots returns the sync tolerance for block forging.
func (*Config) ForgeUpstreamStalenessSlots ¶ added in v0.70.10
ForgeUpstreamStalenessSlots returns how far the newest block this node holds may trail the corroborated upstream sync target before forging is skipped.
func (*Config) GenesisBootstrap ¶ added in v0.69.0
func (c *Config) GenesisBootstrap() internalconfig.GenesisBootstrapConfig
GenesisBootstrap returns the Genesis bootstrap configuration.
func (*Config) HistoryExpiry ¶ added in v0.69.0
func (c *Config) HistoryExpiry() internalconfig.HistoryExpiryConfig
HistoryExpiry returns the history expiry configuration.
func (*Config) ImmutableDbPath ¶ added in v0.69.0
ImmutableDbPath returns the path to an external ImmutableDB for load mode.
func (*Config) InactivityTimeout ¶ added in v0.69.0
InactivityTimeout returns the hot peer inactivity timeout.
func (*Config) InboundCooldown ¶ added in v0.69.0
InboundCooldown returns the cooldown period after inbound demotion.
func (*Config) InboundDuplexOnlyForHot ¶ added in v0.69.0
InboundDuplexOnlyForHot returns whether duplex is required for hot inbound.
func (*Config) InboundHotQuota ¶ added in v0.69.0
InboundHotQuota returns the inbound hot peer quota.
func (*Config) InboundHotScoreThreshold ¶ added in v0.69.0
InboundHotScoreThreshold returns the score threshold for inbound hot promotion.
func (*Config) InboundMinTenure ¶ added in v0.69.0
InboundMinTenure returns the minimum tenure before inbound promotion.
func (*Config) InboundPruneAfter ¶ added in v0.69.0
InboundPruneAfter returns the duration before pruning idle inbound connections.
func (*Config) InboundWarmTarget ¶ added in v0.69.0
InboundWarmTarget returns the inbound warm peer target.
func (*Config) IntersectPoints ¶ added in v0.69.0
IntersectPoints returns the intersect points for chainsync.
func (*Config) IntersectTip ¶ added in v0.69.0
IntersectTip returns whether to start chainsync at the current chain tip.
func (*Config) LedgerCatchupTimeout ¶ added in v0.69.0
LedgerCatchupTimeout returns the maximum wait time for ledger catchup.
func (*Config) LedgerPeerTarget ¶ added in v0.69.0
LedgerPeerTarget returns the target number of ledger peers.
func (*Config) LeiosPipelineTiming ¶ added in v0.69.0
func (c *Config) LeiosPipelineTiming() *leios.PipelineTiming
LeiosPipelineTiming returns the Leios pipeline timing configuration.
func (*Config) LeiosVoteSigningKeyFile ¶ added in v0.69.0
LeiosVoteSigningKeyFile returns the path to the Leios vote signing key.
func (*Config) Listeners ¶ added in v0.69.0
func (c *Config) Listeners() []ListenerConfig
Listeners returns the configured listener configurations.
func (*Config) Logging ¶ added in v0.69.0
func (c *Config) Logging() internalconfig.LoggingConfig
Logging returns the logging configuration.
func (*Config) MaxConnectionsPerIP ¶ added in v0.69.0
MaxConnectionsPerIP returns the max concurrent inbound connections per IP.
func (*Config) MaxInboundConns ¶ added in v0.69.0
MaxInboundConns returns the maximum total inbound connections.
func (*Config) MaxKESEvolutions ¶ added in v0.69.0
MaxKESEvolutions returns the maximum number of KES key evolutions.
func (*Config) MempoolCapacity ¶ added in v0.69.0
MempoolCapacity returns the mempool capacity in bytes.
func (*Config) MeshPort ¶ added in v0.69.0
MeshPort returns the Mesh (Rosetta) API port. 0 disables the server.
func (*Config) MetadataPlugin ¶ added in v0.69.0
MetadataPlugin returns the configured metadata storage plugin name.
func (*Config) MetricsPort ¶ added in v0.69.0
MetricsPort returns the Prometheus metrics endpoint port.
func (*Config) Midnight ¶ added in v0.69.0
func (c *Config) Midnight() internalconfig.MidnightConfig
Midnight returns the Midnight indexer configuration.
func (*Config) MinHotPeers ¶ added in v0.69.0
MinHotPeers returns the minimum hot peers before aggressive promotion.
func (*Config) Mithril ¶ added in v0.69.0
func (c *Config) Mithril() internalconfig.MithrilConfig
Mithril returns the Mithril bootstrap configuration.
func (*Config) NetworkMagic ¶ added in v0.69.0
NetworkMagic returns the configured network magic value.
func (*Config) OffchainMetadata ¶ added in v0.69.0
func (c *Config) OffchainMetadata() internalconfig.OffchainMetadataConfig
OffchainMetadata returns the off-chain metadata fetcher configuration.
func (*Config) PeerSharing ¶ added in v0.69.0
PeerSharing returns the peer sharing configuration.
func (*Config) PrivateBindAddr ¶ added in v0.69.0
PrivateBindAddr returns the IP address for the private NtC listener.
func (*Config) PrivatePort ¶ added in v0.69.0
PrivatePort returns the port for the private NtC listener.
func (*Config) PrometheusRegistry ¶ added in v0.69.0
func (c *Config) PrometheusRegistry() prometheus.Registerer
PrometheusRegistry returns the Prometheus registry for metrics.
func (*Config) ReconcileInterval ¶ added in v0.69.0
ReconcileInterval returns the peer governor reconciliation interval.
func (*Config) RejectionWatermark ¶ added in v0.69.0
RejectionWatermark returns the mempool rejection watermark (0.0-1.0).
func (*Config) RelayPort ¶ added in v0.69.0
RelayPort returns the source port for outbound connections.
func (*Config) RunMode ¶ added in v0.69.0
func (c *Config) RunMode() internalconfig.RunMode
RunMode returns the operational mode (serve, load, dev, or leios).
func (*Config) SetStorageMode ¶ added in v0.69.0
SetStorageMode updates the storage mode. This is used during validation when a mode-specific default must be applied.
func (*Config) SetTargetNumberOfActivePeers ¶ added in v0.69.0
SetTargetNumberOfActivePeers updates the active peers target. This is used when applying cardano-node config fallbacks.
func (*Config) SetTargetNumberOfEstablishedPeers ¶ added in v0.69.0
SetTargetNumberOfEstablishedPeers updates the established peers target. This is used when applying cardano-node config fallbacks.
func (*Config) SetTargetNumberOfKnownPeers ¶ added in v0.69.0
SetTargetNumberOfKnownPeers updates the known peers target. This is used when applying cardano-node config fallbacks.
func (*Config) ShelleyKESKey ¶ added in v0.69.0
ShelleyKESKey returns the path to the KES signing key file.
func (*Config) ShelleyOperationalCertificate ¶ added in v0.69.0
ShelleyOperationalCertificate returns the path to the operational certificate.
func (*Config) ShelleyVRFKey ¶ added in v0.69.0
ShelleyVRFKey returns the path to the VRF signing key file.
func (*Config) ShutdownTimeout ¶ added in v0.69.0
ShutdownTimeout returns the graceful shutdown timeout as a string duration.
func (*Config) ShutdownTimeoutDuration ¶ added in v0.69.0
ShutdownTimeoutDuration parses the configured graceful shutdown timeout.
func (*Config) SlotsPerKESPeriod ¶ added in v0.69.0
SlotsPerKESPeriod returns the number of slots per KES period.
func (*Config) SocketPath ¶ added in v0.69.0
SocketPath returns the path to the UNIX domain socket for local client API.
func (*Config) StartEra ¶ added in v0.69.0
func (c *Config) StartEra() internalconfig.StartEra
StartEra returns the experimental direct startup era.
func (*Config) StorageMode ¶ added in v0.69.0
StorageMode returns the storage mode (core or api).
func (*Config) StorageModeEnum ¶ added in v0.69.0
func (c *Config) StorageModeEnum() StorageMode
StorageModeEnum returns the storage mode as the typed StorageMode.
func (*Config) StrictUtxoValidation ¶ added in v0.69.0
StrictUtxoValidation returns whether to error out when a consumed UTxO cannot be found.
func (*Config) TargetNumberOfActivePeers ¶ added in v0.69.0
TargetNumberOfActivePeers returns the target number of active peers.
func (*Config) TargetNumberOfEstablishedPeers ¶ added in v0.69.0
TargetNumberOfEstablishedPeers returns the target number of established peers.
func (*Config) TargetNumberOfKnownPeers ¶ added in v0.69.0
TargetNumberOfKnownPeers returns the target number of known peers.
func (*Config) TargetNumberOfRootPeers ¶ added in v0.70.1
TargetNumberOfRootPeers returns the target number of root peers.
func (*Config) TlsCertFilePath ¶ added in v0.69.0
TlsCertFilePath returns the path to the TLS certificate for gRPC APIs.
func (*Config) TlsKeyFilePath ¶ added in v0.69.0
TlsKeyFilePath returns the path to the TLS key for gRPC APIs.
func (*Config) TokenRegistry ¶ added in v0.70.1
func (c *Config) TokenRegistry() internalconfig.TokenRegistryConfig
TokenRegistry returns the CIP-26 token registry sync configuration.
func (*Config) TopologyConfig ¶ added in v0.69.0
func (c *Config) TopologyConfig() *topology.TopologyConfig
TopologyConfig returns the loaded topology configuration.
func (*Config) Tracing ¶ added in v0.69.0
Tracing returns whether OpenTelemetry tracing is enabled.
func (*Config) TracingStdout ¶ added in v0.69.0
TracingStdout returns whether tracing output goes to stdout.
func (*Config) UtxorpcPort ¶ added in v0.69.0
UtxorpcPort returns the UTxO RPC gRPC API port. 0 disables the server.
func (*Config) ValidateForgedBlock ¶ added in v0.69.0
ValidateForgedBlock returns whether to self-validate forged blocks.
func (*Config) ValidateHistorical ¶ added in v0.69.0
ValidateHistorical returns whether to validate all historical blocks.
type ConfigOptionFunc ¶
type ConfigOptionFunc func(*Config)
ConfigOptionFunc is a type that represents functions that modify the Connection config
func WithAPIConfig ¶ added in v0.70.0
func WithAPIConfig(cfg internalconfig.APIConfig) ConfigOptionFunc
WithAPIConfig sets the shared api.tls policy applied to every selected plugins.api.* provider (Blockfrost, Mesh, UTxORPC) unless that provider's own plugins.api.<name>.config.tls overrides a field. See internal/apiconfig and ARCHITECTURE.md's "API security" section.
func WithActivePeersQuotas ¶ added in v0.21.0
func WithActivePeersQuotas( topologyQuota, gossipQuota, ledgerQuota int, ) ConfigOptionFunc
WithActivePeersQuotas specifies the per-source quotas for active peers. Use 0 to use the default quota, or a negative value to disable enforcement. Default quotas: topology=20, gossip=20, ledger=20
func WithBarkBaseUrl ¶ added in v0.22.0
func WithBarkBaseUrl(baseUrl string) ConfigOptionFunc
func WithBarkBlockDownloadHosts ¶ added in v0.61.2
func WithBarkBlockDownloadHosts(hosts []string) ConfigOptionFunc
func WithBarkClientCAFilePath ¶ added in v0.69.0
func WithBarkClientCAFilePath(path string) ConfigOptionFunc
WithBarkClientCAFilePath sets the PEM CA bundle Bark uses to authenticate every DatabaseService caller. Destructive methods additionally require an allowlisted fingerprint set by WithBarkOperatorCertificateFingerprints.
func WithBarkHost ¶ added in v0.69.0
func WithBarkHost(host string) ConfigOptionFunc
WithBarkHost sets the interface Bark binds to. Empty leaves it to node.go's own safe-default logic (loopback-only when the database lifecycle service is mounted, all interfaces otherwise) rather than forcing a value here.
func WithBarkOperatorCertificateFingerprints ¶ added in v0.70.2
func WithBarkOperatorCertificateFingerprints( fingerprints []string, ) ConfigOptionFunc
WithBarkOperatorCertificateFingerprints sets the SHA-256 client certificate fingerprints authorized to invoke destructive DatabaseService RPCs.
func WithBarkPort ¶ added in v0.22.0
func WithBarkPort(port uint) ConfigOptionFunc
func WithBindAddr ¶ added in v0.22.0
func WithBindAddr(addr string) ConfigOptionFunc
WithBindAddr specifies the IP address used by relay, metrics, and public Blockfrost, Mesh, and UTxO RPC listeners. The default is 0.0.0.0.
func WithBlobPlugin ¶ added in v0.21.0
func WithBlobPlugin(plugin string) ConfigOptionFunc
WithBlobPlugin specifies the blob storage plugin to use.
func WithBlockProducer ¶ added in v0.22.0
func WithBlockProducer(enabled bool) ConfigOptionFunc
WithBlockProducer enables block production mode (CARDANO_BLOCK_PRODUCER). When enabled, the node will attempt to produce blocks using the configured credentials.
func WithBlockfrostPort ¶ added in v0.22.0
func WithBlockfrostPort(port uint) ConfigOptionFunc
WithBlockfrostPort specifies the port for the Blockfrost-compatible REST API server. The server binds to the node's bindAddr on this port. 0 disables the server (default).
func WithBootstrapPromotionMinDiversityGroups ¶ added in v0.37.0
func WithBootstrapPromotionMinDiversityGroups(n int) ConfigOptionFunc
WithBootstrapPromotionMinDiversityGroups sets the minimum number of bootstrap-time peer diversity groups to prefer before falling back to pure score ordering. Non-positive values use the peer-governor default.
func WithCORSAllowedOrigins ¶ added in v0.50.0
func WithCORSAllowedOrigins(origins []string) ConfigOptionFunc
WithCORSAllowedOrigins configures browser CORS access for public API servers. Use []string{"*"} to allow any origin, or an empty list to disable CORS headers.
func WithCacheConfig ¶ added in v0.29.0
func WithCacheConfig( blockLRU, hotUtxo, hotTx int, hotTxMaxBytes int64, ) ConfigOptionFunc
WithCacheConfig sets the CBOR cache sizes for block LRU, hot UTxO, and hot TX caches.
func WithCardanoNodeConfig ¶
func WithCardanoNodeConfig( cardanoNodeConfig *cardano.CardanoNodeConfig, ) ConfigOptionFunc
WithCardanoNodeConfig specifies the CardanoNodeConfig object to use. This is mostly used for loading genesis config files referenced by the dingo config
func WithChainsyncHeaderStrategy ¶ added in v0.55.0
func WithChainsyncHeaderStrategy( strategy chainsync.HeaderSyncStrategy, ) ConfigOptionFunc
WithChainsyncHeaderStrategy selects how headers from multiple eligible chainsync peers drive ledger ingress. The default is chainsync.HeaderSyncStrategyPrimary (single active peer with failover).
func WithChainsyncMaxClients ¶ added in v0.22.0
func WithChainsyncMaxClients( maxClients int, ) ConfigOptionFunc
WithChainsyncMaxClients specifies the maximum number of concurrent chainsync client connections. Default is 3.
func WithChainsyncStallTimeout ¶ added in v0.22.0
func WithChainsyncStallTimeout( timeout time.Duration, ) ConfigOptionFunc
WithChainsyncStallTimeout specifies the duration after which a chainsync client with no activity is considered stalled. Default is 2 minutes.
func WithDatabaseLifecycle ¶ added in v0.69.0
func WithDatabaseLifecycle( cfg internalconfig.DatabaseLifecycleConfig, ) ConfigOptionFunc
WithDatabaseLifecycle specifies configuration for automatic epoch-boundary database snapshots (see dblifecycle.Manager).
func WithDatabasePath ¶
func WithDatabasePath(dataDir string) ConfigOptionFunc
WithDatabasePath specifies the persistent data directory to use. The default is to store everything in memory
func WithDatabaseWorkerPoolConfig ¶ added in v0.20.0
func WithDatabaseWorkerPoolConfig( cfg ledger.DatabaseWorkerPoolConfig, ) ConfigOptionFunc
WithDatabaseWorkerPoolConfig specifies the database worker pool configuration
func WithDelegatorInactivity ¶ added in v0.67.0
func WithDelegatorInactivity(enabled bool, epochs uint64) ConfigOptionFunc
func WithEvictionWatermark ¶ added in v0.22.0
func WithEvictionWatermark( watermark float64, ) ConfigOptionFunc
WithEvictionWatermark sets the mempool eviction watermark as a fraction of capacity [0.0-1.0). When a new TX would push the mempool past this fraction, oldest TXs are evicted to make room. A value of 0 disables eviction. Default is 0.
func WithForgeAppliedTipStalenessSlots ¶ added in v0.70.10
func WithForgeAppliedTipStalenessSlots(slots uint64) ConfigOptionFunc
WithForgeAppliedTipStalenessSlots sets how many slots older than the current slot the newest block this node holds may be before forging is skipped. 0 disables this wall-clock backstop.
func WithForgeEndorserBlockStalenessSlots ¶ added in v0.70.10
func WithForgeEndorserBlockStalenessSlots(slots uint64) ConfigOptionFunc
WithForgeEndorserBlockStalenessSlots sets how far a corroborated Leios endorser block may lead the ledger-applied tip before forging is skipped. 0 (the default) DISABLES the bound -- it is not "fall back to a built-in default", and nothing fills it in: see internal/config.DefaultForgeEndorserBlockStalenessSlots, which is itself 0.
Deliberately separate from WithForgePrimaryChainTipToleranceSlots: that one bounds a local block-against-block comparison, this one bounds a network-stage announcement watermark against the local applied tip.
func WithForgePrimaryChainTipToleranceSlots ¶ added in v0.70.10
func WithForgePrimaryChainTipToleranceSlots(slots uint64) ConfigOptionFunc
WithForgePrimaryChainTipToleranceSlots sets how far the ledger-applied tip may trail this node's own primary chain tip before forging is skipped. Use 0 to fall back to the built-in default.
func WithForgeStaleGapThresholdSlots ¶ added in v0.22.0
func WithForgeStaleGapThresholdSlots(slots uint64) ConfigOptionFunc
WithForgeStaleGapThresholdSlots sets the slot gap threshold for stale database warnings. Use 0 to fall back to the built-in default.
func WithForgeSyncToleranceSlots ¶ added in v0.22.0
func WithForgeSyncToleranceSlots(slots uint64) ConfigOptionFunc
WithForgeSyncToleranceSlots sets the slot gap tolerated before forging is skipped. Use 0 to fall back to the built-in default.
func WithForgeUpstreamStalenessSlots ¶ added in v0.70.10
func WithForgeUpstreamStalenessSlots(slots uint64) ConfigOptionFunc
WithForgeUpstreamStalenessSlots sets how far the newest block this node holds may trail the corroborated upstream sync target before forging is skipped. 0 (the default) DISABLES the bound -- it is not "fall back to a built-in default", and nothing fills it in: see internal/config.DefaultForgeUpstreamStalenessSlots, which is itself 0.
func WithFullPotRewards ¶ added in v0.67.0
func WithFullPotRewards(enabled bool) ConfigOptionFunc
func WithGenesisBootstrap ¶ added in v0.37.0
func WithGenesisBootstrap(enabled bool) ConfigOptionFunc
WithGenesisBootstrap enables Genesis-mode chain selection during from-origin bootstrap. Genesis mode automatically exits once the local tip is within the configured Genesis window of the best known peer tip.
func WithGenesisCorroborationPeers ¶ added in v0.67.0
func WithGenesisCorroborationPeers(peers int) ConfigOptionFunc
func WithGenesisWindowSlots ¶ added in v0.37.0
func WithGenesisWindowSlots(slots uint64) ConfigOptionFunc
WithGenesisWindowSlots overrides the Genesis density comparison window. A zero value lets the node derive the window from Shelley genesis parameters using 3k/f.
func WithHistoryExpiry ¶ added in v0.52.0
func WithHistoryExpiry(cfg HistoryExpiryConfig) ConfigOptionFunc
WithHistoryExpiry configures local immutable block history expiry.
func WithInactivityTimeout ¶ added in v0.26.0
func WithInactivityTimeout(d time.Duration) ConfigOptionFunc
WithInactivityTimeout specifies how long a hot peer can be inactive before being demoted to warm. Non-positive values are ignored. Default: 10m.
func WithInboundPeerGovernance ¶ added in v0.37.0
func WithInboundPeerGovernance( warmTarget int, hotQuota int, minTenure time.Duration, hotScoreThreshold float64, pruneAfter time.Duration, duplexOnlyForHot bool, cooldown time.Duration, ) ConfigOptionFunc
WithInboundPeerGovernance specifies explicit inbound peer governance budget and phase-1 policy fields. Non-positive values use peer governor defaults.
func WithIntersectPoints ¶
func WithIntersectPoints(points []ocommon.Point) ConfigOptionFunc
WithIntersectPoints specifies intersect point(s) for the initial chainsync. The default is to start at chain genesis
func WithIntersectTip ¶
func WithIntersectTip(intersectTip bool) ConfigOptionFunc
WithIntersectTip specifies whether to start the initial chainsync at the current tip. The default is to start at chain genesis
func WithKoiosParity ¶ added in v0.69.0
func WithKoiosParity(cfg KoiosParityConfig) ConfigOptionFunc
WithKoiosParity configures the optional in-process Koios reward-parity observer (dingo #3098). See KoiosParityConfig's doc comment. This is how a library caller (or internal/node's composition of a real dingo.yaml/env config) enables live-driven parity validation for the node Run() starts — the one-off validation run and a normal sync share the same process and authoritative state path rather than requiring a second, separately synced Dingo instance.
func WithLedgerPeerTarget ¶ added in v0.31.0
func WithLedgerPeerTarget(n int) ConfigOptionFunc
WithLedgerPeerTarget specifies the target number of known ledger peers. Discovery will add peers only until this target is reached. Negative values disable ledger peer discovery, 0 uses defaultLedgerPeerTarget, and positive values use that target. Default: 20.
func WithLeiosPipelineTiming ¶ added in v0.54.0
func WithLeiosPipelineTiming(timing leios.PipelineTiming) ConfigOptionFunc
WithLeiosPipelineTiming overrides the provisional Leios pipeline stage timing windows. CIP-0164 has not finalized these parameters, so they are kept off-chain and overridable here rather than as protocol parameters. When unset, leios.DefaultPipelineTiming applies. Experimental, leios runMode only.
func WithLeiosVoteSigningKeyFile ¶ added in v0.53.0
func WithLeiosVoteSigningKeyFile(path string) ConfigOptionFunc
WithLeiosVoteSigningKeyFile specifies the path to a hex-encoded BLS12-381 Leios vote signing key (DINGO_LEIOS_VOTE_SIGNING_KEY_FILE). When set on a block producer whose pool is a Leios committee member, the node emits votes for endorser blocks. Experimental, leios runMode only.
func WithListeners ¶
func WithListeners(listeners ...ListenerConfig) ConfigOptionFunc
WithListeners specifies the listener config(s) to use
func WithLogger ¶
func WithLogger(logger *slog.Logger) ConfigOptionFunc
WithLogger specifies the logger to use. This defaults to discarding log output
func WithMaxConnectionsPerIP ¶ added in v0.26.0
func WithMaxConnectionsPerIP(n int) ConfigOptionFunc
WithMaxConnectionsPerIP specifies the maximum number of concurrent inbound connections from a single IP. Non-positive values are ignored. Default: 5.
func WithMaxInboundConns ¶ added in v0.26.0
func WithMaxInboundConns(n int) ConfigOptionFunc
WithMaxInboundConns specifies the maximum number of inbound connections. Non-positive values are ignored. Default: 100.
func WithMempoolCapacity ¶ added in v0.13.0
func WithMempoolCapacity(capacity int64) ConfigOptionFunc
WithMempoolCapacity sets the mempool capacity (in bytes)
func WithMeshPort ¶ added in v0.22.0
func WithMeshPort(port uint) ConfigOptionFunc
WithMeshPort specifies the port for the Mesh (Coinbase Rosetta) compatible REST API server. The server binds to the node's bindAddr on this port. 0 disables the server (default).
func WithMetadataPlugin ¶ added in v0.21.0
func WithMetadataPlugin(plugin string) ConfigOptionFunc
WithMetadataPlugin specifies the metadata storage plugin to use.
func WithMidnightConfig ¶ added in v0.55.0
func WithMidnightConfig(cfg MidnightConfig) ConfigOptionFunc
WithMidnightConfig configures the Midnight indexer and optional gRPC API.
func WithMinHotPeers ¶ added in v0.26.0
func WithMinHotPeers(n int) ConfigOptionFunc
WithMinHotPeers specifies the minimum number of hot peers before aggressive promotion is triggered. Non-positive values are ignored. Default: 10.
func WithMinPoolMargin ¶ added in v0.67.0
func WithMinPoolMargin(v uint) ConfigOptionFunc
func WithNetwork ¶
func WithNetwork(network string) ConfigOptionFunc
WithNetwork specifies the named network to operate on. This will automatically set the appropriate network magic value
func WithNetworkMagic ¶
func WithNetworkMagic(networkMagic uint32) ConfigOptionFunc
WithNetworkMagic specifies the network magic value to use. This will override any named network specified
func WithOffchainMetadataConfig ¶ added in v0.54.0
func WithOffchainMetadataConfig(cfg OffchainMetadataConfig) ConfigOptionFunc
WithOffchainMetadataConfig configures the API-mode off-chain metadata fetcher. Zero values use the fetcher's internal defaults.
func WithOutboundSourcePort ¶
func WithOutboundSourcePort(port uint) ConfigOptionFunc
WithOutboundSourcePort specifies the source port to use for outbound connections. This defaults to dynamic source ports
func WithPeerSharing ¶
func WithPeerSharing(peerSharing bool) ConfigOptionFunc
WithPeerSharing specifies whether to enable peer sharing. This is disabled by default
func WithPeerTargets ¶ added in v0.21.0
func WithPeerTargets( targetKnown, targetEstablished, targetActive int, ) ConfigOptionFunc
WithPeerTargets specifies the target number of peers in each state. Use 0 to use the default target, or -1 for unlimited. Default targets: known=150, established=50, active=20
func WithPledgeLeverage ¶ added in v0.67.0
func WithPledgeLeverage(enabled bool, v uint) ConfigOptionFunc
func WithPluginSelection ¶ added in v0.68.0
func WithPluginSelection( capability hostplugin.Capability, selection hostplugin.Selection, ) ConfigOptionFunc
func WithPrometheusRegistry ¶
func WithPrometheusRegistry(registry prometheus.Registerer) ConfigOptionFunc
WithPrometheusRegistry specifies a prometheus.Registerer instance to add metrics to. In most cases, prometheus.DefaultRegistry would be a good choice to get metrics working
func WithReconcileInterval ¶ added in v0.26.0
func WithReconcileInterval(d time.Duration) ConfigOptionFunc
WithReconcileInterval specifies how often the peer governor runs its reconciliation loop. Non-positive values are ignored. Default: 5m.
func WithRejectionWatermark ¶ added in v0.22.0
func WithRejectionWatermark( watermark float64, ) ConfigOptionFunc
WithRejectionWatermark sets the mempool rejection watermark as a fraction of capacity (0.0-1.0]. New TXs are rejected when the mempool would exceed this fraction. Default is 1.0.
func WithRootPeerTarget ¶ added in v0.70.1
func WithRootPeerTarget(targetRoot int) ConfigOptionFunc
WithRootPeerTarget specifies the target number of root peers from topology. Use 0 to use the default target, or -1 for unlimited.
func WithRunMode ¶ added in v0.21.0
func WithRunMode(mode string) ConfigOptionFunc
WithRunMode sets the operational mode ("serve", "load", or "dev"). "dev" mode enables development behaviors (forge blocks, disable outbound).
func WithShelleyKESKey ¶ added in v0.22.0
func WithShelleyKESKey(path string) ConfigOptionFunc
WithShelleyKESKey specifies the path to the KES signing key file (CARDANO_SHELLEY_KES_KEY). Required for block production.
func WithShelleyOperationalCertificate ¶ added in v0.22.0
func WithShelleyOperationalCertificate(path string) ConfigOptionFunc
WithShelleyOperationalCertificate specifies the path to the operational certificate file (CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE). Required for block production.
func WithShelleyVRFKey ¶ added in v0.22.0
func WithShelleyVRFKey(path string) ConfigOptionFunc
WithShelleyVRFKey specifies the path to the VRF signing key file (CARDANO_SHELLEY_VRF_KEY). Required for block production.
func WithShutdownTimeout ¶ added in v0.18.0
func WithShutdownTimeout(timeout time.Duration) ConfigOptionFunc
WithShutdownTimeout specifies the timeout for graceful shutdown. The default is 30 seconds
func WithStartEra ¶ added in v0.51.0
func WithStartEra(startEra string) ConfigOptionFunc
WithStartEra sets the experimental direct startup era. Empty uses the genesis protocol version; "dijkstra" starts directly in the Dijkstra era.
func WithStorageMode ¶ added in v0.22.0
func WithStorageMode(mode StorageMode) ConfigOptionFunc
WithStorageMode specifies the storage mode. StorageModeCore stores only consensus data; StorageModeAPI adds full transaction metadata for API queries.
func WithStrictUtxoValidation ¶ added in v0.61.2
func WithStrictUtxoValidation(strict bool) ConfigOptionFunc
WithStrictUtxoValidation specifies whether an unrecoverable consumed UTxO past the recorded Mithril sync boundary is a hard error rather than a silently skipped condition. See database.Config.StrictUtxoValidation.
func WithTokenRegistryConfig ¶ added in v0.70.1
func WithTokenRegistryConfig(cfg TokenRegistryConfig) ConfigOptionFunc
WithTokenRegistryConfig configures the API-mode CIP-26 token registry sync. Zero values use the syncer's internal defaults.
func WithTopologyConfig ¶
func WithTopologyConfig( topologyConfig *topology.TopologyConfig, ) ConfigOptionFunc
WithTopologyConfig specifies a topology.TopologyConfig to use for outbound peers
func WithTracing ¶
func WithTracing(tracing bool) ConfigOptionFunc
WithTracing enables tracing. By default, spans are submitted to a HTTP(s) endpoint using OTLP. This can be configured using the OTEL_EXPORTER_OTLP_* env vars documented in the README for go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
func WithTracingStdout ¶
func WithTracingStdout(stdout bool) ConfigOptionFunc
WithTracingStdout enables tracing output to stdout. This also requires tracing to enabled separately. This is mostly useful for debugging
func WithUnsafeFullPotRewardsOnStandardNetworks ¶ added in v0.67.0
func WithUnsafeFullPotRewardsOnStandardNetworks(enabled bool) ConfigOptionFunc
func WithUtxorpcPort ¶ added in v0.2.2
func WithUtxorpcPort(port uint) ConfigOptionFunc
WithUtxorpcPort specifies the port to use for the gRPC API listener. 0 disables the server (default)
func WithUtxorpcTlsCertFilePath ¶ added in v0.3.2
func WithUtxorpcTlsCertFilePath(path string) ConfigOptionFunc
WithUtxorpcTlsCertFilePath specifies the path to the TLS certificate for the gRPC API listener. This defaults to empty
func WithUtxorpcTlsKeyFilePath ¶ added in v0.3.2
func WithUtxorpcTlsKeyFilePath(path string) ConfigOptionFunc
WithUtxorpcTlsKeyFilePath specifies the path to the TLS key for the gRPC API listener. This defaults to empty
func WithValidateForgedBlock ¶ added in v0.58.0
func WithValidateForgedBlock(enabled bool) ConfigOptionFunc
WithValidateForgedBlock controls self-validation of locally-forged blocks before they are adopted onto the chain and diffused to peers. When enabled, the forger runs VRF/KES header crypto, body-hash consistency, and per-tx ledger validation on each forged block. A failing block is dropped without being adopted or diffused. Enabled by default; pass false only to explicitly opt out.
func WithValidateHistorical ¶ added in v0.17.0
func WithValidateHistorical(validate bool) ConfigOptionFunc
WithValidateHistorical specifies whether to validate all historical blocks during ledger processing
type HistoryExpiryConfig ¶ added in v0.52.0
HistoryExpiryConfig controls local expiry of immutable block history.
type KoiosParityConfig ¶ added in v0.69.0
type KoiosParityConfig struct {
// Enabled subscribes the observer to epoch.transition when true.
Enabled bool
// Network is the Koios network to validate against ("preview" or
// "preprod"). Empty defaults to this Config's own Network.
Network string
// CachePath is the Koios reference cache.db path. Empty defaults to
// {DatabasePath}/.koios/cache.db.
CachePath string
// BaseURL overrides the public koios.rest host for the network, for a
// self-hosted or mirrored Koios instance. Empty selects the public host.
BaseURL string
// AllowInsecureHTTP permits a plain-HTTP BaseURL. Local dev/test only.
AllowInsecureHTTP bool
// APIKey is the Koios Bearer token for higher-rate-limit access.
APIKey string
// Strict stops/cancels the node on the first Koios/tool error or exact
// parity mismatch rather than logging it and continuing normal
// operation.
Strict bool
// GraceHours is the window after an epoch closes during which a missing
// Dingo-side row is treated as reference/sync lag rather than a
// failure. 0 selects the default (24).
GraceHours int
// 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. A nil pointer defaults to true — see
// internalconfig.DefaultKoiosParityConfig — since a plain bool's zero
// value (false) can't be distinguished from an explicit opt-out. Pass a
// pointer to false to disable account-level checking explicitly.
Accounts *bool
// 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. Unused when Accounts resolves to false.
AccountChunkSize int
AccountChunkMaxBytes int
}
KoiosParityConfig controls the optional in-process Koios reward-parity observer (dingo #3098). When Enabled, Run() subscribes an observer to the node's own EventBus (event.EpochTransitionEventType) that validates each newly closed epoch's committed reward state directly against Koios reference data as the node advances — see internal/koiosparity and ARCHITECTURE.md's "Koios Parity Tracker" section. This is a one-off validation aid, not a permanent subsystem; leave Enabled false for normal node operation.
type ListenerConfig ¶
type ListenerConfig = connmanager.ListenerConfig
type MidnightConfig ¶ added in v0.55.0
type MidnightConfig struct {
Enabled bool
ServerEnabled bool
ReflectionEnabled bool
Port uint
Host string
CNightPolicyID string
CNightAssetName string
MappingValidatorAddress string
AuthTokenPolicyID string
AuthTokenAssetName string
CommitteeCandidateAddress string
TechnicalCommitteeAddress string
TechnicalCommitteePolicyID string
CouncilAddress string
CouncilPolicyID string
PermissionedCandidatePolicy string
}
MidnightConfig controls the Midnight indexer and optional gRPC listener. 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. ServerEnabled independently opts into the listener so persisted Midnight data can be served without running the indexer. Reflection remains a separate, default-off decision. TLS is optional.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) Restore ¶ added in v0.69.0
Restore replaces this running node's database with the snapshot at snapshotDir, quiescing and reinitializing every storage-dependent subsystem in-process (see this file's package comment for exactly what stays running and what gets rebuilt). The node is quiesced and its storage handles are closed first, because external providers cannot be reset while the node holds their connections. Restore then checks manifest compatibility, validates the complete archives and, for external providers, captures rollback copies before replacing either configured target. An incompatible snapshot is therefore rejected after the quiesce, not before it.
A bad snapshot is rejected with both original stores intact. A failure after a live external reset automatically restores the original metadata and blob pair before this method resumes the node. An incomplete automatic rollback, unconfirmed storage drain, unrecoverable local directory swap, or reinitialization failure brings the node down (n.cancel()) for a supervised restart.
func (*Node) Snapshot ¶ added in v0.69.0
func (n *Node) Snapshot( ctx context.Context, destDir string, name string, description string, ) (lifecycle.Manifest, error)
Snapshot captures a point-in-time backup of this running node's own database into destDir, which must not already exist. Unlike Restore/Truncate, this does not quiesce anything — Database.PauseCommits (see database/lifecycle.Snapshot) is enough to keep the blob and metadata backups consistent while the node keeps forging/syncing/ serving normally. It takes snapshotMu, not liveLifecycleMu, both to serialize against a concurrent Restore/Truncate closing n.db out from under it (Restore/Truncate take snapshotMu too, alongside their own liveLifecycleMu) and to match the bark DatabaseService's "only one operation at a time" invariant — see snapshotMu's own doc comment (node.go) for why a long-running Snapshot must not also hold liveLifecycleMu: that would block background readers like the chainsync recycler tick, which only need liveLifecycleMu to know whether n.ledgerState/n.chainsyncState are mid-rebuild, for a Snapshot that never touches either field. name/description label the snapshot (pass "" for either to leave it unlabeled) — see lifecycle.SnapshotToCloud's doc comment for why labeling must happen before any cloud mirroring.
func (*Node) Truncate ¶ added in v0.69.0
func (n *Node) Truncate( ctx context.Context, target dblifecycle.TruncateTarget, ) (uint64, error)
Truncate reverts this running node's database to target, per database/lifecycle.Truncate, quiescing and reinitializing every storage-dependent subsystem in-process. See Restore's doc comment for the availability and failure-mode caveats, which apply identically here, with one difference: a failure that occurred entirely during read-only target validation — a bad/out-of-range target, a target before the Mithril trust boundary, or a cancellation landing before any delete began (lifecycle.ErrTruncateNotStarted) — is known to have touched nothing on disk, so the node resumes normally on it instead of being torn down. A failure during or after the actual bulk delete still brings the node down: DeleteBlocksAfter batches its deletes (see database/lifecycle/blob_bulk_delete.go) rather than wrapping the whole truncate in one transaction, so a truncate spanning more than one batch can leave a partially-truncated, inconsistent database if interrupted mid-delete — recovering from that safely is not implemented today. Returns the number of blocks removed.
type OffchainMetadataConfig ¶ added in v0.54.0
type OffchainMetadataConfig struct {
HTTPClient *http.Client
Interval time.Duration
RequestTimeout time.Duration
UserAgent string
IPFSGatewayURL string
BatchSize int
MaxBytes int64
AllowPrivateAddresses bool
}
OffchainMetadataConfig controls API-mode off-chain metadata fetching. Zero values use the internal fetcher defaults.
type StorageMode ¶ added in v0.22.0
type StorageMode string
StorageMode controls how much data the metadata store persists.
const ( // StorageModeCore stores only consensus and chain state data. // Witnesses, scripts, datums, redeemers, and tx metadata CBOR // are skipped. Suitable for block producers with no APIs. StorageModeCore StorageMode = "core" // StorageModeAPI stores everything needed for API queries // (blockfrost, utxorpc, mesh) in addition to core data. StorageModeAPI StorageMode = "api" )
func (StorageMode) IsAPI ¶ added in v0.22.0
func (m StorageMode) IsAPI() bool
IsAPI returns true if the storage mode includes API data.
func (StorageMode) Valid ¶ added in v0.22.0
func (m StorageMode) Valid() bool
Valid returns true if the storage mode is a recognized value.
type TokenRegistryConfig ¶ added in v0.70.1
type TokenRegistryConfig struct {
HTTPClient *http.Client
SourceURL string
UserAgent string
Interval time.Duration
RequestTimeout time.Duration
MaxBytes int64
MaxEntryBytes int64
Enabled bool
StoreLogos bool
AllowPrivateAddresses bool
}
TokenRegistryConfig controls the API-mode CIP-26 token registry sync, which populates the `metadata` field of GET /assets/{asset}. Zero values use the internal syncer defaults. Disabled unless Enabled is set: the mainnet registry is a roughly 240MB download.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
utxorpc
Package utxorpc implements Dingo's UTxO RPC server, serving the utxorpc.v1alpha and utxorpc.v1beta gRPC APIs defined by the UTxO RPC spec.
|
Package utxorpc implements Dingo's UTxO RPC server, serving the utxorpc.v1alpha and utxorpc.v1beta gRPC APIs defined by the UTxO RPC spec. |
|
Package chain manages Dingo's blockchain state: the primary chain, any alternate (candidate) chains, fork detection, and rollback orchestration.
|
Package chain manages Dingo's blockchain state: the primary chain, any alternate (candidate) chains, fork detection, and rollback orchestration. |
|
Package chainselection implements multi-peer chain selection.
|
Package chainselection implements multi-peer chain selection. |
|
Package chainsync tracks the state of Dingo's block-synchronization sessions with connected peers.
|
Package chainsync tracks the state of Dingo's block-synchronization sessions with connected peers. |
|
cmd
|
|
|
dingo
command
|
|
|
koios-parity
command
koios-parity validates Dingo's closed-epoch reward state against Koios reference data on preview and preprod networks.
|
koios-parity validates Dingo's closed-epoch reward state against Koios reference data on preview and preprod networks. |
|
node-parity
command
node-parity compares Dingo's and a reference cardano-node's ledger state (protocol parameters, stake distribution, and the whole UTxO set) over their node-to-client LocalStateQuery interfaces, on preview or preprod (blinklabs-io/dingo#1900).
|
node-parity compares Dingo's and a reference cardano-node's ledger state (protocol parameters, stake distribution, and the whole UTxO set) over their node-to-client LocalStateQuery interfaces, on preview or preprod (blinklabs-io/dingo#1900). |
|
config
|
|
|
Package connmanager owns the lifecycle of network connections between Dingo and its peers and clients.
|
Package connmanager owns the lifecycle of network connections between Dingo and its peers and clients. |
|
consensus
|
|
|
praos
Package praos contains pure Praos chain-selection primitives: the select view projected from a Shelley-family block header, VRF output extraction, and the equal-length tiebreaker comparison functions that mirror ouroboros-consensus' PraosTiebreakerView and preferCandidate logic.
|
Package praos contains pure Praos chain-selection primitives: the select view projected from a Shelley-family block header, VRF output extraction, and the equal-length tiebreaker comparison functions that mirror ouroboros-consensus' PraosTiebreakerView and preferCandidate logic. |
|
Package database is Dingo's storage abstraction.
|
Package database is Dingo's storage abstraction. |
|
dbinfo
Package dbinfo records, in a small JSON sidecar file beside a dingo data directory, which metadata plugin produced the database it belongs to.
|
Package dbinfo records, in a small JSON sidecar file beside a dingo data directory, which metadata plugin produced the database it belongs to. |
|
lifecycle
Package lifecycle implements database snapshot, restore, and truncate operations shared by the offline CLI and (later) a live-node code path.
|
Package lifecycle implements database snapshot, restore, and truncate operations shared by the offline CLI and (later) a live-node code path. |
|
nodesettings
Package nodesettings holds the policy for settings that are persisted on first start and enforced on every subsequent start.
|
Package nodesettings holds the policy for settings that are persisted on first start and enforced on every subsequent start. |
|
plugin/blob/internal/blobbackup
Package blobbackup implements the shared backup/restore stream format used by cloud blob store plugins (s3, gcs) that have no native point-in-time snapshot primitive of their own -- a plain length-prefixed key/value stream produced by walking the store's existing Get/Set/NewIterator interface, distinct from badger's own native Backup/Load format.
|
Package blobbackup implements the shared backup/restore stream format used by cloud blob store plugins (s3, gcs) that have no native point-in-time snapshot primitive of their own -- a plain length-prefixed key/value stream produced by walking the store's existing Get/Set/NewIterator interface, distinct from badger's own native Backup/Load format. |
|
plugin/blob/internal/committimestamp
Package committimestamp decodes a blob-stored commit timestamp shared by every blob backend (badger, S3, GCS), rejecting a value that does not actually fit the int64 the rest of the codebase carries it as, rather than each backend separately risking silent truncation or wraparound.
|
Package committimestamp decodes a blob-stored commit timestamp shared by every blob backend (badger, S3, GCS), rejecting a value that does not actually fit the int64 the rest of the codebase carries it as, rather than each backend separately risking silent truncation or wraparound. |
|
plugin/blob/internal/compensate
Package compensate provides a disk-spooled compensation log for cloud blob transactions.
|
Package compensate provides a disk-spooled compensation log for cloud blob transactions. |
|
plugin/metadata/deferred
Package deferred holds the bulk-load deferred-index manifest.
|
Package deferred holds the bulk-load deferred-index manifest. |
|
plugin/metadata/internal/utxocond
Package utxocond builds fixed-shape "(tx_id = ? AND output_idx = ?)" OR-list conditions for the UTxO block-apply UPDATEs (consume, collateral, reference inputs) used by the shared metadata store.
|
Package utxocond builds fixed-shape "(tx_id = ? AND output_idx = ?)" OR-list conditions for the UTxO block-apply UPDATEs (consume, collateral, reference inputs) used by the shared metadata store. |
|
plugin/metadata/sqlstore
Package sqlstore contains the shared database/sql metadata store.
|
Package sqlstore contains the shared database/sql metadata store. |
|
plugin/metadata/sqlstore/migrations
Package migrations implements offline, forward-only metadata upgrades.
|
Package migrations implements offline, forward-only metadata upgrades. |
|
Package dmq implements phase 1 of CIP-0137's Decentralized Message Queue: the generic message pool shared by every DMQ topic instance.
|
Package dmq implements phase 1 of CIP-0137's Decentralized Message Queue: the generic message pool shared by every DMQ topic instance. |
|
Package event provides Dingo's EventBus: an in-process publish/ subscribe primitive that lets components communicate without holding references to each other.
|
Package event provides Dingo's EventBus: an in-process publish/ subscribe primitive that lets components communicate without holding references to each other. |
|
internal
|
|
|
apiconfig
Package apiconfig defines TLS configuration shared by built-in API providers.
|
Package apiconfig defines TLS configuration shared by built-in API providers. |
|
apilistener
Package apilistener owns the start/stop protocol shared by Dingo's HTTP API servers (api/blockfrost, api/mesh, api/utxorpc).
|
Package apilistener owns the start/stop protocol shared by Dingo's HTTP API servers (api/blockfrost, api/mesh, api/utxorpc). |
|
benchci
Package benchci implements CI benchmark regression detection for Dingo's weekly benchmark workflow (blinklabs-io/dingo#1895).
|
Package benchci implements CI benchmark regression detection for Dingo's weekly benchmark workflow (blinklabs-io/dingo#1895). |
|
benchci/cmd/benchcheck
command
Command benchcheck compares two `go test -bench` result files (produced by `make bench-ci`) via internal/benchci and writes a markdown regression report.
|
Command benchcheck compares two `go test -bench` result files (produced by `make bench-ci`) via internal/benchci and writes a markdown regression report. |
|
blockverify
Package blockverify re-derives a block's identity from its bytes so a remote blob backend (S3, GCS) cannot silently hand back the wrong block for a requested (slot, hash) key.
|
Package blockverify re-derives a block's identity from its bytes so a remote blob backend (S3, GCS) cannot silently hand back the wrong block for a requested (slot, hash) key. |
|
chainsyncrecycler
Package chainsyncrecycler detects stalled chainsync clients and recycles truly stuck connections.
|
Package chainsyncrecycler detects stalled chainsync clients and recycles truly stuck connections. |
|
dblifecycle
Package dblifecycle is the single entry point the CLI (and, in a later phase, a gRPC surface) calls to perform database snapshot, restore, and truncate operations, so both front ends run exactly the same code path.
|
Package dblifecycle is the single entry point the CLI (and, in a later phase, a gRPC surface) calls to perform database snapshot, restore, and truncate operations, so both front ends run exactly the same code path. |
|
fsyncdir
Package fsyncdir syncs a directory's own entries (a new or renamed file appearing in it) to disk, so that change is durable across a crash, not just the changed file's own content -- a file's own fsync does not guarantee its directory entry is persisted.
|
Package fsyncdir syncs a directory's own entries (a new or renamed file appearing in it) to disk, so that change is durable across a crash, not just the changed file's own content -- a file's own fsync does not guarantee its directory entry is persisted. |
|
nodeparity
Package nodeparity compares Dingo's and a reference cardano-node's ledger state over their node-to-client (NtC) LocalStateQuery interfaces, for blinklabs-io/dingo#1900.
|
Package nodeparity compares Dingo's and a reference cardano-node's ledger state over their node-to-client (NtC) LocalStateQuery interfaces, for blinklabs-io/dingo#1900. |
|
plugins
Package plugins contains application-composition registration for all providers compiled into this binary.
|
Package plugins contains application-composition registration for all providers compiled into this binary. |
|
settingsresolve
Package settingsresolve lets a data directory's already-persisted node settings supply the effective value for any override-eligible gate an operator left at its built-in default, before the rest of configuration resolution runs.
|
Package settingsresolve lets a data directory's already-persisted node settings supply the effective value for any override-eligible gate an operator left at its built-in default, before the rest of configuration resolution runs. |
|
test/conformance
Package conformance provides a DingoStateManager that implements the ouroboros-mock conformance.StateManager interface using dingo's ledger state models.
|
Package conformance provides a DingoStateManager that implements the ouroboros-mock conformance.StateManager interface using dingo's ledger state models. |
|
test/dbtest
Package dbtest composes storage providers for tests that need a real database without putting provider construction back into package database.
|
Package dbtest composes storage providers for tests that need a real database without putting provider construction back into package database. |
|
test/devnet
Package devnet provides a test harness for running integration tests against a private Cardano DevNet consisting of Dingo and cardano-node instances connected via Docker Compose.
|
Package devnet provides a test harness for running integration tests against a private Cardano DevNet consisting of Dingo and cardano-node instances connected via Docker Compose. |
|
test/fixtures
Package fixtures contains small, valid protocol fixtures for Dingo tests.
|
Package fixtures contains small, valid protocol fixtures for Dingo tests. |
|
test/storagetest
Package storagetest is a shared conformance suite for blob.BlobStore and metadata.MetadataStore implementations.
|
Package storagetest is a shared conformance suite for blob.BlobStore and metadata.MetadataStore implementations. |
|
test/testutil
Package testutil provides common test helper utilities for the Dingo project.
|
Package testutil provides common test helper utilities for the Dingo project. |
|
Package keystore provides key management for Cardano stake pool operators.
|
Package keystore provides key management for Cardano stake pool operators. |
|
Package ledger owns Dingo's consensus-critical state: the UTxO set, protocol parameters, stake distribution, certificates, governance actions, epoch/nonce bookkeeping, and Plutus script execution.
|
Package ledger owns Dingo's consensus-critical state: the UTxO set, protocol parameters, stake distribution, certificates, governance actions, epoch/nonce bookkeeping, and Plutus script execution. |
|
forging
Package forging contains types and utilities for block production.
|
Package forging contains types and utilities for block production. |
|
hardfork
Package hardfork provides the HardFork Combinator primitives used by the ledger to reason about multi-era chain time, epoch, and slot conversions.
|
Package hardfork provides the HardFork Combinator primitives used by the ledger to reason about multi-era chain time, epoch, and slot conversions. |
|
leader
Package leader provides Ouroboros Praos leader election functionality for block production.
|
Package leader provides Ouroboros Praos leader election functionality for block production. |
|
leios
Package leios implements the CIP-0164 stake-truncated voting committee, stake-quorum vote tallying, and endorser-block certificate construction and validation.
|
Package leios implements the CIP-0164 stake-truncated voting committee, stake-quorum vote tallying, and endorser-block certificate construction and validation. |
|
rewards
Package rewards implements the Shelley stake-pool reward calculation.
|
Package rewards implements the Shelley stake-pool reward calculation. |
|
snapshot
Package snapshot provides stake snapshot management for Ouroboros Praos leader election.
|
Package snapshot provides stake snapshot management for Ouroboros Praos leader election. |
|
Package mempool implements Dingo's transaction pool.
|
Package mempool implements Dingo's transaction pool. |
|
indexer
Package indexer subscribes to ledger block events and indexes Midnight-relevant transactions (cNIGHT creates/spends, mapping-validator registrations/deregistrations, Technical Committee / Council governance datums, Ariadne permissioned-candidate parameters, and committee-candidate UTxO snapshots) into the database.
|
Package indexer subscribes to ledger block events and indexes Midnight-relevant transactions (cNIGHT creates/spends, mapping-validator registrations/deregistrations, Technical Committee / Council governance datums, Ariadne permissioned-candidate parameters, and committee-candidate UTxO snapshots) into the database. |
|
server
Package server runs the MidnightState gRPC service.
|
Package server runs the MidnightState gRPC service. |
|
Package ouroboros hosts Dingo's handlers for the Ouroboros mini- protocols: chainsync, blockfetch, txsubmission, keepalive, peer-sharing, handshake, and the Leios prototype protocols (LeiosFetch, LeiosNotify) when enabled.
|
Package ouroboros hosts Dingo's handlers for the Ouroboros mini- protocols: chainsync, blockfetch, txsubmission, keepalive, peer-sharing, handshake, and the Leios prototype protocols (LeiosFetch, LeiosNotify) when enabled. |
|
Package peergov implements Dingo's peer governance: it decides who the node connects to, how many peers to maintain in each tier, and when to churn inactive peers out of the active set.
|
Package peergov implements Dingo's peer governance: it decides who the node connects to, how many peers to maintain in each tier, and when to churn inactive peers out of the active set. |
|
Package plugin provides the instance-owned host for compiled-in Dingo plugins.
|
Package plugin provides the instance-owned host for compiled-in Dingo plugins. |