14

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)

Murch
  • 71,155
  • 33
  • 180
  • 600
  • 1
    Are you sure `bitcoind` is actually running? – Murch Mar 02 '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. –  Mar 02 '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. –  Mar 02 '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 02 '16 at 16:03
  • I am running core, and you may have missed previous comment, but JSON-RPC does work with Core (Qt) on my other computer. Both are running v0.12, although on this one, I may not have installed bitcoind, as I don't believe it is necessary if I am running qt, although I may be wrong and that may be the problem. –  Mar 02 '16 at 16:05
  • Okay, then I don't know. Carry on! – Murch Mar 02 '16 at 16:06
  • 1
    I assume you checked whether your current directory actually contains the bitcoin-cli file and that it's executable? – Jannes Mar 02 '16 at 16:59
  • I checked just now and I don't see one, however I don't see one on my other computer either, and the commands work just fine on that one. What and where is this bitcoin-cli file you speak of? I assumed such a file or functionality would be in place with installation. –  Mar 02 '16 at 20:15
  • Bah, I did a make install to install Bitcoind, and all is good! –  Mar 02 '16 at 21:02
  • Do you use Bitcoin Core GUI version? – MCCCS Aug 11 '16 at 14:59

5 Answers5

9

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!

zero_cool
  • 363
  • 1
  • 3
  • 8
8

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

mayorsanmayor
  • 181
  • 1
  • 2
6

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.

Mark S.
  • 2,680
  • 14
  • 23
3

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

johndpope
  • 131
  • 3
1

Best way to run Bitcoind on Mac

brew install bitcoin

One's installation done

bitcoind start working fine as expected

Brew download bitcoin source directory in following by default

/opt/homebrew/opt/bitcoin

simply run bitcoind --daemon to run the daemon with default configuration after which bitcoin data will be downloaded in :

/Users/user_name/Library/Application Support/Bitcoin

tail -f debug.log ---> check the logs

bitcoin-cli stop ---> stop the daemon

cryptoKTM
  • 544
  • 3
  • 11