Instructions for starting 2 nodes on one computer

#1

Until libp2p adds the ability to self dial (https://github.com/filecoin-project/go-filecoin/issues/1917, https://github.com/libp2p/go-libp2p/issues/328) you will need to start 2 different nodes (client and miner) to send data to yourself for mining. There does not yet exist a guide to starting two nodes on a single device.

The easiest way is to

  1. setup the first node as normal
  2. open up a new shell and set the FIL_PATH env var to a blank directory, ex: ~/.filecoin2
  3. in the same shell set the FIL_API env var to a localhost multiaddr ending in an unused port, ex: /ip4/127.0.0.1/tcp/3453
  4. now run init, daemon etc from the shell

You can also do this by specifying an api port with --cmdapiaddr and a repo with --repodir for every command, but this gets more tedious

1 Like