dingo

package module
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

README

Dingo

Dingo Logo
GitHub Go Report Card Go Reference Discord

Dingo

⚠️ This is a work in progress and is currently under heavy development

Note: On Windows systems, named pipes are used instead of Unix sockets for node-to-client communication.

dingo screenshot

Running

Dingo supports configuration via both a YAML config file (dingo.yaml) and uses environment variables to modify its own behavior.

A sample configuration file is provided at dingo.yaml.example.You can copy and edit this file to configure Dingo for your local or production environment: This behavior can be changed via the following environment variables:

  • CARDANO_BIND_ADDR
    • IP address to bind for listening (default: 0.0.0.0)
  • CARDANO_CONFIG
    • Full path to the Cardano node configuration (default: ./config/cardano/preview/config.json)
    • Use your own configuration files for different networks
    • Genesis configuration files are read from the same directory by default
  • CARDANO_DATABASE_PATH
    • A directory which contains the ledger database files (default: .dingo)
    • This is the location for persistent data storage for the ledger
  • CARDANO_INTERSECT_TIP
    • Ignore prior chain history and start from current position (default: false)
    • This is experimental and will likely break... use with caution
  • CARDANO_METRICS_PORT
    • TCP port to bind for listening for Prometheus metrics (default: 12798)
  • CARDANO_NETWORK
    • Named Cardano network (default: preview)
  • CARDANO_PRIVATE_BIND_ADDR
    • IP address to bind for listening for Ouroboros NtC (default: 127.0.0.1)
  • CARDANO_PRIVATE_PORT
    • TCP port to bind for listening for Ouroboros NtC (default: 3002)
  • CARDANO_RELAY_PORT
    • TCP port to bind for listening for Ouroboros NtN (default: 3001)
  • CARDANO_SOCKET_PATH
    • UNIX socket path for listening (default: dingo.socket)
    • This socket speaks Ouroboros NtC and is used by client software
  • CARDANO_TOPOLOGY
    • Full path to the Cardano node topology (default: "")
  • CARDANO_UTXORPC_PORT
    • TCP port to bind for listening for UTxO RPC (default: 9090)
  • TLS_CERT_FILE_PATH - SSL certificate to use, requires TLS_KEY_FILE_PATH (default: empty)
  • TLS_KEY_FILE_PATH - SSL certificate key to use (default: empty)

Database Plugins

Dingo supports pluggable storage backends for both blob storage (blocks, transactions) and metadata storage. This allows you to choose the best storage solution for your use case.

Available Plugins

Blob Storage Plugins:

  • badger - BadgerDB local key-value store (default)
  • gcs - Google Cloud Storage blob store
  • s3 - AWS S3 blob store

Metadata Storage Plugins:

  • sqlite - SQLite relational database (default)
Plugin Selection

Plugins can be selected via command-line flags, environment variables, or configuration file:

# Command line
./dingo --blob gcs --metadata sqlite

# Environment variables
DINGO_DATABASE_BLOB_PLUGIN=gcs
DINGO_DATABASE_METADATA_PLUGIN=sqlite

# Configuration file (dingo.yaml)
database:
  blob:
    plugin: "gcs"
  metadata:
    plugin: "sqlite"
Plugin Configuration

Each plugin supports specific configuration options. See dingo.yaml.example for detailed configuration examples.

BadgerDB Options:

  • data-dir - Directory for database files
  • block-cache-size - Block cache size in bytes
  • index-cache-size - Index cache size in bytes
  • gc - Enable garbage collection

Google Cloud Storage Options:

  • bucket - GCS bucket name
  • project-id - Google Cloud project ID
  • prefix - Path prefix within bucket
  • credentials-file - Path to service account credentials file (optional - uses Application Default Credentials if not provided)

AWS S3 Options:

  • bucket - S3 bucket name
  • region - AWS region
  • prefix - Path prefix within bucket
  • access-key-id - AWS access key ID (optional - uses default credential chain if not provided)
  • secret-access-key - AWS secret access key (optional - uses default credential chain if not provided)

SQLite Options:

  • data-dir - Path to SQLite database file
Listing Available Plugins

You can see all available plugins and their descriptions:

./dingo list

Plugin Development

For information on developing custom storage plugins, see PLUGIN_DEVELOPMENT.md.

Example

Running on mainnet (😅):

CARDANO_NETWORK=mainnet CARDANO_CONFIG=path/to/cardano/configs/mainnet/config.json ./dingo

Note: you can find cardano configuration files at https://github.com/blinklabs-io/docker-cardano-configs/tree/main/config

Dingo will drop a dingo.socket file which can be used by other clients, such as cardano-cli or software like adder or kupo. This has only had limited testing, so success/failure reports are very welcome and encouraged!

Features

  • Network
    • UTxO RPC
    • Ouroboros
      • Node-to-node
        • ChainSync
        • BlockFetch
        • TxSubmission2
      • Node-to-client
        • ChainSync
        • LocalTxMonitor
        • LocalTxSubmission
        • LocalStateQuery
      • Peer governor
        • Topology config
        • Peer churn
        • Ledger peers
      • Connection manager
        • Inbound connections
          • Node-to-client over TCP
          • Node-to-client over UNIX socket
          • Node-to-node over TCP
        • Outbound connections
          • Node-to-node over TCP
  • Ledger
    • Blocks
      • Block storage
      • Chain selection
    • UTxO tracking
    • Protocol parameters
    • Certificates
      • Pool registration
      • Stake registration/delegation
      • Governance
    • Transaction validation
      • Phase 1 validation
        • UTxO rules
        • Witnesses
        • Block body
        • Certificates
        • Delegation/pools
        • Governance
      • Phase 2 validation
        • Smart contracts
  • Mempool
    • Accept transactions from local clients
    • Distribute transactions to other nodes
    • Validation of transaction on add
    • Consumer tracking
    • Transaction purging on chain update

Additional planned features can be found in our issue tracker and project boards.

Catalyst Fund 12 - Go Node (Dingo)
Catalyst Fund 13 - Archive Node

Check the issue tracker for known issues. Due to rapid development, bugs happen especially as there is functionality which has not yet been developed.

Development / Building

This requires Go 1.23 or better is installed. You also need make.

# Build
make
# Run
./dingo

You can also run the code without building a binary, first

go run ./cmd/dingo/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// 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 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 WithDatabasePath

func WithDatabasePath(dataDir string) ConfigOptionFunc

WithDatabasePath specifies the persistent data directory to use. The default is to store everything in memory

func WithDevMode added in v0.14.0

func WithDevMode(devMode bool) ConfigOptionFunc

WithDevMode enables development mode which prevents outbound connections.

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 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 WithMempoolCapacity added in v0.13.0

func WithMempoolCapacity(capacity int64) ConfigOptionFunc

WithMempoolCapacity sets the mempool capacity (in bytes)

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 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 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 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. This defaults to port 9090

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 Node

type Node struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Node, error)

func (*Node) Run

func (n *Node) Run() error

func (*Node) Stop

func (n *Node) Stop() error

Jump to

Keyboard shortcuts

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