0

running ps yields:

31793 pts/0     11:04:46 bitcoind

but commands like bitcoind getblocktemplate

yields:

bash: bitcoind: command not found...

I've attempted to add the src folder to my global path through the following command:

echo " export PATH=$PATH:/home/jpc/Code/WorkingCopies/bitcoin/src" >> ~/.profile

Thanks for any help.

RedGrittyBrick
  • 26,841
  • 3
  • 25
  • 51
user35061
  • 1
  • 1
  • 2
    It sounds like this is more about basic Unix usage than anything specific to bitcoin. I would change into the directory where bitcoin-cli is located and run ./bitcoin-cli. Changing PATH like you did is probably not really a good idea, but that's a question for http://unix.stackexchange.com instead of here. – Nate Eldredge Nov 13 '18 at 15:43

4 Answers4

3

bitcoind is the server, you can interact with it using the command-line utility bitcoin-cli. For example:

bitcoin-cli getblocktemplate

See this question for more info.

chytrik
  • 18,170
  • 3
  • 19
  • 48
  • using "bitcoin-cli getblocktemplate" still yields "bash: bitcoin-cli: command not found. – user35061 Nov 13 '18 at 11:20
  • How did you start bitcoind ? – Pieter Wuille Nov 13 '18 at 11:51
  • I'm running Fedora. I was following various online guides (most of which were based on Ubuntu). I believe that the command that got it going after compiling was: "bitcoind -daemon" but later in my history I also see "src/bitcoind &" – user35061 Nov 14 '18 at 02:27
0

I think you should recompile from source. Visit the bitcoin github repository for Fedora dependencies, you'll find them in doc/build-unix. Scroll down to Fedora. Decide whether you want bitcoin-qt or just the command line bitcoin-cli, and whether you really need wallet functionality.

Beware you will need a specific version of Berkeley DB for wallet compatibility. You can use the latest Berkeley DB though if you don't need or want that compatibility.

Download the source package from https://bitcoincore.org/en/download/. Go into your new src folder, then run

./autogen.sh
./configure --without-gui    # see doc/build-unix.md, also for deps
make check

sudo make install    # goes into /usr/local/bin, /usr/local/lib, by default

This will likely resolve any issues you have now. You can take the lib paths out of /etc/ld.so.conf and undo changes to your path in ~/.profile.

HTH, let us know how it goes :)

James Young
  • 43
  • 1
  • 6
  • Wow. Thanks for the detailed response. I am trying to put src/.libs path which is "/home/jpc/Code/WorkingCopies/bitcoin/src/.libs" in /etc/ld.so.conf using emacs (file was read only) and also the command: "echo "/home/jpc/Code/WorkingCopies/bitcoin/src/.libs" > /etc/ld.so.conf.d/local.conf (get "bash: /etc/ld.so.conf.d/local.conf: permission denied" I realize this is probably linux 101 type stuff. Trying to get up to speed... – user35061 Nov 14 '18 at 14:20
  • You're welcome. It should be readable and writable by root only, and readable by anyone. Depends on the distribution. So you would need root privileges, or sudo vim or e.g. sudo nano /etc/ld.so.conf and add your /home/jpc/Code/WorkingCopies/bitcoin/src/.libs to it. Save and exit. Run sudo ldconfig. Now assuming your binaries are on your PATH, give it another shot and let us know? It's a bit of a shot in the dark, but it's worth a go. Good luck! – James Young Nov 14 '18 at 15:03
  • That worked, /etc/ld.so.conf now reads: include ld.so.conf.d/*.conf (newline) /home/jpc/Code/WorkingCopies/bitcoin/src/.libs (then ran sudo ldconfig) still getting: bitcoin-cli: command not found... – user35061 Nov 14 '18 at 16:34
  • Still sounds like a PATH issue. Are you using /bin/bash? Try putting PATH="/home/jpc/Code/WorkingCopies/bitcoin/src:$PATH" in your ~/.profile at the end, then run source .profile. Stop any bitcoind you might have running, and try running bitcoind -daemon. Then bitcoin-cli getblockchaininfo and we'll see... Are you sure that's the absolute path to where bitcoind and bitcoin-cli binaries are? Good luck again! – James Young Nov 15 '18 at 02:47
0

commands like bitcoind getblocktemplate

See chytrik's answer - you should use the command-line client bitcoin-cli not the server bitcoind.

I've attempted to add the src folder to my global path

That is generally the wrong thing to do.

  • a src directory should contain source code. It isn't appropriate to have that on your $PATH.
  • start by using the full absolute path, e.g. /home/jpc/Code/WorkingCopies/bitcoin/src/bitcoin-cli getblocktemplate - if that works see below
  • binaries should be installed to somewhere like /usr/local/bin (or your distro's equivalent - see Linux Standard Base). Usually this is done using sudo make install but check instructions for bitcoin. That folder will already be on your $PATH.
  • Unless there's a lot of other binaries in a new folder, it is probably better to add an alias rather than make the shell search through a large folder for every command you type.
RedGrittyBrick
  • 26,841
  • 3
  • 25
  • 51
  • Using the full absolute path might have provided a clue. When I do that with 'getblocktemplate' or 'getblockchaininfo' Fedora my prompt doesn't come back. Have to use ctrl c to exit. I'm happy to start with a fresh install if necessary or keep trouble shooting? Maybe that clue helps? Thank you! – user35061 Nov 14 '18 at 18:13
0

I wasn't able to trouble shoot my original binary build, but I used the suggestion James Young made: Reinstall from the bitcoincore.org website tar image. I used the linux build instructions at:

https://bitcoin.org/en/full-node#other-linux-distributions

I just needed to update the release version in the commands.

Thank you for all the suggestions. I learned a few good things.

user35061
  • 1
  • 1
  • Note: if you download binary files instead of compiling yourself, be sure to check the developer signatures on the .tar files. – chytrik Nov 15 '18 at 02:55