Join as Compute Provider
Bacalhau is a peer-to-peer network of computing providers that will run jobs submitted by users. A Compute Provider (CP) is anyone who is running a Bacalhau compute node participating in the Bacalhau compute network, regardless of whether they are hosting any Filecoin data.
This section will show you how to configure and run a Bacalhau node and start accepting and running jobs.
To bootstrap your node and join the network as a CP you can leap right into the Ubuntu 22.04 quick start below, or find more setup details in these guides:
If you run on a different system than Ubuntu, drop us a message on Slack! We'll add instructions for your favorite OS.
Quick start (Ubuntu 22.04)
Estimated time for completion: 10 min. Tested on: Ubuntu 22.04 LTS (x86/64) running on a GCP e2-standard-4 (4 vCPU, 16 GB memory) instance with 40 GB disk size.
Prerequisites
Docker Engine - to take on Docker workloads
Connection to storage provider - for storing job's results
Firewall - to ensure your node can communicate with the rest of the network
Physical hardware, Virtual Machine, or cloud-based host. A Bacalhau compute node is not intended to be run from within a Docker container.
Install Docker
To run docker-based workloads, you should have docker installed and running.
If you already have it installed and want to configure the connection to Docker with the following environment variables:
DOCKER_HOST
to set the URL to the docker server.DOCKER_API_VERSION
to set the version of the API to reach, leave empty for "latest".DOCKER_CERT_PATH
to load the TLS certificates from.DOCKER_TLS_VERIFY
to enable or disable TLS verification, off by default.
If you do not have Docker on your system, you can follow the official docker installation instructions or just use the snippet below:
Now make Docker manageable by a non-root user:
Ensure your Storage Server is Running
We will need to connect our Bacalhau node to a storage server for this we will be using IPFS server so we can run jobs that consume CIDs as inputs.
You can either install and run it locally or you can connect to a remote IPFS server.
In both cases - we should have a multiaddress for our IPFS server that should look something like this:
The multiaddress above is just an example - you need to get the multiaddress of the server you want to connect to.
To install a single IPFS node locally on Ubuntu you can follow the official instructions, or follow the steps below. We advise running the same IPFS version as the Bacalhau main network.
Using the command below:
Install:
Configure:
Now launch the IPFS daemon in a separate terminal (make sure to export the IPFS_PATH
environment variable there as well):
If you want to run the IPFS daemon as a systemd service, here's an example systemd service file.
Don't forget we need to fetch an IPFS multiaddress pointing to our local node.
Use the following command to print out a number of addresses.
I pick the record that combines 127.0.0.1
and tcp
but I replace port 4001
with 5001
:
Configure firewall
To ensure that our node can communicate with other nodes on the network - we need to make sure the 1235 port is open.
(Optional) To ensure the CLI can communicate with our node directly (i.e. bacalhau --api-host <MY_NODE_PUBLIC_IP> version
) - we need to make sure the 1234 port is open.
Firewall configuration is very specific to your network and we can't provide generic instructions for this step but if you need any help feel free to reach out on Slack!
Install the Bacalhau Binary
Install the bacalhau binary to run bacalhau serve
.
If you want to run Bacalhau as a systemd service, here's an example systemd service file.
Run bacalhau
Now we can run our bacalhau node:
Alternatively, you can run the following Docker command:
These commands join this node to the public Bacalhau network, congrats! 🎉
Check your node works
Even though the CLI (by default) submits jobs, each node listens for events on the global network and possibly bids for taking a job: your logs should therefore show the activity of your node bidding for incoming jobs.
To quickly check your node runs properly, let's submit the following dummy job:
If you see logs of your compute node bidding for the job above it means you've successfully joined Bacalhau as a Compute Provider!
What's next?
At this point, you probably have a number of questions for us. What incentive should you expect for running a public Bacalhau node? Please contact us on Slack to further discuss this topic and for sharing your valuable feedback.
Last updated