Configuration

Dugite reads a JSON configuration file that controls network settings, genesis file paths, P2P parameters, and tracing options. The format is compatible with the cardano-node configuration format.

Configuration File Format

The configuration file uses PascalCase keys (matching the cardano-node convention):

{
  "Network": "Testnet",
  "NetworkMagic": 2,
  "EnableP2P": true,
  "DiffusionMode": "InitiatorAndResponder",
  "PeerSharing": null,
  "Protocol": {
    "RequiresNetworkMagic": "RequiresMagic"
  },
  "ShelleyGenesisFile": "shelley-genesis.json",
  "ByronGenesisFile": "byron-genesis.json",
  "AlonzoGenesisFile": "alonzo-genesis.json",
  "ConwayGenesisFile": "conway-genesis.json",
  "TargetNumberOfRootPeers": 60,
  "TargetNumberOfActivePeers": 15,
  "TargetNumberOfEstablishedPeers": 40,
  "TargetNumberOfKnownPeers": 85,
  "TargetNumberOfActiveBigLedgerPeers": 5,
  "TargetNumberOfEstablishedBigLedgerPeers": 10,
  "TargetNumberOfKnownBigLedgerPeers": 15,
  "MinSeverity": "Info",
  "TraceOptions": {
    "TraceBlockFetchClient": false,
    "TraceBlockFetchServer": false,
    "TraceChainDb": false,
    "TraceChainSyncClient": false,
    "TraceChainSyncServer": false,
    "TraceForge": false,
    "TraceMempool": false
  }
}

Fields Reference

Network Settings

FieldTypeDefaultDescription
Networkstring"Mainnet"Network identifier: "Mainnet" or "Testnet"
NetworkMagicintegerautoNetwork magic number. If omitted, derived from Network (764824073 for mainnet)
EnableP2PbooleantrueEnable P2P networking mode. When true (the default), the peer governor manages peer connections with automatic churn, ledger-based discovery, and peer sharing. When false, the node uses only static topology connections
DiffusionModestring"InitiatorAndResponder"Controls inbound connection acceptance. "InitiatorAndResponder" (default): relay mode, accepts inbound N2N connections. "InitiatorOnly": block producer mode, outbound only (no listening port opened)
PeerSharingboolean/nullnullEnable the peer sharing mini-protocol. When null (default), peer sharing is automatically disabled for block producers (when --shelley-kes-key is provided) and enabled for relays. Set explicitly to override

Protocol

FieldTypeDefaultDescription
Protocol.RequiresNetworkMagicstring"RequiresMagic"Whether network magic is required in handshake

Genesis Files

Genesis file paths are resolved relative to the directory containing the configuration file. For example, if your config is at /opt/cardano/config.json and specifies "ShelleyGenesisFile": "shelley-genesis.json", Dugite will look for /opt/cardano/shelley-genesis.json.

FieldTypeDefaultDescription
ShelleyGenesisFilestringnonePath to Shelley genesis JSON
ByronGenesisFilestringnonePath to Byron genesis JSON
AlonzoGenesisFilestringnonePath to Alonzo genesis JSON
ConwayGenesisFilestringnonePath to Conway genesis JSON

Tip: Genesis files for each network can be downloaded from the Cardano Operations Book.

P2P Parameters

These parameters control the P2P peer governor's target counts, matching the cardano-node defaults. The governor continuously works to maintain these targets by promoting/demoting peers and discovering new ones.

FieldTypeDefaultDescription
TargetNumberOfRootPeersinteger60Target number of root peers (bootstrap + local + public roots)
TargetNumberOfActivePeersinteger15Target number of active (hot) peers — fully syncing with ChainSync + BlockFetch
TargetNumberOfEstablishedPeersinteger40Target number of established (warm) peers — TCP connected, keepalive running
TargetNumberOfKnownPeersinteger85Target number of known (cold) peers in the peer table
TargetNumberOfActiveBigLedgerPeersinteger5Target number of active big ledger peers (high-stake SPOs, prioritised during sync)
TargetNumberOfEstablishedBigLedgerPeersinteger10Target number of established big ledger peers
TargetNumberOfKnownBigLedgerPeersinteger15Target number of known big ledger peers

Tracing

FieldTypeDefaultDescription
MinSeveritystring"Info"Minimum log severity level
TraceOptions.TraceBlockFetchClientbooleanfalseTrace block fetch client activity
TraceOptions.TraceBlockFetchServerbooleanfalseTrace block fetch server activity
TraceOptions.TraceChainDbbooleanfalseTrace ChainDB operations
TraceOptions.TraceChainSyncClientbooleanfalseTrace chain sync client activity
TraceOptions.TraceChainSyncServerbooleanfalseTrace chain sync server activity
TraceOptions.TraceForgebooleanfalseTrace block forging
TraceOptions.TraceMempoolbooleanfalseTrace mempool activity

Log Level Control

The log level can be set via CLI flag or environment variable:

# Via CLI flag
dugite-node run --log-level debug ...

# Via environment variable (takes priority over --log-level)
RUST_LOG=info dugite-node run ...

# Debug only for specific crates
RUST_LOG=dugite_network=debug,dugite_consensus=debug dugite-node run ...

Dugite supports multiple log output targets (stdout, file, journald) and file rotation. See Logging for full details on output configuration.

Minimal Configuration

The smallest viable configuration file specifies only the network:

{
  "Network": "Testnet",
  "NetworkMagic": 2
}

All other fields use sensible defaults. When no genesis files are specified, the node operates with built-in default parameters.

Format Support

Dugite supports both JSON (.json) and TOML (.toml) configuration files. The format is determined by the file extension. JSON files use the cardano-node compatible PascalCase format shown above.

Interactive Configuration Editor (dugite-config)

dugite-config is a standalone TUI tool for creating and editing Dugite configuration files interactively, without needing to remember field names or valid value ranges.

Installation

Built as part of the standard workspace:

cargo build --release -p dugite-config

Commands

# Interactively create a new configuration file
dugite-config init --out-file config.json

# Launch the interactive editor for an existing config file
dugite-config edit config.json

# Validate a configuration file and report errors
dugite-config validate config.json

# Get the value of a specific field
dugite-config get config.json TargetNumberOfActivePeers

# Set the value of a specific field
dugite-config set config.json TargetNumberOfActivePeers 30

Interactive Editor Features

The editor provides a tree view of all configuration fields with inline editing:

  • Tree navigation — expand/collapse sections, navigate fields with arrow keys
  • Inline editing — press Enter on any field to edit its value in place
  • Type validation — invalid values are rejected with an inline error message and a description of the expected type and range
  • Tuning hints — contextual hints appear alongside each field explaining the impact of changes (for example, peer count targets and their effect on network connectivity)
  • Search/filter — press / to search fields by name
  • Diff view — press d to see a side-by-side diff of your changes before saving
  • Save/discardCtrl+S to save, Ctrl+Q or Esc to discard

The editor validates the full configuration on save and will not write an invalid file.