Skip to content

Mochimo Node on Windows Subsystem for Linux

Chrisdigity edited this page Feb 11, 2025 · 5 revisions

Prerequisites

  • CPU capable of Virtualization
    • may require BIOS config; consult your BIOS manual
  • Windows 11 22H2 or greater

Install Windows Subsystem for Linux (Ubuntu-24.04)

Prepare WSL2 configuration for mirrored networking mode:

  • Create a file inside your USER directory: C:\Users\<USERNAME>\.wslconfig
  • Inside the file, ensure the following setting is configured...
[WSL2]
networkingMode=mirrored

Run Powershell as an Administrator...
Easiest way is to Right-Click the Windows Start button and select either:

  • Windows Powershell (admin), or
  • Terminal (admin)
# Ensure the VirtualMachinePlatform feature is enabled:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
# Install Windows Subsystem for Linux (>=2.4.4):
wsl --install --no-distribution # if not already installed
wsl --version # check WSL version is >=2.4.4
wsl --update # if necessary

# Install Ubuntu on Windows Subsystem for Linux:
wsl --install Ubuntu --no-launch
ubuntu install --root # install as root
ubuntu # starts WSL-Ubuntu

# Update Distribution and install package dependencies
apt update && apt install build-essential git -y

Download and Build the Mochimo Node

Clone the Mochimo Github repository and build the miner within your WSL terminal started earlier:

git clone https://github.com/mochimodev/mochimo ~/mochimo/
cd ~/mochimo/
# Optional (but RECOMMENDED), update repository to latest tagged version
git fetch && git checkout master && git pull
git checkout $(git describe --tags --abbrev=0)
# Build Mochimo Node
make mochimo
# return to $HOME
cd ~/

Node Usage

~/mochimo/bin/gomochi

For additional options, use the --help menu:

~/mochimo/bin/mochimo --help

Network Configuration Issues

Uncaptured Windows Related Issues

Getting a Mochimo Node running on WSL is typically not a problem.

Getting a Mochimo Node running on WSL to communicate with the Mochimo Network is typically THE PROBLEM.

If you encounter an issue not listed here and know a fix, feel free to let us know so we can get it added here.

WSL Networking Mode

Although it is possible without "mirrored" Networking Mode, the recommendation is clear based on it's relative success. Which is why it was included as a WSL Installation Step above. To reiterate:

  • Create a file inside your USER directory: C:\Users\<USERNAME>\.wslconfig
  • Inside the file, ensure the following setting is configured...
[WSL2]
networkingMode=mirrored

Windows Firewall

Windows WILL BLOCK port 2095 unless otherwise directed to ALLOW it as an Inbound Rule.

  • Open the start menu and start typing: Windows Defender Firewall with Advanced Security
  • You likely need not type the whole thing, click on it when it pops up
  • In the very left panel, click on Inbound Rules
  • Then, in the very right panel, click on New Rule...
  • Select Port type rule
  • Select TCP, Specific local ports, enter 2095 as local port
  • Select Allow the connection
  • Select where you want this rule to apply
    • if you are unsure where you want this rule to apply, select all
  • Enter a name for your Inbound Rule (Recommend: "Mochimo Node 2095")
  • Description for your Inbound Rule is optional
  • Click Finish to create the Inbound Rule

Port Forwarding

Port 2095 needs to be pointed at the (IP) address of your WSL distribution, or the machine hosting your WSL distribution in the MUCH EASIER case of WSL's "mirrored" Networking Mode. https://portforward.com/ is the best resource so far, but due to the large variety of routers and associated software, assistance with this step is unfortunately very difficult and unreliable.

Good luck :)

How do I know the Node is working properly

The Node will search the network for the highest chain and validate it's Tfile. Depending on your system resources, THIS CAN TAKE SOME TIME and may appear to be stuck. Rest assured; it is validating the network chain. After the Tfile is validated, you may notice very frequent poems of haiku in the terminal. This is the node synchronizing with the network. A single line (very easy to miss)...

Listening...

... marks the end of synchronization.

After this synchronization point OR when you start seeing large amounts of logs that are not poems of haiku, you can test your node's network connection by going to https://portchecker.co/. Your public IP will typically appear automatically, enter port 2095 and test the connection.

You want to see that your port 2095 is OPEN.

IF YOUR PORT IS CLOSED, YOUR NODE IS NOT REACHABLE FROM THE NETWORK AND WILL IS ESSENTIALLY NOT BE WORKING!!!

Figuring out why is the hardest part, most common issues are listed above in Network Configuration Issues.

Run into issues?

Let us know on Discord.