Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Redrose on August 17, 2019, 02:41:27 PM



Title: Running two instances of Bitcoin Core on the same computer
Post by: Redrose on August 17, 2019, 02:41:27 PM
Hello,

I would like to run at the same two Bitcoin Core instances.

I had in the idea to store both of them in a two separated folders located directly in the C:// directory.
This for both ease of clarity and portability.
I say portability because I would like to host both the executable file in this folder and the blockchain data, as well as the wallet and the configuration files.

I first created two folders in in the C:// directory : "Bitcoin" and "Bitcoin 2".

I launched BitcoinCore.exe and it asked me where I want to install Bitcoin. I chose the "Bitcoin" folder.
I launched and quitted immediately.

I moved Bitcoin to somewhere else so that when I launch a second time BitcoinCore.exe it asks me a second time where I want to install it.
This time I chose "Bitcoin 2" and quitted again.

I moved back "Bitcoin" to the C:// directory.

I now have "Bitcoin" and "Bitcoin 2" both with a .exe, a wallet.dat in it, and the very very beginning of the chain downloaded too.

Problem is that when I started bitcoin-qt.exe from "Bitcoin", it loaded the "Bitcoin 2" files.
I know this because I looked to the "Information" tab.

What to do to be able to have two Bitcoin Core instances running at the same time, each having its own folder with anything needed in it?

Any help would be greatly appreciated!


Title: Re: Running two instances of Bitcoin Core on the same computer
Post by: Redrose on August 17, 2019, 03:18:15 PM
I found the solution, here it is:

I had to create a shortcut, and add in the "Target" field the following: -datadir=C:\Bitcoin, for the "Bitcoin" and -datadir=C:\Bitcoin 2 for the "Bitcoin 2" installation.

I had in fact read about this command, but at first I tried in the debug console, which did not work. I tried the above solution and it worked.



Title: Re: Running two instances of Bitcoin Core on the same computer
Post by: bartekjagoda on August 17, 2019, 05:54:06 PM
I found the solution, here it is:

I had to create a shortcut, and add in the "Target" field the following: -datadir=C:\Bitcoin, for the "Bitcoin" and -datadir=C:\Bitcoin 2 for the "Bitcoin 2" installation.

I had in fact read about this command, but at first I tried in the debug console, which did not work. I tried the above solution and it worked.



Another solution is to run two different versions of bitcoin core.



Title: Re: Running two instances of Bitcoin Core on the same computer
Post by: Waukeenio on August 17, 2019, 09:01:01 PM
Can install multiple operating systems, virtual machines to achieve.
This can effectively separate the data and facilitate debugging in various environments.


Title: Re: Running two instances of Bitcoin Core on the same computer
Post by: joblo on August 24, 2019, 08:32:12 PM
Run as different users, that will automatically choose unique datadirs.

Running different versions won't do it, both will use the same datadir by default.



Title: Re: Running two instances of Bitcoin Core on the same computer
Post by: pereira4 on August 27, 2019, 01:43:27 AM
Glad to see you already solve your problem, but why would you need to run 2 instance of Bitcoin Core at same time?
I don't see any benefit from it and you need extra costs to store 2 copy of exactly same files (unless you run mainnet and testnet node).

You don't need to do anything in terms of custom args (-datadir=C:) to run testnet, when you run the custom binaries it automatically separates the testnet blockchain on it's own folder.

Honestly the only use ever I did from from -datadir=C: was if im not mistaken, when I wanted to access a fork of Bitcoin, because idiot devs decided to overwrite Core's with their client. Probably must have been Vercoin or some shit along the lines.