惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
月光博客
月光博客
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
NISL@THU
NISL@THU
爱范儿
爱范儿
S
Securelist
博客园 - 叶小钗
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
aimingoo的专栏
aimingoo的专栏
D
DataBreaches.Net
G
GRAHAM CLULEY
P
Proofpoint News Feed
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
博客园 - 【当耐特】
H
Help Net Security
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Building on Midnight with Windows — A Real Developer's WSL2 Setup Guide
Gutopro · 2026-04-30 · via DEV Community

midnight
If you're on Windows and you want to build on Midnight, the first thing you need to know is that Midnight's toolchain — the Compact compiler, proof server, and the rest — are Linux binaries. They won't run natively on Windows. Full stop.

That doesn't mean you're locked out. Windows has a feature called WSL2 — Windows Subsystem for Linux — that gives you a real Linux environment running inside Windows. Once it's set up you get a proper Ubuntu terminal, access to all the Linux dev tools you need, and a stable foundation for Midnight development.

I set up my entire Midnight development environment on WSL2. This guide documents exactly what I did — including the parts that aren't obvious and the parts that caught me off guard.


Step 1: Enable WSL2

Microsoft has official documentation for enabling WSL2. Follow that guide to get WSL installed on your machine before continuing here.

👉 Enable WSL2 on Windows — Official Microsoft Guide

Come back here once WSL is enabled and you have Ubuntu running.


Step 2: Download Ubuntu from the Microsoft Store

Open the Microsoft Store and search for Ubuntu. Select Ubuntu 24.04 LTS and click Get.

Once it installs, launch it from the Start menu. The first launch will ask you to create a Linux username and password.

Note:
When you type your password nothing shows on screen. That's intentional — Linux hides password input by default. Just type it and press Enter.

Verify WSL2 is active by opening PowerShell and running:

# Windows PowerShell
wsl --list --verbose

Enter fullscreen mode Exit fullscreen mode

You should see Ubuntu listed with Version 2. If it shows Version 1, set WSL2 as the default with:

# Windows PowerShell
wsl --set-default-version 2

Enter fullscreen mode Exit fullscreen mode


Step 3: Configure WSL2 Memory — Don't Skip This

This is the step I wish someone had told me about before I started.

By default WSL2 only gets 1GB of memory. The Midnight proof server needs at least 4GB to generate ZK proofs without crashing. If you skip this configuration your proof server will run but fail silently or crash mid-proof with no obvious error message. I learned this the hard way.

Create a .wslconfig file in your Windows user directory. Open PowerShell and run:

# Windows PowerShell
notepad "$env:USERPROFILE\.wslconfig"

Enter fullscreen mode Exit fullscreen mode

Add this configuration:

# .wslconfig
[wsl2]
memory=8GB
processors=4
swap=3GB
localhostForwarding=true

Enter fullscreen mode Exit fullscreen mode

If your machine has less than 16GB RAM adjust accordingly. The minimum that works reliably for Midnight development is memory=4GB.

Setting Minimum Recommended
memory 4GB 8GB
processors 2 4
swap 1GB 3GB
localhostForwarding true true

Save the file then restart WSL:

# Windows PowerShell
wsl --shutdown

Enter fullscreen mode Exit fullscreen mode

Reopen Ubuntu from the Start menu.


Step 4: Install curl

Start with the fundamentals. curl is needed to download everything else.

# WSL Ubuntu terminal
sudo apt update
sudo apt install -y curl

Enter fullscreen mode Exit fullscreen mode


Step 5: Install Git

You'll need git for version control and cloning repositories.

# WSL Ubuntu terminal
sudo apt install -y git

Enter fullscreen mode Exit fullscreen mode


Step 6: Install Node.js 22

Midnight requires Node.js 22 or higher. Install it using nvm — don't use a Windows-native Node.js installation, as version conflicts will cause problems down the line.

# WSL Ubuntu terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install 22
nvm use 22
node --version

Enter fullscreen mode Exit fullscreen mode

Note:
zsh users: Replace ~/.bashrc with ~/.zshrc in the commands above.

Note:
Why pin to 22? create-mn-app and the Midnight SDK have been validated against Node.js 22. Using a newer major version may work, but you could encounter unexpected compatibility issues. Check the Midnight documentation for the latest supported range

Note:
nvm version: The installer URL above pins nvm to v0.40.3. Check the nvm releases page before running to confirm it's still the latest stable version and update the URL if needed.

Verify the installation before moving on:

node --version   # should print v22.x.x
npm --version

Enter fullscreen mode Exit fullscreen mode


Step 7: Install Docker Engine

The Midnight proof server runs as a Docker container. You need Docker Engine installed inside WSL — not Docker Desktop.

Set up Docker's apt repository:

# WSL Ubuntu terminal
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update

Enter fullscreen mode Exit fullscreen mode

Install Docker packages:

# WSL Ubuntu terminal
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Enter fullscreen mode Exit fullscreen mode

Add your user to the docker group so you can run Docker without sudo:

# WSL Ubuntu terminal
sudo usermod -aG docker $USER
newgrp docker

Enter fullscreen mode Exit fullscreen mode

Start the Docker daemon:

# WSL Ubuntu terminal
sudo service docker start

Enter fullscreen mode Exit fullscreen mode

Verify Docker works:

# WSL Ubuntu terminal
docker run hello-world

Enter fullscreen mode Exit fullscreen mode


Step 8: Install the Compact Toolchain

# WSL Ubuntu terminal
curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh

Enter fullscreen mode Exit fullscreen mode

Add to PATH:

# WSL Ubuntu terminal
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Enter fullscreen mode Exit fullscreen mode

Note:
zsh users: Replace ~/.bashrc with ~/.zshrc.

Verify:

# WSL Ubuntu terminal
compact --version

Enter fullscreen mode Exit fullscreen mode


Step 9: Scaffold Your Project with create-mn-app

This is where things get streamlined. The Midnight team ships create-mn-app — a scaffolding tool that sets up your entire project structure including wallet scripts, contract source, compilation config, and deployment tooling.

# WSL Ubuntu terminal
npx create-mn-app my-app
cd my-app
npm run setup

Enter fullscreen mode Exit fullscreen mode

npm run setup will:

  • Compile your Compact smart contract
  • Check your Node.js, Docker, and Compact compiler versions for compatibility
  • Start the proof server via Docker Compose
  • Guide you interactively through wallet creation or restoration

Wallet creation is interactive. When npm run deploy runs as part of setup, it will prompt you to either create a new wallet or restore from an existing seed. If you're starting fresh, choose option 1. Your seed will be saved to .midnight-seed (chmod 600) — back it up and never commit this file.

Note:
Version mismatch: create-mn-app checks that your @midnight-ntwrk/compact-runtime version in package.json matches your installed compiler version. A mismatch causes a CompactError on compilation. If setup flags it, let it fix it automatically.

Once setup completes, your wallet address is printed to the terminal. Copy it and head to the faucet to get tNight tokens.

If you want a more complete starting point, the Counter DApp template gives you a real increment/decrement contract with ZK proofs already wired up:

# WSL Ubuntu terminal
npx create-mn-app my-app --template counter
cd my-app
npm run setup

Enter fullscreen mode Exit fullscreen mode


Step 10: Get tNight from the Faucet

Every transaction on Midnight costs DUST as gas — and DUST is generated automatically once your wallet holds tNight. Your wallet address was printed during npm run setup.

  1. Visit the preprod faucet
  2. Paste your wallet address
  3. Request tokens and wait ~2–5 minutes

Note:
Important: Always verify your wallet is configured for the preprod network before copying your address. The preprod faucet only recognizes addresses registered on preprod — submitting an address from a differently-configured wallet will return an invalid address error.

Note:
DUST balance: DUST accumulates over time based on the tNight in your wallet. If you attempt deployment immediately after funding and see a "Not enough DUST" error, wait a few minutes and retry with npm run deploy.


What Doesn't Work

Save yourself the debugging time — these approaches don't work:

Approach Why it fails
Running Compact compiler in PowerShell or CMD Linux binary — requires WSL
Running proof server natively on Windows Linux binary — requires WSL
Using Windows-native Node.js for Midnight projects Version and path conflicts
Keeping projects in /mnt/c/ Severely degraded file I/O performance
Submitting a mainnet-configured wallet address to preprod faucet Address not registered on preprod

Troubleshooting

Proof server crashes or produces no output — Almost always a memory issue. Increase memory in .wslconfig to at least 4GB, run wsl --shutdown, restart WSL.

Docker not found — Run sudo service docker start. If that fails, verify Docker is installed with docker --version.

compact not found — Add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc and run source ~/.bashrc.

Port 6300 not accessible — Add localhostForwarding=true to .wslconfig and restart WSL with wsl --shutdown.

Slow file operations — Move your project out of /mnt/c/ into your Linux home directory at ~/. The performance difference is significant.

CompactError: Version mismatch — Your compiler version and compact-runtime npm package version don't match. create-mn-app will flag this during setup and offer to fix it. If you hit it mid-project, update package.json to the matching runtime version and run npm install.

"Not enough DUST" during deployment — Your wallet is new and DUST hasn't accumulated yet. Wait a few minutes and run npm run deploy again. The deploy script retries automatically up to 8 times with a delay between attempts.


Next Steps

Your environment is ready. Run create-mn-app and let it scaffold your first project. The hello-world template compiles and deploys in minutes. Watch your transaction appear on chain in 1AM Explorer — that's your proof it's working.

If you hit issues not covered here, find me in the Midnight Discord as Guto — I've been through most of them already.