midgard CLI is the command-line interface for interacting with the Sundial L2. You use it to create and manage wallets, send transactions on the L2, look up transaction history, and check the status of a running node — all without writing any code. It communicates directly with the Sundial node’s HTTP RPC endpoints, so anything the node exposes is accessible from the terminal.
Installation
- npm
- Build from source
Global Options
These flags apply to everymidgard command and can be set as environment variables to avoid typing them on every invocation.
To point every command at the public testnet node without repeating
--endpoint on each call, set the node.endpoint value in your manager config file (demo/midgard-manager/config/settings.json):
--endpoint https://rpc.testnet.sundialprotocol.com with each command.
Wallet Commands
The CLI stores wallet keys locally inconfig/wallets/default.json. This file is git-ignored and never leaves your machine — treat it with the same care as any private key file.
midgard wallet create
Generate a new wallet with a fresh keypair.
midgard wallet import
Register an existing private key under a local name.
midgard wallet list
Display all locally saved wallets and their addresses.
midgard wallet balance
Check the sBTC balance of a saved wallet.
midgard wallet address
Print the address for a saved wallet without showing the balance.
Transaction Commands
midgard send
Transfer sBTC from one of your saved wallets to any address on the Sundial L2.
--amount is in sBTC, not lovelace. To send 5 sBTC, pass --amount 5, not --amount 5000000.send command signs the transaction with the locally stored private key and submits it through POST /submit. The node queues it for processing; there may be a brief delay before the transaction appears in lookups.
midgard tx-lookup
Look up a transaction by its 64-character hex hash.
Transactions submitted via
send are queued before being processed. If you see “Not found” immediately after sending, wait a few seconds and try again — a background worker on the node deserializes and validates the transaction shortly after receipt.midgard query utxos
List the UTxOs held at a given address.
Node Commands
midgard node node-status
Check whether the node you are connected to is live and ready.
not_ready for more than a minute, check your L1 provider credentials in .env.
Key Generation (Operators)
These commands are for operators who need to manage raw Cardano key pairs and addresses — for example, when setting up the seed phrases required by the node’s environment file.Generate a payment key pair
payment.vkey (the public verification key) and payment.skey (the private signing key). Store payment.skey securely.
Build an enterprise address from a payment key
Generate a stake key pair
Build a base address with payment and staking credentials
Address Formats
Sundial L2 uses the same address format as the Cardano L1 testnet, following CIP-19.Node Socket and Network Configuration
For operators who need to configure the node-to-client socket path and network ID directly:--testnet-magic 1 with each command instead of exporting the environment variable.
Related Pages
Layer Node Deployment
Run a Sundial node with Docker Compose or Nix, including the full observability stack.
Node Configuration
Full reference for every environment variable the node reads at startup.