Running an IPFS Task
Running an IPFS Task on Your VPS
To ensure smooth operation of IPFS tasks on your VPS node, please follow the steps below. This guide will help you configure your environment and expose the necessary ports.
Step 1: Expose Port 30017
Ensure that your VPS has port 30017 exposed. If you prefer to use a different port, set it accordingly in the environment variables. Additionally, ensure that the port is exposed from your cloud provider (e.g., AWS, GCP, Azure).
Step 2: Update Environment Variables
-
Set the Server Port: If you are using a port other than
30017, add theSERVER_PORTvariable to your environment configuration. For example, if you are using port4000, it should look like this:SERVER_PORT=4000tipIf you are using the default port
30017, there is no need to set theSERVER_PORTvariable. -
Add the IPFS Task ID: Include the
Taskin your environment configuration with your IPFS Task ID, and comma separated each tasks:TASKS=E2yxYLgVmPDNXxiKsdNZsDV5vnNZDwWSssKFbn24tMu2,<any other tasks you were running before> -
Update the Service URL: Set the
SERVICE_URLvariable to point to your VPS IP address and the chosen port:SERVICE_URL="http://<YOUR_IP_ADDRESS>:30017" -
Set the Static IP Flag: Add the
HAVE_STATIC_IPvariable to indicate that your VPS has a static IP:HAVE_STATIC_IP=true -
Enable Non-Whitelisted Tasks: Add the
RUN_NON_WHITELISTED_TASKSvariable to allow running non-whitelisted tasks:RUN_NON_WHITELISTED_TASKS=true
Step 3: Verify Task Endpoint Accessibility
After updating your environment variables and starting your service, ensure that the task endpoint is accessible over the internet:
- Open a browser or use a tool like curl to access the following URL:
http://<YOUR_IP_ADDRESS>:30017/tasks
- Check that the IPFS task appears in the list displayed at this endpoint.
If you follow these steps, your IPFS task should be correctly configured and accessible from the internet.