Edge Node Deployment Tutorial
Edge nodes are the backbone of the peer-to-peer messaging framework, tasked with forwarding and temporarily storing messages for clients who aren't online. Operating on a fully decentralized architecture, these nodes ensure complete user privacy by not retaining any personal data, such as message history or contacts. In this guide, we'll walk you through the process of setting up your own SendingNetwork (SDN) Edge Node. Once set up, your node will seamlessly integrate into the SDN network, ready to relay messages.
System Requirements
Before diving into the setup process, let's make sure your system meets the necessary requirements to run a edge node efficiently. Here's what you'll need:
Hardware:
CPU: An x86-64 CPU (AMD or Intel) is required. While a dual-core processor is the minimum, we recommend a quad-core or higher for the best performance.
Memory: At least 8GB of RAM.
Storage: A minimum of 100GB of free space. SSDs are preferred over HDDs for faster data access and better performance.
Software:
Operating System: A stable version of Linux. We recommend Ubuntu 20.04 LTS.
Network:
A static public IP address is needed to facilitate incoming connections.
Always-on 100 Mbps internet with a minimum 100 GB monthly data plan.
You may request a static public IP address through your Internet Service Provider or opt to deploy your node on a Virtual Private Server (VPS) equipped with a static public IP. Many VPS service providers can accommodate this need. For details about setting up the VPS, see VPS setup guide.
With these system requirements in check, you'll be well-prepared to start the deployment of your SDN Edge Node.
VPS Platform Firewall Configuration
If utilizing a VPS, it's essential to open ports 9085, 15858, 9702, 2112 in your VPS platform's firewall to guarantee node connectivity to the network. While our installation script will manage firewall configurations within Linux, you must also manually ensure these ports are accessible on your VPS platform.
For firewall configuration across various VPS providers, see VPS setup guide.
Installation
Use our provided installation script to quickly launch the service with just a few commands. This script simplifies the setup process for the relay service by automating numerous configuration and installation steps. Actions performed by the script include:
Install prerequisites: Installs essential tools including
net-tools
,telnet
, andwget
.Configure firewall ports: Automatically opens necessary ports (
9085
,15858
,9702
,2112
) and verifies their configuration.Install docker: Detects the OS and installs Docker.
Setup docker compose: Downloads and customizes
docker-compose.yaml
with the local public IP and wallet address for multi-container Docker applications.Launch relay service: Deploys and starts the relay service using Docker Compose based on the modified configuration.
Service and firewall verification: Checks the relay service's status and firewall port accessibility, reporting success or failure.
Step 1: Download the installation script
Should you encounter any issues or have questions, refer to the troubleshooting section at the end of this tutorial or seek support from the SendingNetwork community. Check our FAQ docs for common questions.
Depending on your system, use the following command to download and install the deployment script:
Step 2: Execute the installation script
Run the following command to execute the script, replacing WALLET_ADDRESS at the end with your whitelisted wallet address to ensure successful node deployment and avoid missing out on SXP:
Please do NOT run the script with sudo
directly as it will impact the node daemon process. Instead, you can run it under a common user account, or by using sudo su
or the root account.
The command might take a few minutes to complete, displaying progress on installing prerequisites, Docker configuration, database setup, and node deployment along the way. If you see the following output, the service has started successfully:
Firewall verification
If the firewall fails to open, use the following command structure to double check the failed port:
For example, to check port 15858:
If the output below appears, it indicates an issue with your firewall setup.
Please ensure you have applied the firewall policy allowing traffic for ports 9085, 15858, 9702, and 2112 to your machine if you are using a VPS. You may refer to the firewall configuration example in our Google Cloud firewall configuration.
Check the status of relay service
Input the following command:
This command filters the processes related to your edgenode service, excluding any monitoring or irrelevant grep processes.
Expected Output:
If the service is running properly, you should see output similar to the following:
This output indicates that your relay service is currently running, detailing the process's parameters and configuration. If you do not see any output, it means that your relay service might not be running correctly, and you may need to troubleshoot further or restart the service.
Check the node ID
To display your node ID, use the following command:
Stop the node
To safely stop your node and associated services, execute the commands below in your terminal. These commands will identify and stop the Docker containers for both the Edge node and its related PostgreSQL database.
Execute the following command to stop the Edge node container:
Use this command to stop the PostgreSQL container:
If you are stopping the node permanently, please remove any previously applied node-related firewall policies from your machine.
Restart the node
To restart your Edge node, follow these steps:
Download the latest installation script: In the original directory, obtain the latest script and run it.
Maintain the original directory: If you run the node from a new directory other than the original one, it will create a new node ID. Points will be accrued with this new ID, but previous points will remain valid under the original node ID.
Next Steps
After finishing the installation, interact with our auto-reply bot on the SendingMe app to check your node's stats. SendingMe is an all-in-one web3 instant messaging app built on top of SendingNetwork. Refer to Check Node Stats with Auto-Reply Bot in SendingMe for instructions on utilizing the bot to monitor your node's performance.
Should you encounter any issues or have questions, don't hesitate to seek support from the SendingNetwork community.
Troubleshooting
Error: Unable to start Edge node
There are several reasons why you might encounter this error:
Non-whitelisted Wallet Address:
Log Message:
Solution: Ensure you are using the correct whitelisted wallet address that you submitted in the Discord channel. If you are Alpha-1 testnet runner, please use the same wallet address as before.
Restricted Area Deployment:
Log Message:
Solution: Mining is not supported in mainland China. Please make sure you are deploying the node from a supported location.
Multiple Active Nodes:
Log Message:
Solution: Only one active node is allowed at a time per wallet address. If you run a second node in a new location while the original one is still active, you will see this error. To run a new node in another location (such as a different directory or machine), follow these steps:
Stop the current node according to the stop instructions.
Wait for 10 minutes.
Start the new node in the desired location.
This will create a new node ID, and points will be accrued with this new ID. Previous points will remain valid under the original node ID.
Error: Unable to open ports
There are several reasons why you might encounter this error.
Mistakenly running the script with
sudo
:Log Message:
Solution: Please do NOT run the installation script with
sudo
as it will impact the node daemon process. Instead, you can run it under a common user account, or by usingsudo su
or the root account.For Linux, run the script with the following command:
Firewall Configuration issue:
Log Message:
Solution:
This error indicates that the ports on your machine are closed or that the VPS provider's firewall is blocking traffic (if applicable). It's possible for the machine's ports to be open, but the VPS provider's firewall might still restrict traffic. This issue could affect the four ports required for the relay service: 9085, 15858, 9702, and 2112.
Verify Port Status:
Run the following command to check if the port is open:
Firewall Configuration:
Ensure that your firewall is configured to allow traffic for the ports. For a reference on configuring your firewall, please see the firewall configuration section in Google Cloud firewall configuration.
Last updated