Switch networks

This guide will show you how to switch between various Filecoin networks with Lotus, depending on your testing or development needs.

Lotus is compiled to operate on a single network, and the information in the configuration folder corresponds to that network.

  • Local devnet - You can run a local devnet
  • Testnets
    • Calibnet - The calibration network is a testnetwork that mimics the properties of the mainnet. It is planned to be long-running, and will only be reset in case of critical bugs that are uncovered during network upgrade testing.
  • Mainnet

You can choose one of the following methods to switch to a different network on your setup:

Clean, rebuild, reinstall

The first method is the simplest. In this approach, you remove or change the path for the data related to the network you were running on before and launch a Lotus binary built to run on the new one:

  1. Shut down the Lotus daemon if it is currently running.

  2. Remove the ~/.lotus folder, or whatever you set $LOTUS_PATH to. The default is ~/.lotus.

  3. Clone the Lotus repository and move into the lotus folder:

    git clone https://github.com/filecoin-project/lotus
    cd lotus
    
  4. Build the lotus executable using make clean ... to specify which network you want to join:

    NetworkBuild commandDescription
    Mainnetmake clean allThe production Filecoin network. FIL has real-world value on this network.
    Calibnetmake clean calibnetA test network with a minimum sector size of 32 GiB. FIL has no real-world value on this network.
  5. Start the Lotus daemon again and let it sync to the new network:

    lotus daemon
    

Backing up Lotus data

If you wish to backup Lotus data, copy the ~/.lotus (or $LOTUS_PATH) folder somewhere. This will take quite a while if the Lotus node has synced the whole network.

Another alternative is to export your wallets and also export the chain for later re-import on a newly installed Lotus Node.

Edit this page on GitHub