Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ForgottenPassword on January 10, 2015, 03:18:08 PM



Title: Bitcoin Core in multi user environment
Post by: ForgottenPassword on January 10, 2015, 03:18:08 PM
On linux, Bitcoin Core stores the blockchain and wallet files in the users home folder (~/.bitcoin). This is bad because if you have multiple users using Bitcoin Core, you'll have a copy of the blockchain in each users home folder, when you only need 1 copy.

I'd like to store the blockchain outside of the home folders, but keep the wallet files inside the home folders. What is the best way to do this?


Title: Re: Bitcoin Core in multi user environment
Post by: BCwinning on January 10, 2015, 03:19:36 PM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.


Title: Re: Bitcoin Core in multi user environment
Post by: dserrano5 on January 10, 2015, 04:11:13 PM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.

Then several instances of BC will try to write to the same files at the same time.

I don't think there's a straightforward solution to this.


Title: Re: Bitcoin Core in multi user environment
Post by: BCwinning on January 10, 2015, 04:51:13 PM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.

Then several instances of BC will try to write to the same files at the same time.

I don't think there's a straightforward solution to this.
I would think there would be some kind of file lock
to prevent this from happening though. Plus I assumed it's just a home pc with multiple users but only one accessing the machine at any given time.


Title: Re: Bitcoin Core in multi user environment
Post by: BookLover on January 10, 2015, 05:14:34 PM
You can use -datadir=<dir>.  See:https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments)


Title: Re: Bitcoin Core in multi user environment
Post by: ForgottenPassword on January 10, 2015, 05:18:33 PM
You can use -datadir=<dir>.  See:https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments)

This doesn't let you store the wallets in the home folders, and the -wallet argument seems to only let you specify wallets inside the data dir.


Title: Re: Bitcoin Core in multi user environment
Post by: shorena on January 10, 2015, 05:25:09 PM
You can use -datadir=<dir>.  See:https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments)

This doesn't let you store the wallets in the home folders, and the -wallet argument seems to only let you specify wallets inside the data dir.

In a multi machine environment you could use a single machine running bitcoin core and the others connecting to it using mSIGNA[1].


[1] https://ciphrex.com/products/


Title: Re: Bitcoin Core in multi user environment
Post by: R2D221 on January 11, 2015, 06:20:09 AM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.

Then several instances of BC will try to write to the same files at the same time.

I don't think there's a straightforward solution to this.

Depends on what you mean with “multi user environment”. If it's a desktop or laptop shared by a family, it's impossible that two people are using it at the same time. Switching accounts may leave programs open, but (as far as I know) they get suspended and should not conflict with others. If it's a server (maybe like an online wallet), then definitely many people can use it, but in that case you should have a single program (other than Bitcoin Core) managing all accounts.


Title: Re: Bitcoin Core in multi user environment
Post by: cr1776 on January 11, 2015, 11:37:44 AM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.

Then several instances of BC will try to write to the same files at the same time.

I don't think there's a straightforward solution to this.

Depends on what you mean with “multi user environment”. If it's a desktop or laptop shared by a family, it's impossible that two people are using it at the same time. Switching accounts may leave programs open, but (as far as I know) they get suspended and should not conflict with others. If it's a server (maybe like an online wallet), then definitely many people can use it, but in that case you should have a single program (other than Bitcoin Core) managing all accounts.

It depends on the OS and settings. In a Unix based multiuser environment (eg OS X) nothing get suspended. Likewise you can have two people using the machine via screen sharing for example.

:-)



Title: Re: Bitcoin Core in multi user environment
Post by: btchris on January 12, 2015, 05:53:25 PM
You could and I don't know for sure but I'd start with trying symbolic links from the ~/home to the public folder you want to use.

Then several instances of BC will try to write to the same files at the same time.

I don't think there's a straightforward solution to this.

Depends on what you mean with “multi user environment”. If it's a desktop or laptop shared by a family, it's impossible that two people are using it at the same time. Switching accounts may leave programs open, but (as far as I know) they get suspended and should not conflict with others. If it's a server (maybe like an online wallet), then definitely many people can use it, but in that case you should have a single program (other than Bitcoin Core) managing all accounts.

It depends on the OS and settings. In a Unix based multiuser environment (eg OS X) nothing get suspended. Likewise you can have two people using the machine via screen sharing for example.

:-)

Likewise on Windows -- if you lock your account either explicitly (shortcut: windows-L) or implicitly (starting a Remote Desktop session with user #2 while user #1 is logged in), all programs will remain running in the background (except Win8 Metro-style apps, but that's irrelevant). I think shorena's option of running a single Bitcoin Core instance w/o a wallet and then configuring mSIGNA or Multibit clients to connect to localhost is probably the best option.