<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Uroy Nwankwo</title>
    <description>The latest articles on DEV Community by Uroy Nwankwo (@devroy).</description>
    <link>https://dev.to/devroy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1917491%2Ffa7246b4-743e-4580-b6d0-5e233a0174cd.jpg</url>
      <title>DEV Community: Uroy Nwankwo</title>
      <link>https://dev.to/devroy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devroy"/>
    <language>en</language>
    <item>
      <title>Setting up Midnight on Windows via WSL2: The Complete Guide</title>
      <dc:creator>Uroy Nwankwo</dc:creator>
      <pubDate>Fri, 08 May 2026 22:59:21 +0000</pubDate>
      <link>https://dev.to/devroy/setting-up-midnight-on-windows-via-wsl2-the-complete-guide-32ha</link>
      <guid>https://dev.to/devroy/setting-up-midnight-on-windows-via-wsl2-the-complete-guide-32ha</guid>
      <description>&lt;p&gt;Midnight's toolchain runs natively on UNIX systems, Linux and macOS. If you're on Windows, you will need the Windows Subsystem for Linux 2 (WSL2).&lt;br&gt;
This tutorial takes you from a fresh Windows machine to a working Midnight dev environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Target audience:&lt;/strong&gt; Windows developers who want to build on the Midnight network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10 (version 2004+) or Windows 11&lt;/li&gt;
&lt;li&gt;Administrator access&lt;/li&gt;
&lt;li&gt;stable internet connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What you'll have by the end&lt;/strong&gt;: A winodws machine setup with a complete development environment for building on the midnight network.&lt;/p&gt;

&lt;p&gt;You will set up WSL2, configure Docker Desktop, allocate enough memory for the proof server, install the Compact compiler, and verify everything by deploying the Hello World contract. It also shows which Windows approaches fail, so you can skip the dead ends.&lt;/p&gt;
&lt;h2&gt;
  
  
  What does not work on Windows
&lt;/h2&gt;

&lt;p&gt;You cannot run the Midnight toolchain natively on Windows. The following approaches all fail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PowerShell / Command Prompt&lt;/strong&gt;: the Compact installer script is a POSIX shell script. It will not run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows-native Node.js&lt;/strong&gt;: even if you install Node.js for Windows, the Compact compiler and proof server depend on Linux binaries. They will not resolve correctly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Bash / Cygwin&lt;/strong&gt;: these are POSIX compatibility layers, not real Linux environments. The installer may appear to work, but it will produce broken PATH entries and missing binaries at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The supported Windows setup is WSL2 with a real Linux distribution. Everything after this point assumes you are inside a WSL2 terminal unless explicitly marked &lt;strong&gt;[Windows terminal]&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Install and configure WSL2
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;[Windows terminal: run PowerShell as Administrator]&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--install&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s8lc5vwhegl9dumodpe.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s8lc5vwhegl9dumodpe.PNG" alt=" PowerShell showing wsl --install progress plus the success or reboot prompt message." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command installs WSL2 and downloads Ubuntu, which is the recommended distribution. Restart your machine when prompted.&lt;/p&gt;

&lt;p&gt;After restart, open Ubuntu from the Start menu. The first launch completes the Ubuntu setup and asks you to create a Linux username and password. These credentials are for your WSL2 environment only. They do not need to match your Windows credentials.&lt;/p&gt;

&lt;p&gt;Verify WSL2 is active:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--list&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--verbose&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49tl2rwji2zc64rfgij0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49tl2rwji2zc64rfgij0.png" alt="PowerShell showing Ubuntu with STATE set and VERSION 2 in the  raw `wsl --list --verbose` endraw  output" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see Ubuntu listed with &lt;strong&gt;Version 2&lt;/strong&gt;. If it shows Version 1, upgrade it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--set-version&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Ubuntu&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Configure WSL2 memory with &lt;code&gt;.wslconfig&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is the step the official docs miss. The Midnight proof server generates zero-knowledge proofs locally, which takes real memory. By default, WSL2 caps memory at 1 GB, so the proof server can run out of memory and crash without much explanation.&lt;/p&gt;

&lt;p&gt;You need to create a &lt;code&gt;.wslconfig&lt;/code&gt; file in your Windows user profile directory to raise this limit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Windows terminal]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open Notepad (or any text editor) and create the file at &lt;code&gt;C:\Users\&amp;lt;YourUsername&amp;gt;\.wslconfig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# .wslconfig: WSL2 resource configuration
&lt;/span&gt;&lt;span class="nn"&gt;[wsl2]&lt;/span&gt;
&lt;span class="py"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;8GB          # Allocate 8 GB RAM to WSL2 (minimum 4 GB for proof server)&lt;/span&gt;
&lt;span class="py"&gt;processors&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;4        # Number of CPU cores available to WSL2&lt;/span&gt;
&lt;span class="py"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2GB            # Optional: virtual swap space&lt;/span&gt;
&lt;span class="py"&gt;localhostForwarding&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqio23cry7dbpaz40piqa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqio23cry7dbpaz40piqa.PNG" alt="C:\Users\&amp;lt;YourUsername&amp;gt;\.wslconfig open in Notepad with both the file path and config contents visible." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save the file, then restart WSL2 from a Windows terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--shutdown&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait 10 seconds, then reopen your Ubuntu terminal. The new memory limit takes effect immediately.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; The proof server can crash with less than 4 GB allocated. &lt;code&gt;8GB&lt;/code&gt; is the safer setting. If your machine has 16 GB of RAM or more, giving WSL2 &lt;code&gt;8GB&lt;/code&gt; still leaves enough memory for Windows and a browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 3: Set up Docker Desktop with the WSL2 backend
&lt;/h2&gt;

&lt;p&gt;The Midnight proof server runs as a Docker container. Docker Desktop must use the WSL2 backend. The Hyper-V backend does not give your WSL2 terminal access to Docker.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download and install &lt;a href="https://www.docker.com/products/docker-desktop/" rel="noopener noreferrer"&gt;Docker Desktop&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;During installation, select &lt;strong&gt;Use WSL2 instead of Hyper-V&lt;/strong&gt; when prompted.&lt;/li&gt;
&lt;li&gt;After installation, open Docker Desktop and go to &lt;strong&gt;Settings → General&lt;/strong&gt;. Confirm that &lt;strong&gt;Use the WSL2 based engine&lt;/strong&gt; is checked.&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings → Resources → WSL Integration&lt;/strong&gt;. Enable integration for your Ubuntu distribution.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply &amp;amp; Restart&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ased874lfvsv4983s4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ased874lfvsv4983s4u.png" alt="Docker Desktop Settings → General with  raw `Use the WSL2 based engine` endraw  checked." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b5hublfl9qkg7vow6e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b5hublfl9qkg7vow6e9.png" alt=" Docker Desktop Settings → Resources → WSL Integration with the Ubuntu distro toggle enabled." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Verify Docker is accessible from inside WSL2:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal]&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see output like &lt;code&gt;Docker version 26.x.x, build ...&lt;/code&gt;. If you see &lt;code&gt;command not found&lt;/code&gt;, Docker is not exposed inside WSL yet. Go back to item 4 in this section and make sure WSL integration is enabled for your Ubuntu distro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Install Node.js inside WSL2
&lt;/h2&gt;

&lt;p&gt;The Midnight DApp tooling requires Node.js v22 or later. Install it inside WSL2 with &lt;code&gt;nvm&lt;/code&gt; (Node Version Manager). That keeps the version under your user account and avoids &lt;code&gt;sudo&lt;/code&gt; headaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal]&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o-&lt;/span&gt; https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload your shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install and activate Node.js v22:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvm &lt;span class="nb"&gt;install &lt;/span&gt;22
nvm use 22
node &lt;span class="nt"&gt;--version&lt;/span&gt;   &lt;span class="c"&gt;# should output v22.x.x&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0v3gqnh9y2witz1e7yf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0v3gqnh9y2witz1e7yf.PNG" alt="WSL terminal showing nvm use 22 and node --version returning a v22.x.x version." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Do not install Node.js with &lt;code&gt;apt&lt;/code&gt; for this workflow. Ubuntu's &lt;code&gt;apt&lt;/code&gt; packages are usually older and do not meet the v22 requirement.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 5: Install the Compact compiler
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the official Compact installer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--proto&lt;/span&gt; &lt;span class="s1"&gt;'=https'&lt;/span&gt; &lt;span class="nt"&gt;--tlsv1&lt;/span&gt;.2 &lt;span class="nt"&gt;-LsSf&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installer downloads the Compact binary and adds it to your PATH. Reload your shell config so the PATH change takes effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;span class="c"&gt;# or, if you use zsh:&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;compact &lt;span class="nt"&gt;--version&lt;/span&gt;
compact compile &lt;span class="nt"&gt;--version&lt;/span&gt;
which compact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiad4r0oype66b2qb9ixe.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiad4r0oype66b2qb9ixe.PNG" alt="WSL terminal showing successful output for compact --version, compact compile --version, and which compact" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All three commands should return valid output. If &lt;code&gt;compact: command not found&lt;/code&gt; appears, the PATH was not updated. Add it manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.compact/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'export PATH="$HOME/.compact/bin:$PATH"'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update to the latest compiler version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;compact update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; If &lt;code&gt;compact update&lt;/code&gt; fails with:&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;Failed to spawn artifact extraction &lt;span class="nb"&gt;command
&lt;/span&gt;No such file or directory &lt;span class="o"&gt;(&lt;/span&gt;os error 2&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;your WSL environment is missing required system tools (for example &lt;code&gt;unzip&lt;/code&gt; or &lt;code&gt;tar&lt;/code&gt;). Install them before retrying:&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; unzip &lt;span class="nb"&gt;tar gzip &lt;/span&gt;curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Install a package manager
&lt;/h3&gt;

&lt;p&gt;The Hello World example later in this tutorial uses &lt;code&gt;yarn&lt;/code&gt;. Install it with npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify it installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;yarn&lt;/code&gt; is optional. You can use &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;pnpm&lt;/code&gt; instead. &lt;br&gt;
If you prefer a different package manager, substitute &lt;code&gt;yarn&lt;/code&gt; commands &lt;br&gt;
with your preferred equivalent throughout this tutorial &lt;br&gt;
(e.g. &lt;code&gt;npm install&lt;/code&gt; instead of &lt;code&gt;yarn install&lt;/code&gt;, &lt;code&gt;npm run env:up&lt;/code&gt; &lt;br&gt;
instead of &lt;code&gt;yarn env:up&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 6: Start the proof server
&lt;/h2&gt;

&lt;p&gt;The proof server generates ZK proofs for your transactions. It runs as a Docker container on port &lt;code&gt;6300&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure Docker Desktop is running (check your Windows system tray for the Docker icon). Then start the proof server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 6300:6300 midnightntwrk/proof-server:8.0.3 midnight-proof-server &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command occupies the terminal while the server runs. Open a second WSL2 terminal window for the next steps. You should see log output ending with something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt; INFO actix_server::server: starting service: "actix-web-service-0.0.0.0:6300", 
 workers: 4, listening on: 0.0.0.0:6300
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dkambyc2dldg5euqu9w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dkambyc2dldg5euqu9w.PNG" alt="WSL terminal with the proof server container running and the listening on: 0.0.0.0:6300 log visible." width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That confirms the proof server is running and ready.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Keep the proof server terminal open while you work. If you close it, any compile or deploy step that needs ZK proofs will hang or fail.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 7: Install the Compact VS Code extension
&lt;/h2&gt;

&lt;p&gt;Before opening any contract files, install the Compact VS Code &lt;br&gt;
extension. It provides syntax highlighting and code snippet &lt;br&gt;
completion for &lt;code&gt;.compact&lt;/code&gt; files. Without it, VS Code treats &lt;br&gt;
your contract as plain text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download the VSIX package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; compact.vsix https://raw.githubusercontent.com/midnight-ntwrk/releases/gh-pages/artifacts/vscode-extension/compact-0.2.13/compact-0.2.13.vsix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install it in VS Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; compact.vsix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, install it manually through the VS Code UI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VS Code&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Extensions&lt;/strong&gt; (Ctrl+Shift+X)&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;...&lt;/strong&gt; menu at the top right of the Extensions panel&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Install from VSIX...&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to and select the downloaded &lt;code&gt;compact.vsix&lt;/code&gt; file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Verification:&lt;/strong&gt; Open the Extensions panel and confirm &lt;br&gt;
&lt;code&gt;Compact Language Support&lt;/code&gt; appears in your installed extensions list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftkqlisfi7pyva7f9ck77.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftkqlisfi7pyva7f9ck77.PNG" alt="VS Code Extensions panel showing the Compact Language Support extension installed" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 8: Deploy the Hello World contract
&lt;/h2&gt;

&lt;p&gt;With the proof server running, verify the full setup by cloning the Hello World example, compiling a Compact smart contract, and deploying it to a local Devnet.&lt;/p&gt;

&lt;p&gt;Before cloning the example project, set up a working directory inside your WSL environment. A fresh Ubuntu install starts in your home directory, which is typically empty.&lt;/p&gt;

&lt;p&gt;Check your current location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If nothing meaningful appears, create a directory for your development work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/dev
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-p&lt;/code&gt; flag makes this safe to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It creates parent directories if they do not exist.&lt;/li&gt;
&lt;li&gt;It does not fail if the directory already exists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means the command works on both fresh and existing setups.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Keep your project inside WSL (for example &lt;code&gt;~/dev&lt;/code&gt;), not in the Windows filesystem (&lt;code&gt;/mnt/c/...&lt;/code&gt;). Working in &lt;code&gt;/mnt/c&lt;/code&gt; often causes slower file access, permission issues, and strange behavior with Node.js and Docker.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Confirm your location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a path like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/home/&amp;lt;your-username&amp;gt;/dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now clone the Hello World example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[WSL terminal: new window]&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/midnightntwrk/example-hello-world.git
&lt;span class="nb"&gt;cd &lt;/span&gt;example-hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Fix the &lt;code&gt;docker-compose.yml&lt;/code&gt; before running
&lt;/h3&gt;

&lt;p&gt;The default &lt;code&gt;docker-compose.yml&lt;/code&gt; in the Hello World repo has two &lt;br&gt;
issues that can make &lt;code&gt;yarn env:up&lt;/code&gt; fail on a fresh setup.&lt;br&gt;
Open &lt;code&gt;docker-compose.yml&lt;/code&gt; and find the &lt;code&gt;proof-server&lt;/code&gt; service block.&lt;/p&gt;

&lt;p&gt;It currently looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;proof-server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;midnightntwrk/proof-server:8.0.3'&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;midnight-proof-server&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-v'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;127.0.0.1:6300:6300'&lt;/span&gt;
  &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;RUST_BACKTRACE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;full'&lt;/span&gt;
  &lt;span class="na"&gt;healthcheck&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;CMD'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;curl'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;-f'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;http://localhost:6300/version'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10s&lt;/span&gt;
    &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5s&lt;/span&gt;
    &lt;span class="na"&gt;retries&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
    &lt;span class="na"&gt;start_period&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;proof-server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;midnightntwrk/proof-server:8.0.3'&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;midnight-proof-server'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;-v'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;127.0.0.1:6300:6300'&lt;/span&gt;
  &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;RUST_BACKTRACE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;full'&lt;/span&gt;
  &lt;span class="na"&gt;healthcheck&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;CMD-SHELL'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;echo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/dev/tcp/127.0.0.1/6300'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10s&lt;/span&gt;
    &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5s&lt;/span&gt;
    &lt;span class="na"&gt;retries&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
    &lt;span class="na"&gt;start_period&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things changed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;command&lt;/code&gt;&lt;/strong&gt;: the original passes the entire string as a single 
executable, which fails silently. The corrected version passes 
the flag as a separate argument as Docker expects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;healthcheck&lt;/code&gt;&lt;/strong&gt;: the original uses &lt;code&gt;curl&lt;/code&gt; to check if the server 
is ready, but the proof server image is a minimal production image 
and does not include &lt;code&gt;curl&lt;/code&gt;. The replacement uses a TCP socket 
check via bash's built-in &lt;code&gt;/dev/tcp&lt;/code&gt;, which works without any 
additional tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; These issues have been reported upstream. See &lt;br&gt;
&lt;a href="https://github.com/midnightntwrk/example-hello-world/issues/16" rel="noopener noreferrer"&gt;issue #16&lt;/a&gt; and &lt;a href="https://github.com/midnightntwrk/example-hello-world/pull/17" rel="noopener noreferrer"&gt;PR #17&lt;/a&gt;. &lt;br&gt;
If the PR has merged by the time you read this, your file may &lt;br&gt;
already have the corrected &lt;code&gt;command&lt;/code&gt;. Only apply the changes that &lt;br&gt;
differ from what you see.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Install dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the contract file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;contracts/hello-world.compact
code &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="c"&gt;# opens VS Code for the current working directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxgt91pkdyr6ewzpx7sg.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxgt91pkdyr6ewzpx7sg.PNG" alt="VS Code opened from WSL with  raw `contracts/hello-world.compact` endraw  visible and Compact syntax highlighting active" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;contracts/hello-world.compact&lt;/code&gt; in VS Code and paste the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma language_version &amp;gt;= 0.22;

export ledger message: Opaque&amp;lt;"string"&amp;gt;;

export circuit storeMessage(newMessage: Opaque&amp;lt;"string"&amp;gt;): [] {
  message = disclose(newMessage);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick breakdown of what this contract does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ledger message&lt;/code&gt; declares a public, persistent on-chain state variable that stores a string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;circuit storeMessage&lt;/code&gt; defines the logic to update that variable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;newMessage&lt;/code&gt; is a private input by default. The &lt;code&gt;disclose()&lt;/code&gt; call marks it safe to write to public ledger state. Without it, the compiler rejects the assignment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compile the contract. The &lt;code&gt;compact compile&lt;/code&gt; command expects paths &lt;br&gt;
relative to the &lt;code&gt;contracts/&lt;/code&gt; directory, so navigate into it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;contracts
compact compile hello-world.compact managed/hello-world.compact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After compilation completes, navigate back to the project root &lt;br&gt;
before running the next commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compiling 1 circuits:
  circuit "storeMessage" (k=6, rows=26)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfhcinvt2vdy9bviv80n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfhcinvt2vdy9bviv80n.PNG" alt="WSL terminal showing the successful compact compile output with Compiling 1 circuits" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This generates ZK circuits, proving and verifying keys, and TypeScript API bindings in the &lt;code&gt;contracts/managed/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Start the local Devnet environment. The first run pulls the required Docker images. Run this in the project terminal while the proof server stays open in the other terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn &lt;span class="nb"&gt;env&lt;/span&gt;:up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In your second terminal, deploy and run the test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn &lt;span class="nb"&gt;test&lt;/span&gt;:local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A successful run looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;[12:46:12.694] INFO: Wallet sync complete after 23 emissions
[12:46:12.703] INFO: Providers initialized. Ready to test
[12:46:32.347] INFO: Contract deployed at: bba6579743ae23b44301d4a9f8df30dbd5244d63a59d8fbc2c9fc7ea521a04f8

&lt;/span&gt;&lt;span class="gp"&gt; ✓ Hello World Contract &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Deploys the contract   19649ms
&lt;span class="gp"&gt; ✓ Hello World Contract &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Stores a message        18184ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fku97joffsk2yw88itjfc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fku97joffsk2yw88itjfc.PNG" alt="Final success screenshot showing yarn test:local passing, including the deployed contract address and both passing checks." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your Midnight dev environment is now working on Windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Proof server crashes or goes silent
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; WSL2 ran out of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Open &lt;code&gt;.wslconfig&lt;/code&gt; and increase the &lt;code&gt;memory&lt;/code&gt; value (minimum &lt;code&gt;4GB&lt;/code&gt;, recommended &lt;code&gt;8GB&lt;/code&gt;). Shut down WSL2 with &lt;code&gt;wsl --shutdown&lt;/code&gt; from a Windows terminal, then restart Ubuntu and rerun the proof server.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;docker: command not found&lt;/code&gt; inside WSL
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Docker Desktop's WSL2 integration is not enabled for your distro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Open Docker Desktop → &lt;strong&gt;Settings → Resources → WSL Integration&lt;/strong&gt; → enable your Ubuntu distro → &lt;strong&gt;Apply &amp;amp; Restart&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;compact: command not found&lt;/code&gt; after installation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The PATH update was not applied to the current shell session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.compact/bin:&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'export PATH="$HOME/.compact/bin:$PATH"'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;compact update&lt;/code&gt; fails with “Failed to spawn artifact extraction command”
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Missing system utilities (&lt;code&gt;unzip&lt;/code&gt;, &lt;code&gt;tar&lt;/code&gt;, etc.) in WSL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; unzip &lt;span class="nb"&gt;tar gzip &lt;/span&gt;curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;which unzip
which &lt;span class="nb"&gt;tar&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Retry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;compact update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it still fails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.compact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reinstall.&lt;/p&gt;

&lt;h3&gt;
  
  
  Port 6300 already in use
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; An earlier proof server container is still running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Find and stop it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
docker stop &amp;lt;container_id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or run the proof server on an alternate port and update your app config to match:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 6301:6300 midnightntwrk/proof-server:8.0.3 midnight-proof-server &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;yarn test:local&lt;/code&gt; hangs indefinitely
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The proof server is not running, or Docker is not accessible from WSL2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Confirm the proof server terminal is active and showing the listening log. Confirm &lt;code&gt;docker ps&lt;/code&gt; returns results from your WSL2 terminal. If Docker is not visible, re-check the WSL integration setting in Docker Desktop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working &lt;code&gt;.wslconfig&lt;/code&gt; reference
&lt;/h2&gt;

&lt;p&gt;Save this file at &lt;code&gt;C:\Users\&amp;lt;YourUsername&amp;gt;\.wslconfig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[wsl2]&lt;/span&gt;
&lt;span class="c"&gt;# Memory: minimum 4GB for proof server, 8GB recommended
&lt;/span&gt;&lt;span class="py"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;8GB&lt;/span&gt;

&lt;span class="c"&gt;# CPU cores available to WSL2
&lt;/span&gt;&lt;span class="py"&gt;processors&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;4&lt;/span&gt;

&lt;span class="c"&gt;# Optional swap space
&lt;/span&gt;&lt;span class="py"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2GB&lt;/span&gt;

&lt;span class="c"&gt;# Allow localhost forwarding between Windows and WSL2 (needed for Docker port access)
&lt;/span&gt;&lt;span class="py"&gt;localhostForwarding&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After saving, always run &lt;code&gt;wsl --shutdown&lt;/code&gt; from a Windows terminal and restart Ubuntu for changes to take effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;Your environment is configured and verified. Next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read the &lt;a href="https://docs.midnight.network/compact" rel="noopener noreferrer"&gt;Compact language reference&lt;/a&gt; to understand how to model privacy in smart contracts.&lt;/li&gt;
&lt;li&gt;Explore the &lt;a href="https://docs.midnight.network/category/examples" rel="noopener noreferrer"&gt;full examples library&lt;/a&gt; for DApps with more complex state and circuit logic.&lt;/li&gt;
&lt;li&gt;Join the &lt;a href="https://forum.midnight.network/" rel="noopener noreferrer"&gt;Midnight developer forum&lt;/a&gt; and &lt;a href="https://discord.com/invite/midnightnetwork" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; for community support and announcements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;If you find an outdated step, leave a comment or ask in the &lt;a href="https://discord.com/invite/midnightnetwork" rel="noopener noreferrer"&gt;Midnight Discord&lt;/a&gt;. If you publish your own build notes, tag &lt;a href="https://x.com/midnightntwrk" rel="noopener noreferrer"&gt;@midnightntwrk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>web3</category>
      <category>linux</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
