Strategies with Validator Nodes - Waku Network

We have often focused on validator nodes from the Cosmos ecosystem, but today we look at a somewhat more particular: The Waku Network.

Waku Network is a shared P2P (peer-to-peer) messaging network with a focus on privacy, scalable and accessible even to resource-restricted devices. It’s based on a group of censorship-resistant communication protocols designed to enable privacy-focused messaging for Web3 dApps.

Waku Network is based on Logos, a fully decentralised, privacy-preserving and politically neutral technology stack. It’s a modular blockchain-based technology made of:

  • Nomos, consensus layer;

  • Codex, storage layer;

  • Waku, messaging layer.

In this article we will specifically cover the messaging component - Waku Network. At the moment Waku can be run via Nim, Docker Compose or Golang, but in the future it will also be possible to run it on iOS or Android and it will be deployable using the relevant SDK in other applications.

We will now look at how to install Waku via Docker Compose, which integrates the RLN system and an easily viewable Grafana dashboard.

nwaku Node Installation - Step-by-Step Guide

To begin the procedure, you need a computer with any Linux distro installed, Ubuntu 22.04 or later will do, an SSD with +30 GB and a fast Internet connection.

For those without resources capable of supporting a validator node at home, you can fall back on VPS (Virtual Private Server) solutions, that is, you can rent a virtual server.

There are several solutions, but these are the minimum requirements, which I don’t recommend but for only NuLink should work:

  • Contabo, the Cloud VPS S model, with 4 vCPU Cores, 8 GB RAM, 200 GB SSD SATA3. However I recommend the Cloud VPS M model;

  • Aeza, I recommend at least the VIEs-2 or PARs-2 model, with 2 vCPU Cores, 4 GB RAM, 60 GB NVMe. This is a Russian VPS service and payment by credit/debit card is not possible from many Western countries, but payments in crypto (BTC, BEP20, ERC20, TRC20, DASH, LTC, XMR...) are possible.

After payment is made, you will receive the IP address to access.

Contabo VPS plans
Contabo VPS plans

If operating from Windows, open Windows Powershell and launch the following command, entering your IP address instead of IP_ADDRESS:

ssh root@IP_ADDRESS

Give confirmation to save ED25519 key fingerprint to the list of known hosts, available at C:\Users\WINDOWS_USER\.ssh and enter the password of your VPS.

If you have done everything correctly, the following screen will appear:

After login on PuTTy or Windows Powershell on VPS provided by Contabo
After login on PuTTy or Windows Powershell on VPS provided by Contabo

Now enter the following commands and execute them in order to update your system and install curl and docker:

sudo apt -y update 
sudo apt -y upgrade 
sudo apt -y install curl 
curl -fsSL https://get.docker.com/ | sh 

To make sure that everything has been installed correctly, run the following command, it should return the message shown in the comment:

sudo docker run hello-world

# Hello from Docker!
# This message shows that your installation appears to be working correctly

At this point we’re ready to install Waku by cloning the repository and configuring the setup:

git clone https://github.com/waku-org/nwaku-compose
cd nwaku-compose
cp .env.example .env
nano .env

Modify only the following parameters

ETH_CLIENT_ADDRESS=   # Infura or Alchemy HTTP RPC URL
ETH_TESTNET_KEY=   # Private key EVM from Metamask
RNL_RELAY_CRED_PASSWORD=   # Password for RLN membership

Keep in mind that BlockPi’s RPC URLs do not work with Waku Network, only Alchemy or Infura. You don’t need to modify the advanced parameters, you can leave those fields empty.

If you are using a VPS with other nodes already installed, probably you’ll need to change the port allocated to the Grafana dashboard or Prometheus in case of conflict, but do this only if you know what you are doing!

It is not enough to edit the docker-compose.yml file, but you’ll probably need to edit other configuration files as well. For completeness, here are the commands to run to modify the two ports shown:

nano docker-compose.yml

# If 9090 is already allocated, change it also here
nano monitoring/configuration/datasources.yaml
I'm using 9090 port for Prometheus and 3000 for Grafana
I'm using 9090 port for Prometheus and 3000 for Grafana

Once the configuration files are prepared, let’s use a faucet on Sepolia network. It is necessary to have at least 0.01 Sepolia ETH. At this point we can launch the node:

# Register for RLN membership, necessary if you want to send messages
./register_rln.sh

# Start your Waku node
docker compose up -d

# Check if everyting's working by launching
docker compose logs -f nwaku

Monitor your node's metrics via Grafana in real time by changing IP_ADDRESS to the IP of your machine:

http://IP_ADDRESS:3000/d/yns_4vFVk/nwaku-monitoring?orgId=1&refresh=1m
Grafana dashboard
Grafana dashboard

Since you’ve enabled the RLN function, you can send on-chain messages. Launchthe following commands to be sure everything’s fine:

# Get nwaku version
curl --location 'http://127.0.0.1:8645/debug/v1/version'

# Get nwaku info
curl --location 'http://127.0.0.1:8645/debug/v1/info'
If you receive an error, probably you haven't registered your RNL Membership
If you receive an error, probably you haven't registered your RNL Membership

At this point we can send a message to the network:

curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' \
--header 'Content-Type: application/json' \
--data '{
    "payload": "'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'",
    "contentTopic": "/my-app/2/chatroom-1/proto"
}'

Congratulations, you have successfully completed the installation of your node!

No airdrop has been confirmed by the vacp2p team. Currently Waku has received an endorsement from Railgun, The Graph, and the Twitter profile is followed by Vitalik Buterin himself.

An incentive system for launching a Waku node is under consideration, which is expected to start during the course of 2024

If you like my work, I suggest you to subscribe and mint the entry in order to support my work. The cost is insignificant for you, but it helps me to know that you like this kind of content.

Subscribe to 0xOuterGod
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.