Skip to main content

Prerequisites

  • Node version: 20.15.1
  • VS Code installed
  • Docker Desktop installed
  • WSL2 enabled (see WSL2 Setup Guide)

Setup Steps

Step 1: Project Configuration

  1. Open the project with VS Code
  2. Create a .env file in the root directory (if it doesn’t exist) and copy the content from env.example:
CONSENSUS_TIME=10
RPC_FEE=5
SERVER_PORT=53550
EXPOSED_URL=http://127.0.0.1:53550

Step 2: Generate Keys

Run the project to get the public and private keys (Note: It will crash, this is expected):
  1. Find the public key file in the root directory
  2. Copy the public key
  3. Create a file demos_peerlist.json in the root directory
  4. Copy the content from demos_peerlist.json.example and replace the "identity" with your public key
Public key configuration

Step 3: Setup WSL2

Setup WSL2 on your machine if you don’t have it installed.

Step 4: Install Dependencies

Open the Ubuntu terminal and run the following commands:
# Go to the project folder (example for Desktop)
cd /mnt/c/Users/User/Desktop/node

# Verify node version (should be 20.15.1)
node -v

# Install required packages
sudo apt-get update
sudo apt-get install dos2unix
sudo apt install nodejs
sudo apt install npm
sudo npm install -g n
chmod +x install
sed -i 's/\r$//' ./install
./install
If you encounter any issues, check the Issue Troubleshooting section.

Step 5: Configure Docker

  1. Open Docker Desktop
  2. Go to Settings
  3. In the General section, enable the WSL 2-based engine
Docker WSL2 settings
  1. In Settings, go to Resources > WSL Integration and enable WSL 2 and Ubuntu
Docker WSL integration
  1. Click Apply & Restart to apply the changes
  2. Verify Docker in Ubuntu Terminal:
docker --version

Step 6: Run the Project

  1. In the Ubuntu terminal, run:
sed -i 's/\r$//' ./run
  1. Go to the postgres folder and start the database:
cd postgres_5332/
sudo usermod -aG docker $USER
  1. Close and open a new WSL terminal window
  2. Start the database:
cd postgres_5332/
docker compose up
  1. In a new terminal, go back to root directory and run the project:
cd ../
./run