Running 2 nodes on the same machine

+1 vote
As one of the tests in a corporate set up, we are trying to simulate a basic node network on a linux box. The nodes in question are essentially, two user accounts on the same box. First, on the admin node (first server) was initialized with a chain (say, chain1). The resulting node address for chain1 is : xx.xx.xx.xx: 6000. Then, the dependent node (second server) was initialized using the multichaind chain1@nodeaddress command. Successfully, we are able to generate the wallet addresses for the second server. However, after permissions to connect are issues by first server to the second one, when we tried to initialize the second server, we are encountering the following error:

Error: Unable to bind to on this computer. MultiChain Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.

In another attempt, we also tried repeating the process - editing the default-rpc-port in the params.dat file of the second server, as well as manually updating the multichain.conf file at the second node - but all to no avail. Suggestions? How can we ensure that the node-network be created on the same box with two user accounts?
asked Mar 29, 2016 by skarred14
edited Mar 29, 2016 by skarred14

1 Answer

+2 votes

To avoid port clashes you need to run multichaind with the port and rpcport runtime parameters specifying different values for each node running on the same host (or at least different from the defaults for all but one node):

Note also that node auto-discovery doesn't yet work well with multiple nodes at the same IP address but on different ports, so you may need to make use of the addnode and getpeerinfo APIs to manually add peers to each other. We're aware of this issue and a resolution is on the roadmap.

answered Mar 29, 2016 by MultiChain