.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.- Blockfrost (recommended for quick start)
- Kupmios (local, production)
L1_BLOCKFROST_API_URL accordingly.Network
SetNETWORK to match the Cardano network your L1 provider is connected to. The value is passed directly to Lucid Evolution.
Mainnet, Preprod, Preview, and Custom. Preprod is the standard testnet used by Sundial during the testnet phase.
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: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.POSTGRES_HOST=localhost. Docker Compose publishes PostgreSQL on host port 5433 (container port 5432).
Node Role
UseNODE_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.
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. SetREDIS_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.
Manager Configuration File
Themidgard CLI reads its settings from a JSON file rather than environment variables. The default configuration lives at demo/midgard-manager/config/settings.json:
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:
Related Pages
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.