Author

Topic: file location after bitcoin-core installation (Read 213 times)

hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
I'm not yet decided if I'm going to like or hate snap. When you run into such a weird trouble like I did with Core v23 installed via snap, it's a pain in the ass for sure. I used Ubuntu for a long time but know I'm somewhat torn apart as Ubuntu really focusses on Snap a lot. Still trying to figure out what exactly Snap tries to make better than other packaging variants.

Snap packagers/distributors should know what they're doing.  Grin      Yes, I know, I'm dreaming of unicorns puking rainbows. Roll Eyes
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Was it a connection issue, or a data directory issue? I just started running a few nodes on Ubuntu via Snap and all was okay. Did the logs say anything?

No, the issue was that Bitcoin Core v23 in my case couldn't read Tor's cookie file as the Snap's system file interface for the Snap package of Core v23 was apparently broken or incomplete. Back then I opened this packaging issue on Github snap: tor's cookie file not visible for Bitcoin Core #159. It might have been fixed, not sure though, as I abandoned to use the snap package of Core.

Unfortunately I didn't find the time to dig deeper into Snap and fix the issue myself and provide a patch.

I don't like using snap packages in general as they tend to have all sorts of random permissions issues if the distributor is not careful packaging it.

Generally I would just stick to using the standalone binaries of Bitcoin Core, or if you *really* have to partition the binaries somewhere else, then by installing it on a custom path. Like /opt/bitcoin or something like that.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
Was it a connection issue, or a data directory issue? I just started running a few nodes on Ubuntu via Snap and all was okay. Did the logs say anything?

No, the issue was that Bitcoin Core v23 in my case couldn't read Tor's cookie file as the Snap's system file interface for the Snap package of Core v23 was apparently broken or incomplete. Back then I opened this packaging issue on Github snap: tor's cookie file not visible for Bitcoin Core #159. It might have been fixed, not sure though, as I abandoned to use the snap package of Core.

Unfortunately I didn't find the time to dig deeper into Snap and fix the issue myself and provide a patch.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
I had various issues with the Snap package of Bitcoin Core in my Ubuntu LTS 22.04.x, particularly it didn't work properly with Tor installed and running. I think it was when Bitcoin Core 23 or 24 was the current version. I could pinpoint the issue that the snap package wasn't configured properly but I lacked the knowledge to fix this Snap quirk.

Maybe the current Snap package is fine, but back then I simply installed Bitcoin Core from the tarball and all was fine and working smoothly.
Was it a connection issue, or a data directory issue? I just started running a few nodes on Ubuntu via Snap and all was okay. Did the logs say anything?


@OP


Snap configures everything for you and you just need to run the app. If not, then you just have to navigate to the snap/bin folder and execute it. A default data dir will be in ~/snap/bitcoin-core/common/.bitcoin
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
I had various issues with the Snap package of Bitcoin Core in my Ubuntu LTS 22.04.x, particularly it didn't work properly with Tor installed and running. I think it was when Bitcoin Core 23 or 24 was the current version. I could pinpoint the issue that the snap package wasn't configured properly but I lacked the knowledge to fix this Snap quirk.

Maybe the current Snap package is fine, but back then I simply installed Bitcoin Core from the tarball and all was fine and working smoothly.
member
Activity: 85
Merit: 25
Makes more sense now.  The snap installation and the installation here:
https://bitcoin.org/en/full-node#linux-instructions
do not have the same result. 
I re-did following the above and using the daemon, works fine. 
member
Activity: 85
Merit: 25
Another note:  I think it is a problem with the original snap installation.  I just went to the Ubuntu Software and clicked on the bitcoin-core.  The process is a bit different from the more manual one specified here:
https://blockgeeks.com/install-bitcoin-core/
which includes this:
Quote
We’ll now use the install command to install the necessary components into the /usr/local/bin directory like so:

sudo install -m 0755 -o root -g root -t /usr/local/bin *

Think this is what I am missing, with check this tomorrow.
member
Activity: 85
Merit: 25
I also found this: https://www.reddit.com/r/Bitcoin/comments/wfhuyy/how_to_setup_bitcoincore_snap_on_ubuntu_2204/ -- the significant quote is:
Quote
I think I may have worked this out. In /snap/bin there is a symlink called bitcoin-core.daemon.

When I run this it creates a directory structure ~/snap/bitcoin-core in the current user account.

Is this something necessary to do during the install to set up the data directories needed for the systemd?:
Code:
Binary:              /usr/bin/bitcoind
Configuration file:  /etc/bitcoin/bitcoin.conf
Data directory:      /var/lib/bitcoind
PID file:            /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart) or
                     /run/bitcoind/bitcoind.pid (systemd)

I did find the reference symlink in /snap/bin

Also from the documentation as referenced the specified directories automatically get created. 
Quote
NOTE: When using the systemd .service file, the creation of the aforementioned directories and the setting of their permissions is automatically handled by systemd. Directories are given a permission of 710, giving the bitcoin group access to files under it if the files themselves give permission to the bitcoin group to do so. This does not allow for the listing of files under the directory.
So to get the systemd service running, I believe I need to know if I can just copy the executable over to /usr/bin/bitcoind or does this need to be a script?
Sorry for question not being too clear, just really beating head against wall on this one Smiley
member
Activity: 85
Merit: 25
There is this line in the bitcoind.service systemd file:

Code:
ExecStart=/usr/bin/bitcoind

As far as I understand it the bitcoind mentioned above is a script, not an executable, correct?   Or should it be an executable?  I tried moving an executable to /usr/bin/bitcoind but get an error 203 when starting the service.

What should end up in /usr/bin/bitcoind and is there on in the install instructions somewhere?

reference:  https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service
member
Activity: 85
Merit: 25

Quote
You don't have to. During the initialization, if Bitcoin Core doesn't detect a data directory then it would prompt the user to specify a data directory. Else, it would automatically create a data directory for you in the default data directory path.
That makes sense, but what about the bitcoin-core executable, wouldn't that need to be there or how would it know what to run?
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
You don't have to. During the initialization, if Bitcoin Core doesn't detect a data directory then it would prompt the user to specify a data directory. Else, it would automatically create a data directory for you in the default data directory path.
member
Activity: 85
Merit: 25
I have installed bitcoin-core on with the following environment:
Bitcoin Client Software and Version Number:  bitcoin-25.0-x86_64-linux-gnu
Operating System: Ubuntu 22.04.4 LTS
System Hardware Specs: Intel(R) Core(TM) i5-3470T CPU @ 2.90GHz 1 physical processor; 2 cores; 4 threads, RAM 7909288 KiB

What I am wondering is about file locations.  There is documentation on running the core as a systemd job in the background which I will be able to set up.  There is also information on various paths assumed in the documentation, such as:



Code:
Binary:              /usr/bin/bitcoind
Configuration file:  /etc/bitcoin/bitcoin.conf
Data directory:      /var/lib/bitcoind
PID file:            /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart) or
                     /run/bitcoind/bitcoind.pid (systemd)

Am I correct in thinking after the install I should manually move the specified files from the current location:
Code:
~/snap/bitcoin-core/common/.bitcoin

to the specified directories?  Or is there a problem with the install that the files were not created there?

Jump to: