Skip to main content
The Sundial node reads all of its configuration from environment variables at startup. No flags or command-line arguments are required for the core settings — everything lives in a .env file that you create from the provided example. This reference covers every variable that operators need to control: your Cardano L1 provider, network selection, operator credentials, block production timing, Redis and PostgreSQL connection details, and the monitoring stack.
The template lives at demo/midgard-node/.env.example in the monorepo. Bootstrap your own file with cp .env.example .env, then edit it before starting the node.

L1 Provider

The node connects to Cardano L1 through one of two provider modes. Choose Blockfrost for the fastest initial setup, or Kupmios if you are running your own Cardano infrastructure and want lower latency and no external API dependency.

Network

Set NETWORK to match the Cardano network your L1 provider is connected to. The value is passed directly to Lucid Evolution.
Valid values are Mainnet, Preprod, Preview, and Custom. Preprod is the standard testnet used by Sundial during the testnet phase.
Mismatching NETWORK and your L1 provider network (e.g., setting NETWORK=Mainnet with a Preprod Blockfrost key) will cause the node to fail at startup or produce incorrect block commitments. Always keep these in sync.

Operator Credentials

The node requires three separate operator wallets, each used for a different on-chain role. Supply each as a 24-word BIP-39 seed phrase:
Use three distinct, freshly generated seed phrases — one per variable. Never reuse a genesis wallet seed or a faucet wallet seed as an operator seed. Keep all three seed phrases stored securely and offline.

Core Configuration Reference

PostgreSQL Connection

The node uses two separate PostgreSQL connection pools — one for HTTP query traffic and one for sequencer-critical operations — both backed by the same database credentials.
When running outside Docker, set POSTGRES_HOST=localhost. Docker Compose publishes PostgreSQL on host port 5433 (container port 5432).

Node Role

Use NODE_ROLE to control which responsibilities the process takes on. In a single-server deployment, leave it as all. In a distributed setup, deploy each role separately and point them all at the same Redis and PostgreSQL instances.
The api role exposes the HTTP port (PORT). The tx-processor and sequencer roles do not expose an HTTP port but each export their own Prometheus metrics on configurable ports.

Timing Parameters

These variables control the intervals at which the node’s background fibers run. The defaults are tuned for testnet. For mainnet, adjust based on your observed block times and L1 confirmation latency.
WAIT_BETWEEN_BLOCK_COMMITMENTS controls how frequently the sequencer tries to build a new block from the mempool. Lower values mean more frequent (and smaller) blocks; higher values let the mempool fill for larger, more efficient batches.

Transaction Queue (Redis)

The node uses Redis to decouple transaction receipt from mempool processing. Set REDIS_URL to point at your Redis instance:
When running with Docker Compose, Redis is included in the stack and REDIS_URL defaults to redis://redis:6379. For external Redis instances, update the host and port accordingly.

Monitoring and Observability

Monitoring is activated by starting the node with the --with-monitoring flag. The Docker Compose monolith profile passes this flag automatically.
When running the monolith Docker Compose profile, --with-monitoring is passed automatically and Prometheus scrapes metrics from PROM_METRICS_PORT. See the Layer Node deployment guide for the full list of observability service endpoints.

Manager Configuration File

The midgard CLI reads its settings from a JSON file rather than environment variables. The default configuration lives at demo/midgard-manager/config/settings.json:
Update node.endpoint to point at a remote node, or pass --endpoint on the CLI to override it for a single command. The generator block controls the built-in test transaction generator (disabled by default).

Full .env Example

Here is a minimal working .env for a testnet operator using Blockfrost:

Layer Node Deployment

Step-by-step guide to deploying the node with Docker Compose or Nix, including the full observability stack.

CLI Reference

Use the midgard CLI to manage wallets, submit transactions, and inspect node status.