MacOS

These instructions are specific to macOS. You can install Lotus on macOS 10.11 El Capitan or higher. If you are installing Lotus on a Linux distribution, head over to the Linux section.

There are several ways to install Lotus on macOS:

Install with Homebrew

You can quickly install Lotus using Homebrew on macOS.

  1. Add the filecoin-project/lotus tap:

    brew tap filecoin-project/lotus
    
  2. Install Lotus:

    brew install lotus
    
  3. You should now have Lotus installed. You can now start the Lotus daemon.

Build from source

You can build the Lotus executables from source by following these steps.

Software dependencies

You must have XCode and Homebrew installed to build Lotus from source.

XCode Command Line Tools

Lotus requires that X-Code CLI tools be installed before building the Lotus binaries.

  1. 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 Lotus' dependencies using Homebrew.

Homebrew

We recommend that macOS users use Homebrew to install each of the necessary packages.

  1. 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 Lotus

The installation instructions are different depending on which CPU is in your Mac:

M1-based CPUs

  1. Clone the repository:

    git clone https://github.com/filecoin-project/lotus.git
    cd lotus/
    
  2. Switch to the latest stable release branch:

    git checkout releases
    

    The releases branch always contains the latest stable release for Lotus. If you want to checkout to a network other than mainnet, take a look at the Switching networks guide →

  3. Create the necessary environment variables to allow Lotus to run on M1 architecture:

    export LIBRARY_PATH=/opt/homebrew/lib
    export FFI_BUILD_FROM_SOURCE=1
    export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
    
  4. Build the lotus daemon:

    make all
    
  5. Run the final make command to move this lotus executable to /usr/local/bin. This allows you to run lotus from any directory.

    sudo make install
    
  6. You should now have Lotus installed. You can now start the Lotus daemon.

Intel CPUs

  1. Clone the repository:

    git clone https://github.com/filecoin-project/lotus.git
    cd lotus/
    
  2. Switch to the latest stable release branch:

    git checkout releases
    

    The releases branch always contains the latest stable release for Lotus. If you want to checkout to a network other than mainnet, take a look at the Switching networks guide →

  3. If you are in China, take a look at some tips for running Lotus in China".

  4. Build and install Lotus:

    make clean && make all
    sudo make install
    
  5. You should now have Lotus installed. You can now start the Lotus daemon.

Start the Lotus daemon and sync the chain

The lotus application runs as a daemon and a client to control and interact with that daemon. A daemon is a long-running program that is usually run in the background.

When using mainnet, we recommend you start the daemon syncing from a trusted state snapshot. In any case, you can start the daemon with the following command:

lotus daemon

During the first run, Lotus will:

  • Set up its data folder at ~/.lotus.
  • Download the necessary proof parameters. This is a few gigabytes of data that is downloaded once.
  • Import the snapshot (if specified) and start syncing the Lotus chain.

The daemon will start producing lots of log messages right away. From this point, you will have to work on a new terminal. Anylotus commands you run now will communicate with the running daemon.

If you used snapshots, subsequent daemon starts can proceed as normal without any options:

lotus daemon

For more information about syncing and snapshots, see the Chain management section.

We recommend waiting until the syncing process has completed, which should be relatively fast when using trusted state snapshot imports:

lotus sync wait

Interact with the daemon

The lotus command allows you to interact with a running Lotus daemon. The lotus-miner and lotus-worker commands work in the same way.

Lotus comes with built-in CLI documentation.

lotus
  - chain: Interact with filecoin blockchain
  - client: Make deals, store data, retrieve data
  - wallet: Manage wallet
  - net: Manage P2P Network
  - sync: Inspect or interact with the chain syncer
  ...

# Show general help
lotus --help
# Show help for the "client" to make deals, store data, retrieve data
lotus client --help

For example, after your Lotus daemon has been running for a few minutes, use lotus sync to check the sync status of your lotus node.

lotus net sync
sync status:
...
    Target: [bafy2bzaceaki6bjhe2lxmtyexcff6vh5y5uw4tmbjr3gatwvh5dhaqqb2ykaa] (320791)
    Stage: complete
    Height: 320791
...

Or use lotus net to check the number of other peers that it is connected to in the Filecoin network.

lotus net peers
12D3KooWSDqWSDNZtpJae15FBGpJLeLmyabUfZmWDWEjqEGtUF8N, [/ip4/58.144.221.27/tcp/33425]
12D3KooWRTQoDUhWVZH9z5u9XmaFDvFw14YkcW7dSBFJ8CuzDHnu, [/ip4/67.212.85.202/tcp/10906]

Or check the current version of your Lotus node as well as network.

lotus version
Daemon:  1.17.1+mainnet+git.8db6a939c+api1.5.0
Local: lotus version 1.17.1+mainnet+git.8db6a939c
# running lotus v1.17.1 on Calibration testnet

Stop the Lotus daemon

To gracefully stop the running lotus daemon (required when restarting the daemon to update Lotus), use the following command:

lotus daemon stop

Edit this page on GitHub