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?
-
possible duplicate of Is there a way to change the wallet.dat location without changing the entire data directory?– Stephen GornickCommented May 9, 2013 at 19:49
-
1Not a duplicate: sharing it among different users will present more problems than just moving the directory.– o0'.Commented May 10, 2013 at 15:10
1 Answer
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.
-
3You can also create hard links on Windows if you're using NTFS. I used one to put my Bitcoin directory on a separate drive. Commented May 9, 2013 at 14:58
-
2You cannot use hardlinks to span drives. You probably meant junctions (symlinks) which will span local drives via reparse points.– adamCommented May 6, 2014 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?– rkagererCommented Oct 15, 2016 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).– laanwjCommented Oct 17, 2016 at 7:50