I haven't tried this in a while. We have something better now anyway. Grab git master, build it (or wait for the next Bitcoin release) and then run it with the -regtest flag:
./bitcoind -regtest &
Now connect a client to it on port 18444 and run:
./bitcoind -regtest setgenerate true
You just got a block, immediately. Run that command again to get a block whenever you want one. Regtest mode has difficulty set to (effectively) zero, so you can mine blocks in about 300 msec on a regular CPU.
Your software has to support the regtest network parameters of course, but obviously regular Bitcoin does (in git master) as does bitcoinj (again in git master).
./bitcoind -regtest &
Now connect a client to it on port 18444 and run:
./bitcoind -regtest setgenerate true
You just got a block, immediately. Run that command again to get a block whenever you want one. Regtest mode has difficulty set to (effectively) zero, so you can mine blocks in about 300 msec on a regular CPU.
Your software has to support the regtest network parameters of course, but obviously regular Bitcoin does (in git master) as does bitcoinj (again in git master).
This does not seem work for me, using bitcoind 0.8.6 on Linux. The process started by ./bitcoind -regtest & is very active, ./bitcoind -regtest getmininginfo shows generate is true and an increasing block count, but no test bitcoin accumulate.
It may be that I don't understand what the phrase 'connect a client to it on port 18444' means. Are there complete instructions (including the setup of bitcoin.conf and any other prerequisites that I haven't thought of) for running with -regtest anywhere?