Author

Topic: Testnet in a box (Read 17040 times)

full member
Activity: 157
Merit: 100
July 23, 2014, 02:37:51 AM
#19
The testnet difficulty has risen again - people use GPUs to speed up their testing and then the network adapts.

To solve this I've put together testnet-in-a-box. It's a zip file you can extract locally, run a couple of commands and you have a difficulty-1, private testnet instance with a few thousand coins for you to spend. You can then use CPU mining to create blocks every 10 minutes as normal or a GPU miner for blocks every few seconds.

Get it here:

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

The README file contains instructions on how to use it.

Thanks! Smiley

Did you see Mike's comment above with regtest?
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 &
hero member
Activity: 560
Merit: 509
I prefer Zakir over Muhammed when mentioning me!
July 21, 2014, 09:05:09 PM
#18
The testnet difficulty has risen again - people use GPUs to speed up their testing and then the network adapts.

To solve this I've put together testnet-in-a-box. It's a zip file you can extract locally, run a couple of commands and you have a difficulty-1, private testnet instance with a few thousand coins for you to spend. You can then use CPU mining to create blocks every 10 minutes as normal or a GPU miner for blocks every few seconds.

Get it here:

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

The README file contains instructions on how to use it.

Thanks! Smiley

Quote
The testnet difficulty has risen again - people use GPUs to speed up their testing and then the network adapts.

Why doesn't they care about others? Huh

Kindly,
      MZ
newbie
Activity: 3
Merit: 0
June 03, 2014, 02:27:13 PM
#17
I just finished a video on how to setup a 2-node local testnet using Docker. In the video, I setup the testnet on the container and then make transactions with Bitcoin-Qt on the host. You can watch the video here: https://www.youtube.com/watch?v=LLZNvl90PC0

If you have docker installed, it's pretty straightforward. Essentially you:

Code:
# pull the testnet box
docker pull freewil/bitcoin-testnet-box

# run our box. map an extra port
docker run -t -i --name bitcoind -P -p 49020:19000 freewil/bitcoin-testnet-box

I'll write up a blog post describing all of the commands shortly. I'm doing a whole series of videos on how to get started programming bitcoin transactions, so if this interests you, subscribe to the channel.
legendary
Activity: 1526
Merit: 1134
January 29, 2014, 12:12:47 PM
#16
You need to use git master or the soon to be released 0.9.0rc1 for regtest mode.
newbie
Activity: 1
Merit: 0
January 29, 2014, 10:45:20 AM
#15
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).

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?
legendary
Activity: 1526
Merit: 1134
July 09, 2013, 05:39:33 AM
#14
You're welcome Smiley
vip
Activity: 1316
Merit: 1043
👻
July 09, 2013, 03:52:48 AM
#13
This is awesome - thanks so much! No longer will I have to wait or beg for new blocks on testnet.

That also means I cannot procrastinate for 5 - 30 minutes through Sad..
legendary
Activity: 1526
Merit: 1134
July 09, 2013, 03:44:44 AM
#12
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).
sr. member
Activity: 406
Merit: 250
ALGORY.io Crowdsale starts on 8/12/2017
July 08, 2013, 10:54:42 PM
#11
Not work with 0.8.3?

The 2 clients are always syncing. No progress at all.
hero member
Activity: 742
Merit: 500
December 09, 2011, 03:12:21 PM
#10
nifty
hero member
Activity: 560
Merit: 501
December 09, 2011, 10:15:57 AM
#9
is there a way to run the block explorer on the testbox setup you created?

No way to run blockexplorer. It's not open source (afaik).

Try bitcoin-abe.
newbie
Activity: 9
Merit: 0
November 21, 2011, 05:25:30 PM
#8
Hello,
is it possible to setup "testnet in a box" with a pool on a computer and mine with a miner (cgminer, DiabloMiner, ...) on a second one? With such a configuration one could easily test modifications on the SHA algorithm.

Does anyone have a sample configuration?

Regards,
Gilles
Jan
legendary
Activity: 1043
Merit: 1002
June 29, 2011, 02:50:55 AM
#7
testnet-in-a-box almost works for me with the current bitcoin client on a windows system.

Observations:
 I can start the two clients on the same windows box (two processes running).
 Only one of them has a UI, and the other is headless until i stop the first.
 The first client correctly displays 192 blocks and 3650 coins, and the second zero coins.
 The -deamon option seems not to make any difference.
 Issuing the getinfo command gives me a dialog "error: couldn't connect to server"

Is testnet-in-a-box only supported on a Linux system?
legendary
Activity: 1526
Merit: 1134
March 16, 2011, 04:30:50 AM
#6
It didn't take that long for me, perhaps you just got unlucky. But yeah, I think for faster testing the way to go is to introduce a third localtest network that has super easy difficulty. For now you can use a graphics card to knock out blocks.

No way to run blockexplorer. It's not open source (afaik).
newbie
Activity: 42
Merit: 0
March 16, 2011, 02:40:29 AM
#5
is there a way to run the block explorer on the testbox setup you created?
newbie
Activity: 42
Merit: 0
March 16, 2011, 02:02:27 AM
#4
Great Job!  Not your problem, but it's still kind of annoying at difficulty 1 it takes 1 hour to generate a block on a 1000khash/sec machine....

oh well, this should be faster than the current testnet.  Thanks
newbie
Activity: 42
Merit: 0
March 15, 2011, 01:08:39 PM
#3
great idea, I'll try it out tonight!
newbie
Activity: 14
Merit: 0
March 15, 2011, 10:50:58 AM
#2
thanks man testing out now
legendary
Activity: 1526
Merit: 1134
March 15, 2011, 08:43:13 AM
#1
The testnet difficulty has risen again - people use GPUs to speed up their testing and then the network adapts.

To solve this I've put together testnet-in-a-box. It's a zip file you can extract locally, run a couple of commands and you have a difficulty-1, private testnet instance with a few thousand coins for you to spend. You can then use CPU mining to create blocks every 10 minutes as normal or a GPU miner for blocks every few seconds.

Get it here:

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

The README file contains instructions on how to use it.
Jump to: