Skip to content
Validators
Support external chains
Filecoin

Filecoin

Set up your Filecoin Mainnet or Testnet Hyperspace node.

Prerequisites

Install required dependencies

In order to build lotus, you first need to install all of the required dependencies.

1. Build lotus from source

You can view the official documentation for details on how to build lotus from source here (opens in a new tab). Instructions below are for Ubuntu.

Install dependencies

sudo apt update
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget aria2 -y && sudo apt upgrade -y

Install Rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install Golang

You must compile the lotus daemon with the required (opens in a new tab) Go version.

wget -c https://golang.org/dl/go1.19.7.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc

Clone the lotus repository

git clone https://github.com/filecoin-project/lotus.git
cd lotus/

If you have an AMD Zen or Intel Ice Lake CPU (i.e 10th gen Intel Core/3rd gen Xeon) or newer, enable FFI optimizations (opens in a new tab) by setting the env vars below.

export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1

Checkout the correct release and build the daemon.

git checkout releases; make clean all; sudo make install

2. Starting the Daemon

For systemd service files, the makefile provides a template that can be installed.

Download the latest pruned snapshot.

aria2c -x5 https://snapshots.mainnet.filops.net/minimal/latest.zst

Import the snapshot

lotus daemon --import-snapshot path/to/snapshot.car --halt-after-import

Modify the lotus config file ~/.lotus/config.toml. First, enable the Eth RPC needed by vald. Also set the P2P configuration to use a static port with your public IP.

[Fevm]
  # 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
 
[Libp2p]
  ListenAddresses = [