<p>Just wait for the next Bitcoin Core release. They've already implemented <code>-walletdir</code>: <a href="https://github.com/bitcoin/bitcoin/commit/0530ba0eae147563921b162ed05347234d8b53c0" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/commit/0530ba0eae147563921b162ed05347234d8b53c0</a></p>

<p><a href="https://github.com/bitcoin/bitcoin/pull/11466" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/pull/11466</a></p>

CC BY-SA 3.0
2017-12-15T17:24:15.460Z
+1 for sharing this information. Could you please provide me suggestion based on the comment i have posted in question.
Ajit Soman
CC BY-SA 3.0
2017-12-16T06:06:09.293Z
@AjitSoman Are you on Windows? You'll need to follow this steps if you're on Windows 10: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#installing-windows-subsystem-for-linux and continue with https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux or you can just install a Linux VM and do the instructions on the second document.
MCCCS
CC BY-SA 3.0
2017-12-16T06:16:34.137Z
I have found solution for my problem. You can read comments on question
Ajit Soman
CC BY-SA 3.0
2017-12-15T16:03:54.563Z
2017-12-15T16:03:54.563Z
MCCCS
<p><strong>Note</strong> this is not duplicate of <a href="https://bitcoin.stackexchange.com/questions/3449/is-there-a-way-to-change-the-wallet-dat-location-without-changing-the-entire-dat">Is there a way to change the wallet.dat location without changing the entire data directory?</a> </p>

<p>I want to change <code>wallet.dat</code> file location. From the above link it seems to be impossible. But is there any way i can update wallet file location in bitcoin source code <a href="https://github.com/bitcoin/bitcoin" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin</a> and run <code>make</code> command to make it executable. Here is the reason why i want to do this:
<a href="https://serverfault.com/questions/888293/share-a-file-between-aws-servers">https://serverfault.com/questions/888293/share-a-file-between-aws-servers</a></p>

<p>I want to share a common wallet.dat file between two server.  </p>

CC BY-SA 3.0
2017-12-15T14:20:16.783Z
You should not share a wallet.dat file between two servers. It may not even work and may result in wallet corruption and loss of funds. If you are planning on having the two instances open the same wallet file, that is not allowed. BDB (the database system used by Bitcoin Core) does not allow a database to be opened by multiple software simultaneously. If you are somehow able to do so, you can corrupt your wallet.
Ava Chow
CC BY-SA 3.0
2017-12-15T14:20:50.753Z
Furthermore, even if the wallet file is not accessed simultaneously, the two nodes will have different sync states which will result in the software being confused and potentially have to rescan every time you start up one of the nodes. It may also have other issues.
Ava Chow
CC BY-SA 3.0
2017-12-15T17:22:49.947Z
@AndrewChow Thanks for your comment. What about if i run bitcoin core in server 1 and access server 1's bitcore core in server 2 to run get balance and sendToAddress method. will this create any consistency issue.
I am using amazon load balancer under this i have these two server. If user make request simultaneously will there is any chance of consistency issue. 

Is there is any synchronization mechanism implemented in bitcore core to handle situation like this.
Ajit Soman
CC BY-SA 3.0
2017-12-15T17:39:50.813Z
If by "access server 1's bitcoin core in server 2" you mean that you want are going to send RPC requests to server 1 from server 2, then no, there will be no problem with that.
Ava Chow
CC BY-SA 3.0
2017-12-15T17:47:14.550Z
I am creating a application using library specified in this link:https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Java. libraray class takes parameter RPC host,password,url and port . in server 1 i access these parameter via localhost in server 2 i will access it via ip of server 1. This will not corrupt wallet since i am running bitcoin core in one server.
Ajit Soman
CC BY-SA 3.0
2017-12-15T19:11:52.630Z
Yes, that is correct.
Ava Chow
CC BY-SA 3.0
2017-12-16T05:14:13.417Z
@AndrewChow This will be my last question. If i do load testing on these two server with 1 Million user (using Jmeter) . Will the API calls executed by each user will run in thread safe manner i.e one command at a time. Is there is any affect on `move` and `sendfrom` command. Is there is any chance of transaction failure
Ajit Soman
CC BY-SA 3.0
2017-12-16T05:37:28.313Z
It should be able to handle all of that in a thread safe manner as Bitcoind has locking mechanisms to ensure consistency with concurrent operations. However note that with that many RPC calls, bitcoind may not respond to all of them in a timely manner (some may timeout because locks are held by an operation elsewhere).
Ava Chow
<bitcoin-core><bitcoind><bitcoin-cli>
Share a common wallet.dat file between two servers
Ajit Soman
# Share a common wallet.dat file between two servers

(Asked by: username_0 on 2017-12-15)

**Note** this is not duplicate of [Is there a way to change the wallet.dat location without changing the entire data directory?](https://bitcoin.stackexchange.com/questions/3449/is-there-a-way-to-change-the-wallet-dat-location-without-changing-the-entire-dat)

I want to change `wallet.dat` file location. From the above link it seems to be impossible. But is there any way i can update wallet file location in bitcoin source code <https://github.com/bitcoin/bitcoin> and run `make` command to make it executable. Here is the reason why i want to do this:
<https://serverfault.com/questions/888293/share-a-file-between-aws-servers>

I want to share a common wallet.dat file between two server.

**Tags:** bitcoin-core, bitcoind, bitcoin-cli

> **Comments:**
> **username_1**: You should not share a wallet.dat file between two servers. It may not even work and may result in wallet corruption and loss of funds. If you are planning on having the two instances open the same wallet file, that is not allowed. BDB (the database system used by Bitcoin Core) does not allow a database to be opened by multiple software simultaneously. If you are somehow able to do so, you can corrupt your wallet.  
> **username_1**: Furthermore, even if the wallet file is not accessed simultaneously, the two nodes will have different sync states which will result in the software being confused and potentially have to rescan every time you start up one of the nodes. It may also have other issues.  
> **username_0**: @AndrewChow Thanks for your comment. What about if i run bitcoin core in server 1 and access server 1's bitcore core in server 2 to run get balance and sendToAddress method. will this create any consistency issue. I am using amazon load balancer under this i have these two server. If user make request simultaneously will there is any chance of consistency issue.   Is there is any synchronization mechanism implemented in bitcore core to handle situation like this.  
> **username_1**: If by "access server 1's bitcoin core in server 2" you mean that you want are going to send RPC requests to server 1 from server 2, then no, there will be no problem with that.  
> **username_0**: I am creating a application using library specified in this link:https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Java. libraray class takes parameter RPC host,password,url and port . in server 1 i access these parameter via localhost in server 2 i will access it via ip of server 1. This will not corrupt wallet since i am running bitcoin core in one server.  
> **username_1**: Yes, that is correct.  
> **username_0**: @AndrewChow This will be my last question. If i do load testing on these two server with 1 Million user (using Jmeter) . Will the API calls executed by each user will run in thread safe manner i.e one command at a time. Is there is any affect on `move` and `sendfrom` command. Is there is any chance of transaction failure  
> **username_1**: It should be able to handle all of that in a thread safe manner as Bitcoind has locking mechanisms to ensure consistency with concurrent operations. However note that with that many RPC calls, bitcoind may not respond to all of them in a timely manner (some may timeout because locks are held by an operation elsewhere).  

---

## 1 answers

### Answer by username_2 on 2017-12-15. Score: 1

Just wait for the next Bitcoin Core release. They've already implemented `-walletdir`: <https://github.com/bitcoin/bitcoin/commit/0530ba0eae147563921b162ed05347234d8b53c0>

<https://github.com/bitcoin/bitcoin/pull/11466>

> **Comments:**
> **username_0**: +1 for sharing this information. Could you please provide me suggestion based on the comment i have posted in question.  
> **username_2**: @username_0 Are you on Windows? You'll need to follow this steps if you're on Windows 10: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#installing-windows-subsystem-for-linux and continue with https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux or you can just install a Linux VM and do the instructions on the second document.  
> **username_0**: I have found solution for my problem. You can read comments on question  

---

