Bitcoin Forum
April 25, 2024, 11:35:59 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: howto share .bitcoin/blocks directory  (Read 2142 times)
Zz (OP)
Legendary
*
Offline Offline

Activity: 1820
Merit: 1077


View Profile
October 23, 2016, 08:40:04 PM
 #1

Hello,
We use the same computer 3 people
3 shell accounts;
user1@kutaypc : /home/user1/.bitcoin
user2@kutaypc : /home/user2/.bitcoin
user3@kutaypc : /home/user1/.bitcoin

we have jointly directory ~/.bitcoin/blocks

our setup :

add bitcoiners group
users add bitcoiners group
mkdir /home/blocks
chown root:bitcoiners /usr/bin/bitcoind
chown root:bitcoiners /usr/bin/bitcoin-qt
ln -fs /home/blocks /root/.bitcoin/blocks
run bitcoind -daemon
control debug.log bitcoind is fine!

and switch user1
echo "listen=0" > /home/user1/.bitcoin/bitcoin.conf

and run second bitcoind at user1 account. works fine.
stop bitcoind
rm -rf /home/user1/.bitcoin/blocks
ln -fs /home/blocks /home/user1/blocks
newgrp bticoiners (switch to bitcoiners group)
and run second bitcoind at user1 account.

program crashed!

any solutions ?
1714044959
Hero Member
*
Offline Offline

Posts: 1714044959

View Profile Personal Message (Offline)

Ignore
1714044959
Reply with quote  #2

1714044959
Report to moderator
1714044959
Hero Member
*
Offline Offline

Posts: 1714044959

View Profile Personal Message (Offline)

Ignore
1714044959
Reply with quote  #2

1714044959
Report to moderator
1714044959
Hero Member
*
Offline Offline

Posts: 1714044959

View Profile Personal Message (Offline)

Ignore
1714044959
Reply with quote  #2

1714044959
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714044959
Hero Member
*
Offline Offline

Posts: 1714044959

View Profile Personal Message (Offline)

Ignore
1714044959
Reply with quote  #2

1714044959
Report to moderator
1714044959
Hero Member
*
Offline Offline

Posts: 1714044959

View Profile Personal Message (Offline)

Ignore
1714044959
Reply with quote  #2

1714044959
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
October 23, 2016, 08:42:06 PM
 #2

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.

Zz (OP)
Legendary
*
Offline Offline

Activity: 1820
Merit: 1077


View Profile
October 23, 2016, 08:46:35 PM
 #3

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.

Well,
exchanges or web wallets are how it works?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
October 23, 2016, 08:48:18 PM
 #4

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.

Well,
exchanges or web wallets are how it works?
They are probably not using Bitcoin Core and are probably using a proprietary system which allows them to have multiple wallets on the same instance of the software. Or they are using Bitcoin Core for purely the P2P part (not the wallet) and using an external wallet software which can interact with Bitcoin Core in order to conduct P2P operations (i.e. sending and receiving transactions).

Zz (OP)
Legendary
*
Offline Offline

Activity: 1820
Merit: 1077


View Profile
October 23, 2016, 09:05:50 PM
 #5

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.

Well,
exchanges or web wallets are how it works?
They are probably not using Bitcoin Core and are probably using a proprietary system which allows them to have multiple wallets on the same instance of the software. Or they are using Bitcoin Core for purely the P2P part (not the wallet) and using an external wallet software which can interact with Bitcoin Core in order to conduct P2P operations (i.e. sending and receiving transactions).

new setup:
create 3 bitcoin adress on one bitcoind (run as root)
works fine but only one rpc user??
I need 3 rpc user?
if I can create 3 rpc users for 3 bitcoin adresses, users runs bitcoin-cli
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
October 23, 2016, 09:09:59 PM
 #6

new setup:
create 3 bitcoin adress on one bitcoind (run as root)
works fine but only one rpc user??
I need 3 rpc user?
if I can create 3 rpc users for 3 bitcoin adresses, users runs bitcoin-cli

You only need one rpc user. However, you should not do this. Bitcoin sent from one address will end up in a change address. Bitcoin Core does not know that the three addresses are meant for three separate users. It thinks that they are all part of the same wallet (because they are) and treat them as such. Thus you will end up with one user accidentally spending the Bitcoin of another user. The only way around this is to use raw transactions and that can be a dangerous if you don't know what you are doing.

DarkStar_
Legendary
*
Offline Offline

Activity: 2758
Merit: 3282


View Profile WWW
October 23, 2016, 09:53:03 PM
 #7

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.
Wouldn't that not be a problem in this case because OP said 3 accounts on the same computer, and to switch accounts, you need to log off, closing all running programs. Bitcoin Core would never be writing at the same time with other instances, so nothing would be corrupted.

taking a break - expect delayed responses
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
October 23, 2016, 09:57:28 PM
 #8

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.
Wouldn't that not be a problem in this case because OP said 3 accounts on the same computer, and to switch accounts, you need to log off, closing all running programs. Bitcoin Core would never be writing at the same time with other instances, so nothing would be corrupted.
They're being run simultaneously from 3 shells.
We use the same computer 3 people
3 shell accounts;

Zz (OP)
Legendary
*
Offline Offline

Activity: 1820
Merit: 1077


View Profile
October 24, 2016, 05:50:41 AM
 #9

Multiple instances of Bitcoin Core on the same computer cannot share the same blocks (or data directory) folder. They will run into simultaneous write issues and corrupt the data on the disk.
Wouldn't that not be a problem in this case because OP said 3 accounts on the same computer, and to switch accounts, you need to log off, closing all running programs. Bitcoin Core would never be writing at the same time with other instances, so nothing would be corrupted.
They're being run simultaneously from 3 shells.
We use the same computer 3 people
3 shell accounts;



yes simultaneously 3 user.
https://www.ncomputing.com/en/products/lseries/overview
this linux Vspace server. (works fine.)


Zz (OP)
Legendary
*
Offline Offline

Activity: 1820
Merit: 1077


View Profile
October 29, 2016, 01:46:47 AM
 #10

Hello All,
I gave up.
I found partial solution
we lost 240GB Sad

write this script :

Code:
#!/bin/bash
#
rsync -avzh /root/.bitcoin --exclude=wallet.dat --exclude=bitcoin.conf /home/user1/.bitcoin
chown user1:user1 -R /home/user1/.bitcoin
#
rsync -avzh /root/.bitcoin --exclude=wallet.dat --exclude=bitcoin.conf /home/user2/.bitcoin
chown user2:user2 -R /home/user1/.bitcoin
#
rsync -avzh /root/.bitcoin --exclude=wallet.dat --exclude=bitcoin.conf /home/user3/.bitcoin
chown user3:user3 -R /home/user1/.bitcoin

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!