Bitcoin Forum
December 10, 2016, 01:24:19 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Symbolic link for blockchain on Linux  (Read 1994 times)
kneim
Legendary
*
Offline Offline

Activity: 1498


View Profile
June 13, 2012, 07:31:27 PM
 #1

I try to install an offline-wallet (bitcoin-qt version 0.6.2) on an Ubuntu Linux (version 12.04) system. All that runs very well. I have made several normal accounts, to my use and for friends or relations.

For reducing overhead and blockchain syncronisation time I tried to symbolic link the blockchain files (blk0001.dat, blkindex.dat) to a central common file (rw for all, of course). But this seems not to work.

As I understood, I can copy an arbitrary valid blockchain into the client files, and that should work. But instead only one of the many linked clients work correctly (I only start one client at a time, of course), and all others pop up the message:

A fatal error occured. Bitcoin can no longer continue savely and will quit.
EXCEPTION: 11DbException
Db::open The argument is invalid
bitcoin in Runaway exception

How did I think wrong?

1481333060
Hero Member
*
Offline Offline

Posts: 1481333060

View Profile Personal Message (Offline)

Ignore
1481333060
Reply with quote  #2

1481333060
Report to moderator
1481333060
Hero Member
*
Offline Offline

Posts: 1481333060

View Profile Personal Message (Offline)

Ignore
1481333060
Reply with quote  #2

1481333060
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481333060
Hero Member
*
Offline Offline

Posts: 1481333060

View Profile Personal Message (Offline)

Ignore
1481333060
Reply with quote  #2

1481333060
Report to moderator
1481333060
Hero Member
*
Offline Offline

Posts: 1481333060

View Profile Personal Message (Offline)

Ignore
1481333060
Reply with quote  #2

1481333060
Report to moderator
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2002



View Profile
June 13, 2012, 09:31:24 PM
 #2

But instead only one of the many linked clients work correctly (I only start one client at a time, of course), and all others pop up the message:

[...]

How did I think wrong?

Bitcoin.org client database files are BDB.  They are not multi-user.  They can only be accessed by one client at a time.

If you simply want separate wallets, then you can use a symlink to each wallet.dat, and just launch the client each time to access a specific wallet.

If you instead want multiple clients against a single bitcoind, that can be handled through RPC.  But that just gives access to one wallet.

If you want simultaneous access to multiple wallets with a single blockchain, the bitcoin.org client doesn't support that.  It does appear that both Armory and Multibit do however:
 - http://dre.tx0.org/compare.htm



kneim
Legendary
*
Offline Offline

Activity: 1498


View Profile
June 13, 2012, 10:04:21 PM
 #3

Creating multiple wallets with symbolic links seems to obfuscating to me, try Armory now. Thanks for the hint. Will tell here if it solves my problem.

kneim
Legendary
*
Offline Offline

Activity: 1498


View Profile
June 20, 2012, 09:18:49 PM
 #4

I've tried Armory, and it works fine. But there is too much overhead for me, I need the simplest possible way, that my girlfriend or related can recover BTC without hassle. So I stay with several bitcoin-qt clients and several block chains. Thank you.

maaku
Legendary
*
expert
Offline Offline

Activity: 905


View Profile
June 20, 2012, 09:27:17 PM
 #5

Have you tried a hard-link (remove the '-s' from 'ln')? Also, make sure the client is configured to disconnect the database on shutdown (this is no longer the default behavior).

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
tevirk
Newbie
*
Offline Offline

Activity: 15



View Profile
June 21, 2012, 06:20:41 AM
 #6

I don't think hard links would work either: the problem is that both processes will think they "own" the block data and try to keep updating it, and be confused and surprised when changes are made that aren't made by it.

I have read that developers are currently working on separating out the blockchain maintenance from the wallet. There is no fundamental reason why you shouldn't be able to run multiple bitcoin clients which share one blockchain, either on one machine or a local network, but the code doesn't yet support it.

I think it's really important, and I would be working on it myself, but, as I said, the developers are working towards it, so I'm still trying to catch up.
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1442



View Profile
June 21, 2012, 07:37:27 AM
 #7

Have you tried a hard-link (remove the '-s' from 'ln')? Also, make sure the client is configured to disconnect the database on shutdown (this is no longer the default behavior).

Why don't you run your own STRATUM server and use the Electrum client to access it?
That way you'll only need 1 blockchain and everyone will use their own wallets. And you won't have the problem of trusting someone elses STRATUM server.

BTW, I don't know how easy it is to setup one of those servers, it just seems a possible solution to your problem Wink

maaku
Legendary
*
expert
Offline Offline

Activity: 905


View Profile
June 21, 2012, 08:29:52 AM
 #8

@kneim, I saw similar issue pop up elsewhere. Almost guarantee that running with '-detachdb' will solve the issue.

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1036


View Profile WWW
June 21, 2012, 10:10:26 AM
 #9

There is no problem in sharing the blockchain between several datadirs, as long as you don't run multiple clients on them simultaneously.

You need to symlink blkindex.dat, blk0001.dat and the database/ subdirectory to the common location. Also, if you do not shutdown cleanly when running from datadir A, you'll need to first run from datadir A again and shutdown cleanly, before starting from any other datadir.

-detachdb is only necessary if you do symlink the database/ dir to both locations.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!