1

I'm trying to setup testnet-in-a-box and I'm a little unclear on how you get the command line version working for mac as described here:

http://sourceforge.net/projects/bitcoin/files/Bitcoin/testnet-in-a-box/

I installed macports and ran sudo port install bitcoin so I have a bitcoind executable now.

Instead of

bitcoin -datadir=1 -daemon
bitcoin -datadir=2 -daemon

Do I just use?

bitcoind -datadir=1
bitcoind -datadir=2

Also, since there are two nodes do they have to run on different ports? Thanks

1 Answer 1

2

Yes, run bitcoind instead of bitcoin.

If bitcoind isn't working, but bitcoin-qt is working, then do this instead:

bitcoin-qt -server -datadir=1
bitcoin-qt -server -datadir=2

This will only work if you run the commands from inside the testnet-box folder. Alternatively specify full path names to the 1 and 2 folders: datadir=/home/chris/testnet-box/1 etc.

You need to download the testnet-box.zip file and extract it. That will make you the two folders 1 and 2. Both folders have testnet blockchain files, a wallet, and a bitcoin.conf.

Folder 1's bitcoin.conf says:

rpcpassword=123   # Set this yourself.
noirc=1
testnet=1

so it will run a testnet instance, not connect to IRC, and set the password to '123' for RPC connections.

Folder 2's bitcoin.conf says:

rpcpassword=123   # Set this yourself.
noirc=1
testnet=1
rpcport=19332
nolisten=1
connect=127.0.0.1:18333

which is the same as the other except that it listens for RPC connections on a different port, doesn't listen for incoming P2P connections at all, and only connects to the other instance.

There shouldn't be a port conflict. The first will be listening on port 8332 for RPC connections and port 18333 for P2P connections. The second will be listening on port 19332 for RPC connections, and not listening for P2P connections at all.

Note: if you're running the 0.6.0 release candidate, the nolisten=1 in node 2's bitcoin.conf won't work. You'll need to change it to listen=0 due to a bug I found and reported while researching this answer.

3
  • this is awesome, thanks for the response! btw, I think I spoke too soon on the sudo port install bitcoin it seemed to fail, output here gist.github.com/debb28925f72f99b3f1f Is there a similar way to accomplish this with Bitcoin-Qt? Feb 17, 2012 at 3:36
  • I updated my answer with bitcoin-qt commands, and also mentioned that you need to be in the folder which contains the '1' and '2' folders. Note that I've never used OS/X, and am just assuming that things work the same there as on Linux. Feb 17, 2012 at 4:28
  • Ok great - yep I think this would work. I actually tried it by downloading a previous (0.3.24) version of bitcoin for mac which had the bitcoin command, and it worked great. From Gavin's post her it sounds like the command line args might be slightly different for Bitcoin-QT but I will give this a try tomorrow. Either way thanks for the help I really appreciate it! Feb 17, 2012 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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