how to run multiple bitcoind node on one server?

0

I have created one full node bitcoind on my VPS, that one is serving application A. Now I want to create application B that has another node but on same VPS. is that possible to install multiple bitcoind on one server using different wallet? let's asume that I want application A connect to wallet.dat, application B to wallet_new.dat, with different bitcoin.conf configuration.

Billy Adelphia

Posted 2018-04-04T07:55:50.260

Reputation: 165

Answers

1

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

prajna

Posted 2018-04-04T07:55:50.260

Reputation: 31

0

All you need to do is update the bitcoin.conf for the second port to point to a different datadir, and use a different RPC port.

Do keep in mind that this will result in double the resource use for everything. Additionally, depending on your VPS, running multiple nodes on a single machine might not be feasible.

Usually, multiple applications should be able to use a single node, and differentiate addresses etc. at an application level.

Raghav Sood

Posted 2018-04-04T07:55:50.260

Reputation: 10 897

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

0

Yes it's possible, you must run each bitcoind in different port and different datadir, take a look here https://en.bitcoin.it/wiki/Running_Bitcoin

ergesto

Posted 2018-04-04T07:55:50.260

Reputation: 36