Recommendations
- It is recommended to have previous experience of operating relay or being Validator/Operator on a blockchain with knowledge of Docker .
- It is best to run Fortytwo Relay on a dedicated server. Both Relay Node and Inference Node can run on the same server if set up correctly (read more here).
- Staying online 24/7 will greatly affect the node’s quality and rewards.
1. Installing the Relay Node
1
Review the requirements
Being a Relay Noderunner has specific’Relay Node Requirements’.Make sure that your system/virtual machine meets all requirements before proceeding.
2
Get the repository
Fortytwo Relay Setup
Clone the repository
Cloning the Repository from GitHub
Cloning the Repository from GitHub
Note: We don’t recommend downloading and setting up the repository archive manually as it will be harder to keep the Fortytwo Container up to date.
- macOS
- Windows
- Linux (Ubuntu/Debian)
1
If you have previously removed git (git comes preinstalled on macOS):Install Git
or install Xcode Command Line Tools:
or install Xcode Command Line Tools:
2
Open the Terminal.
3
Navigate to your preferred installation directory with
cd command, or run the following command to continue installation in the default location in your home directory:4
Run the following commands to clone the node package and enter the folder:
3
Setup the `.env` file
Create an Open the
Read the ‘Environment Setup’ page for more details.
.env file from the .env.example reference file and update environment variables:.env file and specify the unique credentials for the node:FT_ACCOUNT_PRIVATE_KEY— Unique Web3 account private keyHOST_PUBLIC_IP— Your IP/your server IP address
Unwrap for .env setup example
Unwrap for .env setup example
4
Set up the ports
Check the
.env file and ensure that the ports defined with the FT_NODE_LISTENER_PORT and IPFS_SWARM_PORT are publicly accessible over both TCP and UDP.
Static public IP is required.‘Ports Availablity Verification’ can help you check if the Swarm will be able to see your node.5
Set up the folders
Inside the repository, create the following folders, which should match with the
IPFS_DATA_PATH and IPFS_MOUNT_PATH defined in the .env:How To Run a Relay Node Alongside an Inference Node
To run your Inference and Relay Nodes on the same machine at the same time, you need to:1
Edit the .env file
- Change the default
FT_NODE_LISTENER_PORTandFT_RPC_SERVICE_PORT. They have to be different from the Inference Node ports, which by default are42042and42420respectively. - Define a unique
FT_ACCOUNT_PRIVATE_KEY, it must be different from the account that you use with your Inference Node.
2
Ensure that FT_NODE_LISTENER_PORT is publicly accessible over both TCP and UDP
Note that static public IP is required.‘Ports Availablity Verification’ can help you check if the Swarm will be able to see your node.
2. Launching Fortytwo Relay
If restarting your node after relaunching the terminal/OS, don’t forget that the following should be executed from the node repository folder, where your.env and docker-compose.yml are located.
1
Update the repository
To make sure that your repo is up to date, before each start, get the latest updates with the
git pull command:2
Launch Docker
Launch Docker and wait until its interface says “Engine running”.
3
Build the Docker Compose services
4
Run the services in the background
How to Make Sure it Works?
If everything went successfully, you should now be able to open Docker application and see thefortytwo-relay-setup process running.
If you unwrap it and go to fortytwo-relay container, you can see the logging of the node running successfully. The node periodically tests its health and reports on your relay address status, like in this example:
3. Operating Your Node
The node will remain fully operational until it is terminated by the user or the system restarts.Updating Fortytwo Relay
The node components update automatically every time it is launched and while operational. However, you need to manually update the repository to get the latest evniroment updates. At every start, execture the following command.[|] Fortytwo Relay update available, stop your node, run the git pull command, and then restart the node. Here are the commands that will help you to compare your current commit version versus the remote version:
Stopping Fortytwo Relay
To stop the running container, either stop it from the Docker interface, or execute the following command from the same folder where thedocker-compose.yml is located: