Running a Filecoin RPC Node
Requirements 📄
Before getting started, Filecoin node setup requires many dependencies to setup correctly. These dependencies are commonly already installed on most modern linux machines, but include the following:
mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget
The list above is specific to Debian/Ubuntu-based OSes. For a different configuration, check out Lotus docs.
Note that you will also need Go v1.19.7 or higher for a successful install.
Install Lotus Filecoin Node 🚀
Filecoin is a divers ecosystem with different node implementations. Each node implementation has different ways to generate and manage authentication tokens. This guide uses Lotus Filecoin, which is the reference node implementation for the Filecoin network.
Get Lotus
To get started, input the following into the terminal:
git clone https://github.com/filecoin-project/lotus.git
cd lotus/
git checkout releases
Decide Mainnet or Testnet
# join mainnet
make clean all
# Or to join a testnet or devnet:
make clean calibnet # Calibration with min 32GiB sectors
Compile Lotus
Finalize the install by inputting sudo make install
in the terminal.
You can run lotus --version
to ensure that this process completed successfully.
Specific CPU architectures may require additional configuration. Consult the Lotus Filecoin documentation for additional details if you encounter any errors.
Start your RPC Server 🖥️
Configure your RPC node
- Download & Import a Snapshot:
aria2c -x5 https://snapshots.mainnet.filops.net/minimal/latest.zst
# Replace the <snapshot-filename> based on the snapshot you downloaded.
lotus daemon --import-snapshot <snapshot-filename> --halt-after-import
- Edit the configuration file
./.lotus/config.toml
to run RPC. You can do this by findingEnableEthRPC
and ensuring it's set totrue
:
# EnableEthRPC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.
# This will also enable the RealTimeFilterAPI and HistoricFilterAPI by default, but they can be disabled by config options above.
#
# type: bool
# env var: LOTUS_FEVM_ENABLEETHRPC
EnableEthRPC = true
Launch
Run the following command:
nohup lotus daemon > ~/lotus.log 2>&1 &
Log messages can be found at ~/lotus.log
- it will take a moment for your node to get the latest blocks!
After that, you should be ready to serve RPC!
Apply to our Provider Incubation Program 📋
In our current state of Testnet, there is an additional stage to pass through before you can become a provider on the Lava Network. Please fill out the application form for our Provider Incubation Program. Feel free to drop a line in our Discord once you’ve completed this step!
Setup your Provider on Lava Network 🌋
Once you’ve been accepted - to set up your provider on the Lava Network, you can refer to the provider setup documentation available elsewhere in our docs. This should provide you with the necessary information to configure and operate your provider node.