Bitcoin Forum
April 23, 2024, 08:18:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Testnet in a box  (Read 17012 times)
Mike Hearn (OP)
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
March 15, 2011, 01:43:13 PM
 #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.
1713860312
Hero Member
*
Offline Offline

Posts: 1713860312

View Profile Personal Message (Offline)

Ignore
1713860312
Reply with quote  #2

1713860312
Report to moderator
1713860312
Hero Member
*
Offline Offline

Posts: 1713860312

View Profile Personal Message (Offline)

Ignore
1713860312
Reply with quote  #2

1713860312
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713860312
Hero Member
*
Offline Offline

Posts: 1713860312

View Profile Personal Message (Offline)

Ignore
1713860312
Reply with quote  #2

1713860312
Report to moderator
johnieeliang
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
March 15, 2011, 03:50:58 PM
 #2

thanks man testing out now
JollyGreen
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
March 15, 2011, 06:08:39 PM
 #3

great idea, I'll try it out tonight!
JollyGreen
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
March 16, 2011, 07: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
JollyGreen
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
March 16, 2011, 07:40:29 AM
 #5

is there a way to run the block explorer on the testbox setup you created?
Mike Hearn (OP)
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
March 16, 2011, 09: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).
Jan
Legendary
*
Offline Offline

Activity: 1043
Merit: 1002



View Profile
June 29, 2011, 07: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?

Mycelium let's you hold your private keys private.
Roodemol
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
November 21, 2011, 10: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
terrytibbs
Hero Member
*****
Offline Offline

Activity: 560
Merit: 501



View Profile
December 09, 2011, 03:15:57 PM
 #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.
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
December 09, 2011, 08:12:21 PM
 #10

nifty

farproc
Sr. Member
****
Offline Offline

Activity: 406
Merit: 250


ALGORY.io Crowdsale starts on 8/12/2017


View Profile
July 09, 2013, 03:54:42 AM
 #11

Not work with 0.8.3?

The 2 clients are always syncing. No progress at all.

.
            ▀███████████████▄▄
              █████████████████
               █████████████████
                █████████████████
                 █████████████████
                  █████████████████
        ▄▄▄▄       █████████████████
    ▄██████████▄    █████████████████
   ██████████████    █████████████████
  ████████████████    █████████████████
 ██████████████████    █████████████████
 ██████████████████     █████████████████
 ██████████████████      █████████████████
  ████████████████        █████████████████
   ██████████████          █████████████████
    ▀██████████▀            ▀████████████████▄
       ▀▀▀▀▀▀ 
ALGORY  Multifunctional Tool for Cryptocurrency Trading 
Join Whitelist and Get 20% Bonus┃CROWDSALE ON DEC. 8
           ░████████████▒
       ░████████████████████░
     ░████████████████████████▒
   ░████████████████████████████░
  ░██████████████████   █████████▒
 ░███████████████      ▒██████████░
 █████████████         ████████████
░██████████            ████████████░
░██████                ████████████▒
░█████████████▒▒      ▒████████████▒
 ████████████████     █████████████░
 ▒████████████████    ████████████▒
  ▒████████████████▒  ████████████
   ░█████████████████ ██████████▒
     ██████████████████████████░
       ▒█████████████████████
          ░██████████████▒
Mike Hearn (OP)
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
July 09, 2013, 08: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).
🏰 TradeFortress 🏰
Bitcoin Veteran
VIP
Legendary
*
Offline Offline

Activity: 1316
Merit: 1043

👻


View Profile
July 09, 2013, 08: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..
Mike Hearn (OP)
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
July 09, 2013, 10:39:33 AM
 #14

You're welcome Smiley
aray
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
January 29, 2014, 03:45:20 PM
 #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?
Mike Hearn (OP)
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
January 29, 2014, 05:12:47 PM
 #16

You need to use git master or the soon to be released 0.9.0rc1 for regtest mode.
eigenjoy
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 03, 2014, 07: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.
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 506


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
July 22, 2014, 02:05:09 AM
 #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

rapport
Full Member
***
Offline Offline

Activity: 157
Merit: 100


View Profile
July 23, 2014, 07: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 &
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!