WB Network: Private Node Setup Guide
This manual will guide you through the process of setting up a private node on the WB Network, specifically configured to hide your IP addresses and other private information (ie user-agent, etc).
We will use Nginx as a reverse proxy with disabled logs and configured for cleanup headers.
Live Demo
Before setup your own server, you can experiment with my node which we with friends use for all activities in WB Network Testnet as an additional point to test the full flow of end users or companies:
Prerequisites
Recommendations
- As a base server, I can recommend using Contabo CLOUD VPS S. It cost around 8.5 USD per month and has 4 vCPU Cores, 8GB RAM, and 200GB SSD. It covered minimal official hardware requirements https://github.com/whitebit-exchange/wbt#hardware-requirements
- Do not use a server with hardware which less than minimal as in this case node works unstable and periodically will go down (especially during synchronization).
Step 1: Setup Server
Update your system's package lists
sudo apt update sudo apt upgrade -y
Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
Install Nginx
sudo apt install nginx
Ensure that the Ubuntu firewall (UFW) is installed
sudo apt install ufw
Step 2: Setup node with Docker Compose
Docker Compose is an orchestration tool for defining and managing multi-container Docker applications. It uses a YAML file to configure the application's services and performs the creation and start-up process of all the containers with a single command.
Once the YAML file is configured, the developer can create and start all the services from your configuration with just a single command: docker-compose up
. This drastically simplifies the deployment process and reduces the chance of human error.
As a reference for Docker configuration, we will use the official GitHub:
- Quick start https://github.com/whitebit-exchange/wbt#start-a-full-node
- Configuration: https://github.com/whitebit-exchange/wbt#programmatically-interfacing-geth-nodes
2.1 Create a required folder
sudo mkdir -p /var/whitebit
2.2 Create a Docker Compose file
sudo nano docker-compose.yml
Paste the following code into the file:
version: "3" services: whitebit: image: whitebit/wbt:0.3.0 command: --wbt-testnet --http --http.addr "0.0.0.0" ports: - "30303:30303" - "8545:8545" volumes: - /var/whitebit:/root restart: unless-stopped
Save and close the file (Ctrl+X
, then Y
and Enter
).
2.3 Run the following command to start the WB Network node
sudo docker-compose up -d
Your node should now be running in Docker in the background.
2.4 Check logs
docker logs root-whitebit-1 -f
Step 3: Setup Nginx as a reverse proxy for WB Network node
Nginx is a powerful, high-performance tool that serves as an HTTP and reverse proxy server. By hiding the IP addresses and other details of backend servers, Nginx can provide an extra layer of security for your systems. As a reverse proxy, Nginx accepts all incoming traffic and forwards it to the appropriate backend server, which shields your servers from direct exposure to the Internet and potential threats.
3.1 Create a new Nginx configuration file
sudo nano /etc/nginx/sites-available/whitebit
Paste the following code into the file:
upstream rpc_whitebit_node { server 127.0.0.1:8545; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; location / { add_header Content-Type "text/plain"; return 200 'WB Network Node'; } location /rpc { access_log off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host "localhost"; proxy_set_header X-Forwarded-Proto ""; proxy_set_header X-Forwarded-Host ""; proxy_set_header X-Forwarded-For ""; proxy_set_header X-Real-IP ""; proxy_set_header Forwarded ""; proxy_set_header User-Agent ""; proxy_set_header Cookie ""; proxy_pass http://rpc_whitebit_node/; } }
Save and close the file (Ctrl+X
, then Y
and Enter
).
3.2 Enable your configuration by creating a symbolic link to the sites-enabled directory
sudo ln -s /etc/nginx/sites-available/whitebit /etc/nginx/sites-enabled/
3.3 Disable Nginx default site configuration
sudo rm /etc/nginx/sites-enabled/default
3.4 Test your configuration
sudo nginx -t
If the test is successful, you will see an output like this:
nginx: configuration file /etc/nginx/nginx.conf test is successful
3.5 Restart Nginx
sudo systemctl restart nginx
3.6 Test Nginx setup
Put to your browser endpoint http://<ip_of_your_server> and press Enter
. If the configuration is successful, you will see an output like this:
WB Network Node
Step 4: Setup Ubuntu firewall (UFW)
Ubuntu firewall, also known as UFW (Uncomplicated Firewall), is a simple, easy-to-use front-end for the standard Linux iptables tool. It provides an organized and user-friendly method for configuring firewall settings.
4.1 Allow SSH connections
sudo ufw allow ssh
4.2 Allow Nginx HTTP connections
sudo ufw allow 'Nginx HTTP'
4.3 Enable UFW
sudo ufw enable
Your Ubuntu firewall is now setup to allow SSH and Nginx connections.
4.4 Try to check the status of UFW
sudo ufw status
If the setup is successful, you will see an output like this:
Status: active To Action From -- ------ ---- Nginx HTTP ALLOW Anywhere 22/tcp ALLOW Anywhere Nginx HTTP (v6) ALLOW Anywhere (v6) 22/tcp (v6) ALLOW Anywhere (v6)
Step 5: Testing node setup
Congratulations! We have everything installed, configured, and can test it.
You can change the configuration New RPC URL
of the WhiteBIT Network in your MetaMask, press Save
and try to make transactions trow your own node:
https://rpc-testnet.whitebit.network -> http://<ip_of_your_server>/rpc
Conclusion
In this tutorial, you will learn how to set up your own WB Network private node to protect your online privacy effectively. By installing this node, you can hide your real IP address and user-agents from browsers/wallets, ensuring that your online activities remain anonymous.
Additionally, this setup ensures that no logs are generated, preventing any attempts to deanonymize you or reveal your actual location.
What next?
- Setup HTTPS for your server as it will be strictly required for security in mainnet (example)
- Buy and add a custom domain to your node
- Protect it with CloudFlare (example)