Install Curio
This guide will show how to build, install and update Curio binaries
Linux Build from source
You can build the Curio executables from source by following these steps.
Software dependencies
You will need the following software installed to install and run Curio.
System-specific
Building Curio requires some system dependencies, usually provided by your distribution.
Arch:
sudo pacman -Syu opencl-icd-loader gcc git bzr jq pkg-config opencl-icd-loader opencl-headers opencl-nvidia hwloc
Ubuntu/Debian:
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y
Fedora:
sudo dnf -y install gcc make git bzr jq pkgconfig mesa-libOpenCL mesa-libOpenCL-devel opencl-headers ocl-icd ocl-icd-devel clang llvm wget hwloc hwloc-devel
OpenSUSE:
sudo zypper in gcc git jq make libOpenCL1 opencl-headers ocl-icd-devel clang llvm hwloc && sudo ln -s /usr/lib64/libOpenCL.so.1 /usr/lib64/libOpenCL.so
Amazon Linux 2:
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; sudo yum install -y git gcc bzr jq pkgconfig clang llvm mesa-libGL-devel opencl-headers ocl-icd ocl-icd-devel hwloc-devel
Rustup
Curio needs rustup. The easiest way to install it is:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Go
To build Curio, you need a working installation of Go 1.21.7 or higher:
wget -c https://golang.org/dl/go1.21.7.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
You’ll need to add /usr/local/go/bin
to your path. For most Linux distributions you can run something like:
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc
See the official Golang installation instructions if you get stuck.
System Configuration
Before you proceed with the installation, you should increase the UDP buffer. You can do this by running the following commands:
sudo sysctl -w net.core.rmem_max=2097152
sudo sysctl -w net.core.rmem_default=2097152
Build and install Curio
Once all the dependencies are installed, you can build and install Curio.
Clone the repository:
git clone https://github.com/filecoin-project/lotus.git cd lotus/
Switch to the latest stable release branch:
git checkout master
Depending on your CPU model, you will want to export additional environment variables:
a. If you have an AMD Zen or Intel Ice Lake CPU (or later), enable the use of SHA extensions by adding these two environment variables:
export RUSTFLAGS="-C target-cpu=native -g" export FFI_BUILD_FROM_SOURCE=1
See the Native Filecoin FFI section for more details about this process.
a. Some older Intel and AMD processors without the ADX instruction support may panic with illegal instruction errors. To solve this, add the
CGO_CFLAGS
environment variable:export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__"
a. By default, a ‘multicore-sdr’ option is used in the proofs library. This feature is also used in FFI unless explicitly disabled. To disable building with the ‘multicore-sdr’ dependency, set
FFI_USE_MULTICORE_SDR
to0
:export FFI_USE_MULTICORE_SDR=0
Build and install Curio
Curio is compiled to operate on a single network.
Choose the network you want to join, then run the corresponding command to build the Curio node:
# For Mainnet: make clean build # For Calibration Testnet: make clean calibnet
Install Curio:
sudo make install
This will put
curio
in/usr/local/bin
.curio
will use the$HOME/.curio
folder by default.Run
curio --version
curio version 1.27.0-dev+mainnet+git.78d9d9baa # or curio version 1.27.0-dev+calibnet+git.78d9d9baa
You should now have Curio installed. You can now finish setting up the Curio node.
Native Filecoin FFI
Some newer CPU architectures like AMD’s Zen and Intel’s Ice Lake have support for SHA extensions. Having these extensions enabled significantly speeds up your Curio node. To make full use of your processor’s capabilities, make sure you set the following variables before building from source:
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1
This method of building does not produce portable binaries. Make sure you run the binary on the same computer as you built it.
MacOS Build from source
You can build the Curio executables from source by following these steps.
Software dependencies
You must have XCode and Homebrew installed to build Curio from source.
XCode Command Line Tools
Curio requires that X-Code CLI tools be installed before building the Curio binaries.
Check if you already have the XCode Command Line Tools installed via the CLI, run:
xcode-select -p
This should output something like:
/Library/Developer/CommandLineTools
If this command returns a path, then you have Xcode already installed! You can move on to installing dependencies with Homebrew. If the above command doesn’t return a path, install Xcode:
xcode-select --install
Next up is installing Curio’s dependencies using Homebrew.
Homebrew
We recommend that macOS users use Homebrew to install each of the necessary packages.
Use the command
brew install
to install the following packages:brew install go bzr jq pkg-config hwloc coreutils
Next up is cloning the Lotus repository and building the executables.
Rust
Rustup is an installer for the systems programming language Rust. Run the installer and follow the onscreen prompts. The default installation option should be chosen unless you are familiar with customisation:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Build and install Curio
The installation instructions are different depending on which CPU is in your Mac:
Arm based CPUs
Clone the repository:
git clone https://github.com/filecoin-project/lotus.git cd lotus/
Switch to the latest stable release branch:
git checkout master
Create the necessary environment variables to allow Curio to run on Arm architecture:
export LIBRARY_PATH=/opt/homebrew/lib export FFI_BUILD_FROM_SOURCE=1 export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
Build the
curio
binary:make clean curio
Run the final
make
command to move thiscurio
executable to/usr/local/bin
. This allows you to runcurio
from any directory.sudo make install
Run
curio --version
curio version 1.27.0-dev+mainnet+git.78d9d9baa # or curio version 1.27.0-dev+calibnet+git.78d9d9baa
You should now have Curio installed. You can now set up a new Curio cluster or migrating from Lotus-Miner.
Intel CPUs
Clone the repository:
git clone https://github.com/filecoin-project/lotus.git cd lotus/
Switch to the latest stable release branch:
git checkout master
Build and install Curio:
make clean curio sudo make install
Run
curio --version
curio version 1.27.0-dev+mainnet+git.78d9d9baa # or curio version 1.27.0-dev+calibnet+git.78d9d9baa
You can now finish setting up the Curio node.