{"id":35544056,"url":"https://github.com/bricktowers/midnight-local-network","last_synced_at":"2026-04-01T23:30:15.832Z","repository":{"id":330847972,"uuid":"1111806767","full_name":"bricktowers/midnight-local-network","owner":"bricktowers","description":"Brick Towers Midnight Local Test Network","archived":false,"fork":false,"pushed_at":"2026-03-22T16:51:11.000Z","size":56,"stargazers_count":30,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-23T02:58:58.880Z","etag":null,"topics":["blockchain","midnightntwrk","privacy","test","undeployed"],"latest_commit_sha":null,"homepage":"https://bricktowers.io","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bricktowers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-07T17:08:12.000Z","updated_at":"2026-03-22T11:30:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bricktowers/midnight-local-network","commit_stats":null,"previous_names":["bricktowers/midnight-local-network"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bricktowers/midnight-local-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bricktowers%2Fmidnight-local-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bricktowers%2Fmidnight-local-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bricktowers%2Fmidnight-local-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bricktowers%2Fmidnight-local-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bricktowers","download_url":"https://codeload.github.com/bricktowers/midnight-local-network/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bricktowers%2Fmidnight-local-network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","midnightntwrk","privacy","test","undeployed"],"created_at":"2026-01-04T05:59:10.459Z","updated_at":"2026-04-01T23:30:15.809Z","avatar_url":"https://github.com/bricktowers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Self-contained local Midnight node + wallet funding helper\n\n▶️ **[Watch the Video Explainer \u0026 Demo](https://youtu.be/1L4xR8LIe6I)** (demo is showing an earlier version, but the concepts are the same)\n\n`midnight-local-network` lets developers run their **own local Midnight network** using Docker—fully isolated, predictable, and independent from public testnets or faucets.\n\nThis setup is especially valuable for dApp developers who want to build and test against a fully local Midnight network instead of relying on public testnets, which may be unstable or temporarily unavailable.\n\nIt also includes a **wallet funding tool**, solving a key gap:\n* When the Lace Wallet is connected to a local \"Undeployed\" network, **there is no built-in way to fund shielded and unshielded addresses**. \n \nThis project provides that missing capability. This project extends the Midnight Network with additional developer tooling.\n\n---\n\n## 🌟 Why This Exists\n\nBuilding on Midnight often requires stable environments, but public testnets and faucets can be:\n\n- unavailable or undergoing maintenance\n- rate-limited\n- unstable for automated tests\n- unsuitable for offline or reproducible local workflows\n\nThis repository enables you to:\n\n- Spin up a **fully functional Midnight network locally**\n- Connect the ** Lace Wallet** to that network\n- **Fund** any shielded address directly using the provided script\n\nPerfect for development, workshops, prototyping, CI, and experimentation.\n\n---\n\n## 🚀 Key Features\n\n- 🔧 **Local Midnight network** via Docker Compose\n- 🏦 **Funding script** for sending native tokens to shielded addresses\n- 🏦 ** DUST registration script ** to register your newly-funded wallet for DUST generation\n- 🧪 Works without external testnets or faucets\n- 💼 Integrates with Midnight Lace Preview Wallet (“Undeployed” network)\n- 🔌 Uses standard local ports:\n    - Proof Server → `6300`\n    - Node → `9944`\n    - Indexer → `8088`\n\n---\n\n## 📓 Changelog / Compatibility Notes\n\nThis repository tracks compatibility against specific Midnight stacks.\n\n| Repo Version                                                                | Ledger Stage  | Lace                | Proof Server    | Midnight Node | Indexer (standalone) | Notes                                                  |\n|-----------------------------------------------------------------------------|---------------|---------------------|-----------------|---------------|----------------------|--------------------------------------------------------|\n| [`1.0.0`](https://github.com/bricktowers/midnight-local-network/tree/1.0.0) | pre-ledger-v6 | `2.33.0`            | `4.0.0`         | `0.12.0`      | `2.1.2`              |                                                        |\n| [`2.0.0`](https://github.com/bricktowers/midnight-local-network/tree/2.0.0) | ledger-v6     | `2.37.0`            | `6.1.0-alpha.6` | `0.18.0`      |                      | Unofficial “preview stack”; never announced officially |\n| [`3.0.0`](https://github.com/bricktowers/midnight-local-network/tree/3.0.0) | ledger-v7     | `2.38.0`            | `7.0.0`         | `0.20.1`      | `3.0.0`              | Official preprod release                               |\n| [`4.0.0`](https://github.com/bricktowers/midnight-local-network/tree/4.0.0) | ledger-v8     | `1.36.0` (Official) | `8.0.0`         | `0.22.1`      | `4.0.0`              | Official mainnet release, switch to Lace wallet        |\n\n---\n\n## 🛠️ Prerequisites\n\nEnsure you have the following tools installed on your system:\n\n* **Git**\n* **Docker** and **Docker Compose v2**\n* **Node.js ≥ 22.16.0** (using [nvm](https://github.com/nvm-sh/nvm) is highly recommended for version management)\n* **Yarn** (classic)\n* **Lace ** (1.36.0 or later) browser extension\n\nYou will also need the Lace Wallet to connect and interact with the local node.\n\n---\n\n## 🚀 Setup \u0026 Usage Guide\n\nFollow these steps to set up the local network and fund an address.\n\n### 1. Clone the Repository\n\nClone the project and navigate into the directory:\n\n```bash\ngit clone git@github.com:bricktowers/midnight-local-network.git midnight-local-network\ncd midnight-local-network\n```\n\n### 2. Setup Node via nvm\n\nInstall and use Node 22.16+:\n```bash\nnvm install 22\nnvm use 22\n```\n\nIf you don’t have nvm, see:\nhttps://github.com/nvm-sh/nvm\n\n### 3. Install dependencies\n\n```bash\nyarn install\n```   \n\n### 2. Set Up Node Environment\n\nThe repository includes a compose.yml file that defines the local Midnight node/network services.\n\nStart the network in detached mode (-d):\n\n```bash\ndocker compose up -d\n```\n\nTip: The explicit filename -f compose.yml is often optional, but can be used for clarity: docker compose -f compose.yml up -d.\n\n### 3. Connect Lace Wallet\n\nYou need to configure your Lace Wallet to use your local node instead of a public testnet.\n\n* Open the Wallet Settings -\u003e Midnight in the Lace Wallet.\n\n* Switch network to \"Undeployed\"\n\n* Save the configuration and switch the wallet to use that new local network.\n\nOnce the wallet is connected and copy the address you want to fund.\n\n### 4. Fund an Address\n\nOnce the local network is running, use the fund script to send native tokens to a receiver on the undeployed network.\n\nThis script accepts one argument and supports three input types:\n\n* BIP-39 mnemonic (space-separated words) — the script will derive both receiver addresses:\n  * a shielded address (`mn_shield-addr_undeployed...`)\n  * an unshielded address (`mn_addr_undeployed...`)\n* A Midnight shielded address for undeployed (`mn_shield-addr_undeployed...`)\n* A Midnight unshielded address for undeployed (`mn_addr_undeployed...`)\n\nIf you pass a mnemonic, the script derives the receiver addresses and funds both (shielded + unshielded). If you pass a single address, it funds only that address.\n\nUsage:\n\n```bash\nyarn fund \"\u003cmnemonic words\u003e\"\nyarn fund mn_shield-addr_undeployed1...\nyarn fund mn_addr_undeployed1...\n```\nExample:  \n\nFund both derived addresses (shielded + unshielded) from a mnemonic:\n```bash\nyarn fund \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\"\n```\nFund a specific shielded address:\n```bash\nyarn fund mn_shield-addr_undeployed1q....\n\n```\nFund a specific unshielded address:\n```bash\nyarn fund mn_addr_undeployed1q....\n```\n#### Notes\n\n- You can use the **BIP-39 mnemonic generated by Midnight Lace at wallet creation time** as input to this script. When a mnemonic is provided, the script derives the corresponding **shielded** and **unshielded** addresses exactly as Lace would.\n- When using a mnemonic, the script logs the derived `shieldedAddress` and `unshieldedAddress` once the wallet has fully synced.\n- Shielded addresses are most commonly obtained directly from the **Midnight Lace Wallet**, but supplying the original mnemonic is useful for automated or headless setups.\n- The script **only supports the `undeployed` network**. If you provide an address from another network (i.e. the prefix does not match `mn_shield-addr_undeployed...` or `mn_addr_undeployed...`), the script will exit with an error.\n\n### 5. Fund and Register Dust\n\nIf you need dust generation for a local wallet, you can fund the wallet’s unshielded address and register the resulting UTXOs for dust generation in a single command.\n\nThis command requires a **BIP-39 mnemonic**, because it must sign the dust registration with the wallet’s unshielded key.\n\nUsage:\n\n```bash\nyarn fund-and-register-dust \"\u003cmnemonic words\u003e\"\n```\n\nExample:\n\n```bash\nyarn fund-and-register-dust \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\"\n```\n\nNotes:\n\n- The script funds the **unshielded** address derived from the mnemonic, then registers the newly created UTXOs for dust generation.\n- It waits until the receiver wallet reports unshielded UTXOs before attempting dust registration.\n- The script **only supports the `undeployed` network**.\n\n### 6. Connect your dApp\n\nTypically, your dApp will use the `dapp-connector-api` to communicate with the Midnight Lace Wallet.\nWhen running locally, this automatically configures your dApp to connect to the “Undeployed” network.\n\nHowever, if you are interacting with Midnight using CLI tooling instead of the dApp connector, \nyou’ll need to manually set the endpoints in your dApp’s configuration:\n```\nexport class TestnetLocalConfig implements Config {\n...\n  indexer = 'http://127.0.0.1:8088/api/v1/graphql';\n  indexerWS = 'ws://127.0.0.1:8088/api/v1/graphql/ws';\n  node = 'http://127.0.0.1:9944';\n  proofServer = 'http://127.0.0.1:6300';\n...\n  setNetworkId() {\n    setNetworkId(NetworkId.Undeployed);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbricktowers%2Fmidnight-local-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbricktowers%2Fmidnight-local-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbricktowers%2Fmidnight-local-network/lists"}