Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: SebastianJu on July 15, 2017, 02:13:27 AM



Title: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: SebastianJu on July 15, 2017, 02:13:27 AM
Hello,

I learned it is possible to run a single bitcoin-qt dir with the -wallet option to run multiple wallets with the same block-data.

However, each time running another version it needs reindexing because the datadir contains only the different wallets but all other files are the same files for every wallet.dat.

So it would be more efficient to have a flag that allows to use a datadir for every wallet you have. And a flag to only search for the blockchain in a normal shared directory. That way every installation could have his own settings and rescan wouldn't be needed anymore. However only one wallet could access the blockchain at the same time.

In any case it would be a helpful thing.

Greetings!
Sebastian


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: achow101 on July 15, 2017, 03:23:48 AM
Why are you reindexing after changing wallets? There is no need to reindex as reindexing has nothing to do with wallets.

Anyways, 0.15 will be introducing multiwallet (for at least RPC I think) so you can use that once it is released.


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: SebastianJu on July 17, 2017, 02:38:35 AM
Why are you reindexing after changing wallets? There is no need to reindex as reindexing has nothing to do with wallets.

Anyways, 0.15 will be introducing multiwallet (for at least RPC I think) so you can use that once it is released.

I do not reindex. bitcoin-qt is doing it on it's own.

I have one main qt installation with the full blockchain now. And a couple of other wallet.dat files. The other wallets are started via a shortcut with -datadir and -wallet. Though that means each wallet shares each of the other .dat files in the data-dir. Which leads to reindexing each time one of the other wallets is started.


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: HCP on July 19, 2017, 03:20:00 AM
Are you actually running multiple instances of bitcoin-qt at the same time? or are you just starting up the client with "wallet1"... making transactions... shutting down... starting up client with "wallet2"... making transactions... shutting down... starting up client with "wallet3" etc??


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: SebastianJu on July 20, 2017, 02:40:42 AM
Are you actually running multiple instances of bitcoin-qt at the same time? or are you just starting up the client with "wallet1"... making transactions... shutting down... starting up client with "wallet2"... making transactions... shutting down... starting up client with "wallet3" etc??


Not at the same time. But it might be that I claimed too fast that a full rescan is done every time. On first try of this setup the master synced fully. Then one of the other wallet was started and it took a half hour of rescan. The other wallets took a bit less afterwards. Now each time I start a wallet it takes few time only so I think the problem is not really existing and I wrote too fast.

It looks like this setup works relatively fast. Multiple instances at once is not really needed for me. One at a time is sufficient.


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: HCP on July 20, 2017, 11:49:01 AM
 multiple instances  at the same time would likely cause locking issues with the block data... I doubt you could have multiple instances running off the same datadir at the same time without causing issues and possible data corruption


Title: Re: Better implementation of a way to run multiple instances of bitcoin-qt
Post by: amaclin1 on July 20, 2017, 01:18:30 PM
However, each time running another version it needs reindexing because the datadir
contains only the different wallets but all other files are the same files for every wallet.dat.
AFAIK, the client does not reindexing the blockchain.
It searches in already downloaded blocks transactions related to the current wallet.dat

multiple instances  at the same time would likely cause locking issues with the block data...
...only if programmers are dumb

there is no significant problems to handle several wallet.dat databases for one blockchain
of course, it is difficult to rewrite current ass-written code.
and i do not see big reasons to do it