9

I have a Qt testnet3 node synched and running on my mac. In the terminal, when simply trying:

$ bitcoin-cli getinfo

or

$ ./bitcoin-cli getinfo

I get:

-bash: bitcoin-cli: command not found

Anyone know why the command could or would not be found? (server=1 in bitcoin.conf as well)

  • Are you sure bitcoind is actually running? – Murch Mar 2 '16 at 15:52
  • I'm running Qt, so bitcoind would not be running. Pretty sure I have the necessary configurations in my .conf to run RPC commands. – doffing81 Mar 2 '16 at 15:54
  • I know on my other computer I wasn't able to execute commands until the blockchain was caught up for mainnet, or that is what seemed to happen, but I was hoping I could just run a testnet on this computer, and just have the testnet blockchain... maybe not, or maybe having a blockchain doesn't matter. – doffing81 Mar 2 '16 at 16:02
  • So, here I'm confused about two things. Bitcoin-Qt was renamed Bitcoin Core at least since Bitcoin 0.9.1, we are currently at version 0.12.0. So, hopefully, you are running Bitcoin Core? ;) The other is, I'm not sure that Bitcoin Core provides the JSON-RPC interface, I'm sure that bitcoind (the daemon) does, though. So, you might want to try running bitcoind -daemon instead. I have no clue whether any of this is the same for Mac, though. – Murch Mar 2 '16 at 16:03
  • 1
    I assume you checked whether your current directory actually contains the bitcoin-cli file and that it's executable? – Jannes Mar 2 '16 at 16:59
5

There is a bitcoin-cli available for OSX. I also ran into this issue, and it is because I missed one of the setup steps. Here they are for posterity!

Install Xcode:

$ xcode-select --install

Install Homebrew => https://brew.sh/

Clone the repo:

$ git clone https://github.com/bitcoin/bitcoin.git

Navigate into bitcoin directory, and run the autogen script:

$ cd bitcoin
$ ./autogen.sh

The autogen.sh script creates a set of automatic configuration scripts that will interrogate your system to discover the correct settings and ensure you have all the necessary libraries to compile the code.

Run the configure script:

$ ./configure

This will automatically discover all the necessary libraries and create a customized build script for your system. If all went well, the configure command will end by creating the customized build scripts that will allow us to compile bitcoind.

Compile the bitcoin source:

$ make

Install the executables on your system:

$ sudo make install 

Default install location of bitcoind is /usr/local/bin. Confirm Bitcoin Core is installed:

$ which bitcoind
/usr/local/bin/bitcoind

$ which bitcoin-cli
/usr/local/bin/bitcoin-cli

Full disclosure this information worked for me, and it is from Andreas M. Antonopoulos' Mastering Bitcoin book!

4

There it's no bitcoin-cli built in the dmg file for mac os. (Unless you compile it yourself, nor is there a bitcoind from my understanding) You can execute RPC commands using the built in options under the help -> debug / then click on the console tab in the os x client.

1

this should get you up and running with bitcoind on mac osx https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md

1

It's as simple as running brew install bitcoin assuming you are on macOSX and have brew installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.