bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

Default to use existing Bitcoin data directory

Open bitjson opened this issue 11 years ago • 6 comments

When the user runs npm install -g bitcore, it would be great if the installer checked for existing bitcoin data directories (in the default locations for the user's OS) and used those. It could fall back to the standard ~/.bitcore/data directory.

bitjson avatar Oct 24 '15 23:10 bitjson

+1

This would be nice for us people running nodes that want to switch over to bitcore.

dabura667 avatar Oct 25 '15 06:10 dabura667

txindex needs to be enabled, so this condition would need to be checked beforehand. Do you think this is common enough to check, and default to?

I think docs explaining the command line option -d with the create command works for that use case (More info: https://bitcore.io/guides/full-node).

braydonf avatar Oct 27 '15 14:10 braydonf

I doubt many users have txindex enabled (being non-default), but I think it's very likely that many users installing Bitcore have a fully-synced instance of Bitcoind.

Would it be possible to use an existing data directory to at least avoid having to download all the blocks again? It may take a few hours to reindex all transactions anyway, but that's probably much better than >24 hour from-scratch sync times and block data being duplicated.

bitjson avatar Oct 27 '15 18:10 bitjson

Yes, adding txindex=1 and reindex=1 and restarting, and then after shutting down remove the reindex=1 from bitcoin.conf, otherwise it will reindex again the next time it's started. I'm not sure on the timespan for reindexing with txindex to know if there are significant advantages.

braydonf avatar Oct 27 '15 18:10 braydonf

closing, won't be relevant on bitcore-node v8 as you will just configure a connection to a node over p2p

DanielRHayes avatar Jun 08 '18 20:06 DanielRHayes

@DanielRHayes can you please add some details? Do you mean this module: https://github.com/bitpay/bitcore-node/blob/master/docs/services/p2p.md? Should I put my bitcoind values there?

caffeinum avatar Jul 29 '18 09:07 caffeinum