If you are looking to deploy a Filecoin mainnet node on a Linux machine running Ubuntu operating system then this guide will provide educate step by step guide with required commands.
What is Filecoin?
Filecoin is a decentralized storage network that allows people to rent out their unused hard drive space in exchange for cryptocurrency, called Filecoin (FIL).
Instead of storing data on a centralized server, like traditional cloud storage services, Filecoin uses a network of individual users who contribute their unused hard drive space to the network. When someone wants to store a file, the Filecoin network finds available storage space and securely stores the file across multiple nodes in the network. This makes the storage more resilient to failures and attacks, and also reduces the risk of data loss.
Filecoin Node Implementations
Filecoin nodes contribute to the network’s operation and maintain its integrity. There are two major node implementations running on the Filecoin network today:
Lotus: Lotus is the reference implementation of the Filecoin protocol, developed by Protocol Labs, the organization behind Filecoin. Lotus is a full-featured implementation of the Filecoin network, including the storage, retrieval, and mining functionalities. It is written in Go and is designed to be modular, extensible, and highly scalable.
Venus: Venus is an open-source implementation of the Filecoin network, developed by IPFSForce. The project is built in Rust and is designed to be fast, efficient, and scalable.
Filecoin Node Requirements
To run a filecoin node you must have the following minimum prerequisites:
- Operating System: macOS or Linux installed. Windows is not yet supported.
- Memory: 8-core CPU and 32 GiB RAM. Models with support for Intel SHA Extensions (AMD since Zen microarchitecture or Intel since Ice Lake) will significantly speed things up.
- Storage: Enough space to store the current Lotus chain (preferably on an SSD storage medium). The chain grows at approximately 38 GiB per day.
- Internet connection: Lotus requires a stable and high-speed internet connection to synchronize with the Filecoin network and communicate with other nodes.
- Firewall and port forwarding: Ensure that your firewall settings and port forwarding rules allow incoming and outgoing traffic on the ports used by Lotus.
- Command-line interface: Lotus is primarily operated through the command line interface. Ensure that you have a basic understanding of command-line usage and are comfortable working in a terminal environment.
How to deploy Filecoin Full-node
We will now go through steps to deploy Filecoin node on Ubuntu based operating system and deploying the lotus implementation from Git.
- Install Lotus dependencies:
sudo apt install -y hwloc
2. Download Binary from Git (you may need to check for new versions released in Git release page)
3. Extract tar -xvf archive.tar.gz executable.
tar -xvf lotus_1.19.0_linux_amd64.tar.gz
4. Move the
lotus binary to
sudo mv lotus_1.19.0_linux_amd64/lotus /usr/local/bin/lotus
5. Check Filecoin version
You should now be able to verify that the binary is working by running the following version check command for Lotus:
6. Start Lotus - Now that we have installed Lotus we can download a lightweight chain snapshot and start syncing the chain.
Following command will download the latest Filecoin lightweight snapshot:
aria2c -x5 https://snapshots.mainnet.filops.net/minimal/latest.zst
7. Uncompress the downloaded snapshot:
zstd -d 1419120_2022_10_24T18_00_00Z.car.zst
Now that we have downloaded a recent snapshot we can import the snapshot to Lotus and start the daemon process.
8. Import the snapshot before starting the lotus Daemon:
# Replace the filename for the `.car` file based on the snapshot you downloaded. lotus daemon --import-snapshot path/to/1419120_2022_10_24T18_00_00Z.car --halt-after-import
9. Start the Lotus daemon:
This command makes the daemon run in the background and log messages to
~/lotus.log. You can change the path of the lotus.log file if you want the logs to be logged elsewhere.
nohup lotus daemon > ~/lotus.log 2>&1 &
Check node syncing status
After the Lotus daemon has been running for a few minutes, use lotus sync wait to check the sync status of your lotus node.
lotus sync wait
lotus sync wait command shows done you are fully synced with the chain.
Stop Running Node
To gracefully stop the running lotus daemon (required when restarting the daemon to update Lotus), use the following command:
lotus daemon stop ## When running with systemd do: # systemctl stop lotus-daemon
For more details on Filecoind nodes checkout the official documentation from Filecoin.