Bitcoin Forum
April 25, 2024, 02:25:58 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Symbolic link for blockchain on Linux  (Read 2336 times)
kneim (OP)
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


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?

1714055158
Hero Member
*
Offline Offline

Posts: 1714055158

View Profile Personal Message (Offline)

Ignore
1714055158
Reply with quote  #2

1714055158
Report to moderator
1714055158
Hero Member
*
Offline Offline

Posts: 1714055158

View Profile Personal Message (Offline)

Ignore
1714055158
Reply with quote  #2

1714055158
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714055158
Hero Member
*
Offline Offline

Posts: 1714055158

View Profile Personal Message (Offline)

Ignore
1714055158
Reply with quote  #2

1714055158
Report to moderator
1714055158
Hero Member
*
Offline Offline

Posts: 1714055158

View Profile Personal Message (Offline)

Ignore
1714055158
Reply with quote  #2

1714055158
Report to moderator
1714055158
Hero Member
*
Offline Offline

Posts: 1714055158

View Profile Personal Message (Offline)

Ignore
1714055158
Reply with quote  #2

1714055158
Report to moderator
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


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



Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


kneim (OP)
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


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 (OP)
Legendary
*
Offline Offline

Activity: 1666
Merit: 1000


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
Merit: 1011


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
Merit: 0



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: 1358
Merit: 1002



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
Merit: 1011


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: 1072
Merit: 1174


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.

I do Bitcoin stuff.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!