Author

Topic: Bitcoin Core and datadir outside the computer? (Read 302 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
September 03, 2021, 04:24:55 AM
#21
I think what you're looking is VNC (similar with RDP for Windows). See https://www.raspberrypi.org/documentation/computers/remote-access.html#vnc.
But, aren't I launching bitcoin-qt from Pi this way? How does that differ from Loyce's solution?

It's true that you're running bitcoin-qt from Pi, but here are the difference
1. DIfferent protocol (SSH vs VNC).
2. VNC share whole desktop, not one application.
3. VNC usually easier to use.

P.S. I missed your reply, so i just answered your question.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
You mean ElectrumX? It can run on my Pi. Is that what you mean? Doesn't it use Core as a data source?
No. Directly. ElectrumX depends on Core, but it is a separate server by itself.
It's not the storage constraints; I could unplug my external hard drive from Pi, plug it to my computer and use it there. The problem is that my computer does not remain open 24/7 while my Pi does. I need this mainly for the lightning network and generally I don't want from my node to ever go offline. Also, running a node from Pi does not use computer's resources that could make it go slower.
If running Bitcoin Core slows your computer down, then you probably have more problems to worry about Tongue. VNC would probably be your only option though, so yeah. 
I think "custom servers" is probably a better description for what ranochigo was trying to say... in that they use their own custom RPC interface that is incompatible with the Bitcoin Core RPC.
That is correct.
Then configure Bitcoin Core on your computer to use the blocks folder on the NFS share. Though, you may run into problems if this folder is being used by two different Bitcoin Core instances at the same time, so you could try mounting it read-only (and to be honest, I don't expect this to work either since you may not be able to make transactions, so perhaps making a simple GUI wrapper around bitcoin-cli is a better option).
Core needs to be able to be able to obtain a lock on the directory so you cannot possibly run it in the first place.
sr. member
Activity: 333
Merit: 506
Aside from the theoretical "yes you can set it up like this" links... has anyone actually personally done this and managed to run a local Bitcoin Core instance that is leveraging the RPC ability of a remote Bitcoin Core "server"? Huh

It isn't possible to use bitcoin-gui as a child.
Bitcoin-gui doesn't use RPC (for the gui), so it wouldn't communicate with a host system no matter what configuration you use. Bitcoind can communicate as a child(slave)/host, but that is gui-less.

Mounting the system in a shared directory between two instances would cause problems, since one would constantly update and the second would not constantly check for those updates. This would likely result in clashes.

The solutions are only:
1) You could VNC in, where it left an instance running and you interacted with that. VNC is painful, but doable. SSH wouldn't work since it doesn't allow attaching/detaching, so requires constant starting and stopping after you've SSH'd in. This tool might work https://github.com/Xpra-org/xpra but I think a VNC should work the same, if not better?
2) This leaves alternative GUIs that communicate with the host that have been posted above. One of the posts above used a child instance of bitcoind that connects to the host bitcoind/bitcoin-gui, and then used armory on that child machine
HCP
legendary
Activity: 2086
Merit: 4361
Aside from the theoretical "yes you can set it up like this" links... has anyone actually personally done this and managed to run a local Bitcoin Core instance that is leveraging the RPC ability of a remote Bitcoin Core "server"? Huh



Electrum runs on proprietary servers, so no. I'm talking about those that are able to use Core as a data source, but I don't think that is what you need?
Bitcoin Core and many Electrum server implementation (such as ElectrumX, EPS and electrs) are open source.
I think "custom servers" is probably a better description for what ranochigo was trying to say... in that they use their own custom RPC interface that is incompatible with the Bitcoin Core RPC.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
If only this is still maintained or if there's a similar program, it would be possible: https://en.bitcoin.it/wiki/Spesmilo
It's something like an alternative GUI, and description said that it "can connect to remote JSON-RPC", just like what you need.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
"Can you connect to a remote bitcoin node instead of a local one #1741"

Those configurations are for lightning, not Bitcoin Core.

Edit: Saw Homer, k.
sr. member
Activity: 333
Merit: 506

https://www.pngwing.com/en/free-png-defqu


"nothing in the GUI generates an RPC call."
*
https://bitcoin.stackexchange.com/questions/7455/how-to-setup-a-lan-network-with-only-one-bitcoind-client-downloading-the-blockch
* means it is impossible to do this with the GUI







Host setup (both bitcoind and bitcoin-gui can be hosts)
"Can you access Bitcoin Core from another computer?"
https://www.reddit.com/r/Bitcoin/comments/2oz9r0/can_you_access_bitcoin_core_from_another_computer/
Quote
Run Bitcoin-qt or bitcoind with server=1 and specify the IP of your client. Per default localhost only . default port is 8332.

https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf
Quote
#bind=  ############################## Can be the IP of PI, for the PI; NOT 127.0.0.1! 192.168.*.* usually. Do not set for sub.
# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
#

# server=1 tells Bitcoin-Qt and bitcoind to accept JSON-RPC commands
server=0    ##############################  Set to 1 for host Pi
//
# server=1 tells Bitcoin-Qt to accept JSON-RPC commands.
# it is also read by bitcoind to determine if RPC should be enabled
#rpcallowip=10.1.1.34/255.255.255.0
#rpcallowip=1.2.3.4/24
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96

Child setup (bitcoind,, NOT GUI....)
https://bitcoin.stackexchange.com/questions/7455/how-to-setup-a-lan-network-with-only-one-bitcoind-client-downloading-the-blockch
Quote
You need to use rpc_connect = ip.of.master.bitcoind on the 'slave' node, and connect = 0.0.0.0 to prevent it from loading the blockchain and you should be all set.




Lightning remote setup
"Can you connect to a remote bitcoin node instead of a local one #1741"
https://github.com/ElementsProject/lightning/issues/1741
Quote
I installed bitcoin-cli by building from source, and then started lightning like this: lightning/lightningd/./lightningd --daemon. The configuration was stored in ~/.lightning/config with the following contents:

    bitcoin-rpcconnect=192.168.1.25
    bitcoin-rpcport=8332
    bitcoin-rpcuser=
    bitcoin-rpcpassword=
    alias=
    network=testnet
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I might be missing something, but can't you just run bitcoin-qt with the -connect switch to only connect to your node on the RPi, and let your other node on the Raspberry Pi handle the details of connecting to other peers?
Whether you use connect or addnode it's the same thing. You still need storage, just like you would with a pruned node. Anyway, I tried it and it seems it doesn't work with txindex=1:

Why don't you try creating an NFS share on your Raspberry Pi and put the blocks folder on it (use some top-level folder like /mnt/something) and add this share to Windows?

Then configure Bitcoin Core on your computer to use the blocks folder on the NFS share. Though, you may run into problems if this folder is being used by two different Bitcoin Core instances at the same time, so you could try mounting it read-only (and to be honest, I don't expect this to work either since you may not be able to make transactions, so perhaps making a simple GUI wrapper around bitcoin-cli is a better option).
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I think what you're looking is VNC (similar with RDP for Windows). See https://www.raspberrypi.org/documentation/computers/remote-access.html#vnc.
But, aren't I launching bitcoin-qt from Pi this way? How does that differ from Loyce's solution?

I might be missing something, but can't you just run bitcoin-qt with the -connect switch to only connect to your node on the RPi, and let your other node on the Raspberry Pi handle the details of connecting to other peers?
Whether you use connect or addnode it's the same thing. You still need storage, just like you would with a pruned node. Anyway, I tried it and it seems it doesn't work with txindex=1:

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I might be missing something, but can't you just run bitcoin-qt with the -connect switch to only connect to your node on the RPi, and let your other node on the Raspberry Pi handle the details of connecting to other peers?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Electrum runs on proprietary servers, so no. I'm talking about those that are able to use Core as a data source, but I don't think that is what you need?
You mean ElectrumX? It can run on my Pi. Is that what you mean? Doesn't it use Core as a data source?

There is nothing that can only be done within GUI, other than the fact that it is nicer and more user-friendly.
Yes, it is exclusively for those reasons. I was sure I couldn't do it somehow, but I'd give it a shot if a user found a strange way. Anyway, now anyone who googles can confirm it and prevent from wasting their time.

If you need the GUI and can only choose between RPi and your own computer (maybe cause of storage constraints?), then I would probably just run it on my own computer.
It's not the storage constraints; I could unplug my external hard drive from Pi, plug it to my computer and use it there. The problem is that my computer does not remain open 24/7 while my Pi does. I need this mainly for the lightning network and generally I don't want from my node to ever go offline. Also, running a node from Pi does not use computer's resources that could make it go slower.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
An SPV client like Electrum?
Electrum runs on proprietary servers, so no. I'm talking about those that are able to use Core as a data source, but I don't think that is what you need?
It doesn't have the same command line interface with Core. What I want is essentially to call the specific Bitcoin Core's commands remotely. I guess that I'll have to stay in bitcoin-cli via LAN.
Then I'm not really sure why the lack of GUI is a big deal. There is nothing that can only be done within GUI, other than the fact that it is nicer and more user-friendly. Most of the more advanced commands are mostly done through the console anyways, so no real need for a GUI.

I've never really thought of something like this, or at least I didn't think about this specific scenario being a problem. Are you unable to run a GUI on your own computer as well? If you need the GUI and can only choose between RPi and your own computer (maybe cause of storage constraints?), then I would probably just run it on my own computer.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Sorry. Meant to say that for all intents and purposes, RPC would be enough. If you need, then use the Bitcoin node as a server and connect an SPV wallet to it. I'm sure it isn't very hard to find any GUIs that relies on the RPC.
An SPV client like Electrum? It doesn't have the same command line interface with Core. What I want is essentially to call the specific Bitcoin Core's commands remotely. I guess that I'll have to stay in bitcoin-cli via LAN.

You might be able to set up a network drive on your RPi and access it from your main computer. I don't know the details. On the other hand, if you are only using the RPi for storage, then an off-the-shelf NAS might be a better option.
Why would I need a network attached storage to launch the GUI? That's what you meant, isn't it? The Pi should done this work by itself.
sr. member
Activity: 333
Merit: 506
Run X Windows programs remotely pretty much by default.


https://mynodebtc.com/
"Simple UI / Web Interface"

1 https://github.com/cryptoadvance/specter-desktop
"The goal of this project is to make a convenient and user-friendly GUI around Bitcoin Core with a focus on multisignature setup with hardware wallets and airgapped devices."


2
Another solution would be to set up a electrum server and enter it as source in your electrum client.

3 "Access the Bitcoin JSON Remote Procedure Call API (bitcoin-cli) in your web browser." https://chainquery.com/

4 https://github.com/esotericnonsense/bitcoind-ncurses


5 https://github.com/wwortel/Bitcoind-Web-User-Interface
https://bitcointalksearch.org/topic/announce-coin-web-ui-for-bitcoin-and-its-forks-67274
"+Coin is a Web Interface built to run on any PHP web server"


6 https://github.com/aceat64/EasyBitcoin-PHP
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
To connect my wallet to my node using RPC? I didn't get that, could you explain further?
Sorry. Meant to say that for all intents and purposes, RPC would be enough. If you need, then use the Bitcoin node as a server and connect an SPV wallet to it. I'm sure it isn't very hard to find any GUIs that relies on the RPC.

A little difficult to type on a phone.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Yes, except for there's no desktop, only Bitcoin Core.
The problem with controlling everything remotely is that you can't run both bitcoin-qt and bitcoind from one device which I want in this case.

As an alternative: you could prune the data directory on your computer, and if you're limited on bandwidth set it up to only synchronize from the RPi.
As an alternative, I think that I should just search for a remote implementation of a Bitcoin node in which I just type my RPC commands and the “server” returns the messages.

I think it's more convenient to use a RPC connect another wallet to your node.
To connect my wallet to my node using RPC? I didn't get that, could you explain further?
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Wouldn't that just make it a remote desktop?
Yes, except for there's no desktop, only Bitcoin Core.

Quote
Unless you're talking about sharing data directory
As an alternative: you could prune the data directory on your computer, and if you're limited on bandwidth set it up to only synchronize from the RPi.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Assuming your main computer is running Linux, you can Run X Windows programs remotely pretty much by default.
That means Bitcoin Core and your wallet run on the RPi, but your desktop is used only as GUI.
Wouldn't that just make it a remote desktop? As in the GUI has to be run on the Pi but what this merely does is just to relay the graphical interface between Windows and Pi so you're not really running the GUI on Windows, but still on Pi.

Anyways, I don't think there is a way to do so. Unless you're talking about sharing data directory, for which only one of the two instances can access it at any one time. I think it's more convenient to use a RPC connect another wallet to your node.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Assuming your main computer is running Linux, you can Run X Windows programs remotely pretty much by default.
That means Bitcoin Core and your wallet run on the RPi, but your desktop is used only as GUI.

According to the same link it's possible with PuTTY on Windows too, but I haven't tried that.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I've setup a RPi 4 running a Bitcoin full node headless-ly (via SSH) and I was wondering if I can enjoy the comfort of Bitcoin Core's GUI too.

Both pi and my computer are connected to the same router and communicate via LAN. Is there a way to run bitcoin-qt from my main computer without needing to have the block chain downloaded there, but on pi instead? Could the GUI communicate with my pi's bitcoin-cli to receive the information needed in my main computer instead of using it via SSH?
Jump to: