This directory contains documentation for Midnight network genesis generation and verification.
| Document | Description |
|---|---|
| Generation Guide | How to generate genesis configuration and chain specifications |
| Verification Guide | How to verify generated chain specifications |
Generate a new chain specification for a network:
./scripts/genesis/genesis-generation.shSee Generation Guide for detailed instructions.
Verify an existing chain specification:
./scripts/genesis/genesis-verification.shSee Verification Guide for detailed instructions.
┌─────────────────────────────────────────────────────────────────────────────┐
│ Genesis Workflow │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────┐
│ Address Files │
│ (manual configuration) │
│ │
│ - cnight-addresses.json │
│ - ics-addresses.json │
│ - federated-authority- │
│ addresses.json │
│ - permissioned-candidates- │
│ addresses.json │
└─────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ │
│ GENERATION PHASE │
│ (genesis-generation.sh) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Step 1 │───▶│ Step 2 │───▶│ Step 3 │ │
│ │ Config │ │ Ledger │ │ Chain │ │
│ │ Files │ │ State │ │ Spec │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└───────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Output Files │
│ │
│ - chain-spec.json │
│ - chain-spec-raw.json │
│ - chain-spec-abridged.json │
│ - genesis_block_*.mn │
│ - genesis_state_*.mn │
└─────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ │
│ VERIFICATION PHASE │
│ (genesis-verification.sh) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
│ │ Step 0 │───▶│ Step 1 │───▶│ Step 2 │───▶│ Step 3 │ │
│ │ Cardano │ │ Config │ │ Ledger │ │ Dparam │ │
│ │ Tip │ │ Regen │ │ State │ │ Check │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
│ │ │
│ ▼ │
│ ┌───────────┐ │
│ │ Step 4 │ │
│ │ Auth │ │
│ │ Script │ │
│ └───────────┘ │
│ │
└───────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Verification Result │
│ │
│ [PASS] All checks passed │
│ - or - │
│ [FAIL] Some checks failed │
└─────────────────────────────────┘
Available networks for genesis generation/verification:
mainnet- Production networkqanet- QA testing networkdevnet- Development networkgovnet- Governance testing networknode-dev-01- Single node developmentpreview- Preview/staging networkpreprod- Pre-production network
The Cardano block hash (cardano_tip) serves as a reference point for querying smart contract state. It should be:
- A finalized block (enough confirmations based on
security_parameter) - Recent enough to contain all deployed smart contract data
The cardano-tip.json file in each network's res/<network>/ directory stores this value.
| Directory | Contents |
|---|---|
res/<network>/ |
Network-specific configuration and address files |
res/genesis/ |
Generated ledger state files (genesis_block_*.mn, genesis_state_*.mn) |
scripts/genesis/ |
Interactive generation and verification scripts |
-
midnight-node binary (release mode):
cargo build --release -p midnight-node
-
Cardano db-sync access:
- Local:
postgres://cardano@localhost:54322/cexplorer - Set
DB_SYNC_POSTGRES_CONNECTION_STRINGenvironment variable
- Local:
-
For verification: Generated chain specification files