Running two nodes on one device

If you want to run two nodes in dev mode on the same computer, you'll need two special CLI options to make it work.

This is because each process that you use to run an app requires two ports. If each instance of the app is running on the same two ports, then they will fail to communicate with one another. There is a port for the web server, and there is a port for the DHT process that gossips with other nodes. We need to adjust both ports.

Run the two following commands, in two separate terminals.
For the first node, we can just rely on the default ports (4141 for web server, and 6283 for DHT). So run:
hcdev web
For the second node, we want to change the agentID as well, so that Holochain perceives this instance as a separate user. We use port 6284 for the DHT port, and 4142 for the web server.
hcdev --agentID=anystring --DHTport=6284 web 4142