6

Since the blockchain is such a large file, I'd like to have more than 1 account on the same computer share it. Is that possible?

RentFree
  • 2,539
  • 2
  • 20
  • 36

1 Answers1

5

The most straightforward way to do this with Bitcoin-Qt/bitcoind (at this moment) is to swap the wallet.dat in your bitcoin data directory when the client is not running.

Another method (if you're on a UNIX-ish OS) is to create multiple data directories, then symbolic link (ln -s) the blocks and chainstate directories (not database) inside your datadirs to a common data dir.

mkdir ~/.bitcoin-alt  # new wallet directory
cd ~/.bitcoin-alt
ln -s ~/.bitcoin/blocks ~/.bitcoin/chainstate .
# launch new wallet
bitcoin-qt -datadir=$HOME/.bitcoin-alt

Then you can leave the wallet.dat alone. When launching you can specify a -datadir based on the wallet that you want to use, and it will share the blockchain dirs.

However even with this solution cannot run two bitcoind/bitcoin-qt instances at the same time sharing the block chain! This is currently not possible and will result in corruption if you try.

laanwj
  • 311
  • 1
  • 6
  • 3
    You can also create hard links on Windows if you're using NTFS. I used one to put my Bitcoin directory on a separate drive. – Julian Goldsmith May 09 '13 at 14:58
  • 2
    You cannot use hardlinks to span drives. You probably meant junctions (symlinks) which will span local drives via reparse points. – adam May 06 '14 at 21:58
  • These days, won't that trigger a lengthy rescan every time you switch between wallets? Does the automatic rescan only go through new blocks created since the last one the wallet witnessed? – rkagerer Oct 15 '16 at 20:08
  • It will have to scan the span of blocks between when the wallet was last used and now. There's only a problem in case the block chain is pruned and doesn't have those blocks anymore, in which case it currently has to redownload from the beginning (this is not a protocol limitation, but re-downloading other ranges of blocks is not implemented as of now). – laanwj Oct 17 '16 at 07:50