Documentation
¶
Index ¶
- type Config
- type ConfigOptionFunc
- func WithActivePeersQuotas(topologyQuota, gossipQuota, ledgerQuota int) ConfigOptionFunc
- func WithBarkBaseUrl(baseUrl string) ConfigOptionFunc
- func WithBarkPort(port uint) ConfigOptionFunc
- func WithBarkPrunerFrequency(freq time.Duration) 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 WithCacheConfig(blockLRU, hotUtxo, hotTx int, hotTxMaxBytes int64) ConfigOptionFunc
- func WithCardanoNodeConfig(cardanoNodeConfig *cardano.CardanoNodeConfig) ConfigOptionFunc
- func WithChainsyncMaxClients(maxClients int) ConfigOptionFunc
- func WithChainsyncStallTimeout(timeout time.Duration) ConfigOptionFunc
- func WithDatabasePath(dataDir string) ConfigOptionFunc
- func WithDatabaseWorkerPoolConfig(cfg ledger.DatabaseWorkerPoolConfig) ConfigOptionFunc
- func WithEvictionWatermark(watermark float64) ConfigOptionFunc
- func WithForgeStaleGapThresholdSlots(slots uint64) ConfigOptionFunc
- func WithForgeSyncToleranceSlots(slots uint64) ConfigOptionFunc
- func WithGenesisBootstrap(enabled bool) ConfigOptionFunc
- func WithGenesisWindowSlots(slots uint64) 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 WithLedgerPeerTarget(n int) 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 WithMinHotPeers(n int) ConfigOptionFunc
- func WithNetwork(network string) ConfigOptionFunc
- func WithNetworkMagic(networkMagic uint32) ConfigOptionFunc
- func WithOutboundSourcePort(port uint) ConfigOptionFunc
- func WithPeerSharing(peerSharing bool) ConfigOptionFunc
- func WithPeerTargets(targetKnown, targetEstablished, targetActive int) ConfigOptionFunc
- func WithPrometheusRegistry(registry prometheus.Registerer) ConfigOptionFunc
- func WithReconcileInterval(d time.Duration) ConfigOptionFunc
- func WithRejectionWatermark(watermark float64) 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 WithStorageMode(mode StorageMode) ConfigOptionFunc
- func WithTopologyConfig(topologyConfig *topology.TopologyConfig) ConfigOptionFunc
- func WithTracing(tracing bool) ConfigOptionFunc
- func WithTracingStdout(stdout bool) ConfigOptionFunc
- func WithUtxorpcPort(port uint) ConfigOptionFunc
- func WithUtxorpcTlsCertFilePath(path string) ConfigOptionFunc
- func WithUtxorpcTlsKeyFilePath(path string) ConfigOptionFunc
- func WithValidateHistorical(validate bool) ConfigOptionFunc
- type ListenerConfig
- type Node
- type StorageMode
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
type ConfigOptionFunc ¶
type ConfigOptionFunc func(*Config)
ConfigOptionFunc is a type that represents functions that modify the Connection config
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 WithBarkPort ¶ added in v0.22.0
func WithBarkPort(port uint) ConfigOptionFunc
func WithBarkPrunerFrequency ¶ added in v0.39.0
func WithBarkPrunerFrequency(freq time.Duration) ConfigOptionFunc
WithBarkPrunerFrequency specifies how often the Bark pruner runs (deleting blob entries older than the ledger stability window). Default is 1 hour. Values <= 0 fall back to the default.
func WithBindAddr ¶ added in v0.22.0
func WithBindAddr(addr string) ConfigOptionFunc
WithBindAddr specifies the IP address used for API listeners (Blockfrost, Mesh, UTxO RPC). The default is "0.0.0.0" (all interfaces).
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 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 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 30 seconds.
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 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. Default is 0.90 (90%).
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 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 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 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 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 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 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 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 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 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 even after eviction. Default is 0.95 (95%).
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 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 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 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 WithValidateHistorical ¶ added in v0.17.0
func WithValidateHistorical(validate bool) ConfigOptionFunc
WithValidateHistorical specifies whether to validate all historical blocks during ledger processing
type ListenerConfig ¶
type ListenerConfig = connmanager.ListenerConfig
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.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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 Ouroboros Praos multi-peer chain selection.
|
Package chainselection implements Ouroboros Praos 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
|
|
|
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. |
|
Package database is Dingo's storage abstraction.
|
Package database is Dingo's storage abstraction. |
|
plugin/metadata/importutil
Package importutil provides shared helpers for metadata import operations across all database backends (sqlite, postgres, mysql).
|
Package importutil provides shared helpers for metadata import operations across all database backends (sqlite, postgres, mysql). |
|
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
|
|
|
test/archive-demo/cmd/demo-fetch
command
demo-fetch is a small CLI used by the archive-demo's demo.sh to make the BlockFetch step of the demo visible: it connects to a Dingo NtN endpoint, ChainSync-walks from origin to find a block at or past a requested slot, then BlockFetches that block and reports the byte count and elapsed time.
|
demo-fetch is a small CLI used by the archive-demo's demo.sh to make the BlockFetch step of the demo visible: it connects to a Dingo NtN endpoint, ChainSync-walks from origin to find a block at or past a requested slot, then BlockFetches that block and reports the byte count and elapsed time. |
|
test/archive-demo/cmd/inspect-blob
command
inspect-blob is a CLI used by the archive-demo integration test to verify whether a block (slot, hash) is present in a Dingo node's local Badger blob store.
|
inspect-blob is a CLI used by the archive-demo integration test to verify whether a block (slot, hash) is present in a Dingo node's local Badger blob store. |
|
test/archive-demo/internal/archivedemo
Package archivedemo provides shared helpers for the archive-node demo at internal/test/archive-demo/.
|
Package archivedemo provides shared helpers for the archive-node demo at internal/test/archive-demo/. |
|
test/conformance
Package conformance provides a DingoStateManager that implements the ouroboros-mock conformance.StateManager interface using dingo's database and ledger packages with an in-memory SQLite database.
|
Package conformance provides a DingoStateManager that implements the ouroboros-mock conformance.StateManager interface using dingo's database and ledger packages with an in-memory SQLite database. |
|
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. |
|
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. |
|
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 utxorpc implements Dingo's UTxO RPC server, serving the utxorpc.v1alpha.cardano gRPC API defined by the UTxO RPC spec.
|
Package utxorpc implements Dingo's UTxO RPC server, serving the utxorpc.v1alpha.cardano gRPC API defined by the UTxO RPC spec. |