We can run 2 bitcoind nodes on a single server without installing it multiple times.
We just have to create 2 data directory with a different configuration file (bitcoin.conf) for the 2 nodes. This configuration file should have different port numbers, user name and password specified.
Node1:
bitcoind -regtest -datadir=./bitcoinNode1/ -conf=./bitcoinNode1/bitcoin.conf -rpcport=19001 -port=19000
Node2:
bitcoind -regtest -datadir=./bitcoinNode2/ -conf=./bitcoinNode2/bitcoin.conf -rpcport=19011 -port=19010
You can also make the 2 nodes to connect each other by specifying the connect command while starting node2 as mentioned below.
bitcoind -regtest -datadir=./bitcoinNode2/ -conf=./bitcoinNode2/bitcoin.conf -rpcport=19011 -port=19010 -listen=0 -connect=127.0.0.1:19000
how about wallet ? how to point that port a (e.g 8331) is for wallet a, and port b (e.g 8332) is for wallet b ? The point is I just want using different wallet for different app, in case something bad happed to one wallet doesn't affect another app .. – Billy Adelphia – 2018-04-04T08:31:16.967
The wallet is controlled via the rpc, so simply changing the rpc port is enough. Changing the datadir ensures the second node will use a separate wallet file. – Raghav Sood – 2018-04-04T08:37:39.040