24

I'm trying to communicate with the new Bitcoin-Qt -server via a command line on Mac. I run ./Bitcoin-Qt -server, the application starts, but my terminal window is stuck on an empty line (no matter what I type in, there is no response). Only when I quit Bitcoin am I able to run any commands, but then I can't communicate with Bitcoin, because it is already off.

How do I start Bitcoin-Qt -server on Mac and control it through command line?

ThePiachu
  • 42,931
  • 25
  • 138
  • 347

3 Answers3

19

You can start it from the command-line using:

open Bitcoin-Qt.app --args -server

I think the --args option to open is OSX 10.6 and later; if you are running an older OSX put server=1 in your ~/Library/Application Support/Bitcoin/bitcoin.conf file. In fact, to use the -server command you must set a -rpcuser/-rpcpassword, so I'd suggest creating a bitcoin.conf that contains:

server=1
rpcuser=yourname
rpcpassword=...something else

We don't ship a bitcoind for the Mac, but you can use curl (for example) to send commands to the running Bitcoin-Qt:

curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/

The bitcoin source tree also contains python code that uses the free 'jsonrpc' library to communicate with a running Bitcoin-Qt (see contrib/bitrpc/).

Adam Matan
  • 619
  • 7
  • 19
gavinandresen
  • 3,360
  • 21
  • 23
  • Can you set the datadir also as shown here? http://sourceforge.net/projects/bitcoin/files/Bitcoin/testnet-in-a-box/ The example there shows it calling 'bitcoin'. Still a little unclear on how to get testnet-in-a-box up and running on mac. Thanks! – Brian Armstrong Feb 16 '12 at 06:47
3

bitcoind 0.5.x, starting with 0.5.6rc3 and 0.6.x starting with 0.6.3 include a deterministic Mac build. Unfortunately, bitcoind 0.7 does not build with the Mac OS X 10.5 toolchain (which is what I compiled for gitian), so until I manage to make a LLVM-based cross-compiler you'll have to stick to the new Debug window interface and JSON-RPC.

Luke-Jr
  • 1,160
  • 5
  • 10
0

Don't forget to add rpcallowip:

open Bitcoin-Qt.app --args -server=1 -rpcuser=bitcoinrpc -rpcpassword=barfoo -rpcport=8332 -rpcallowip=0.0.0.0/0