Bitcoin Forum
September 28, 2016, 10:17:00 AM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 »  All
  Print  
Author Topic: TEST network, for experimental development and hacking  (Read 15026 times)
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 15, 2010, 12:51:03 AM
 #1

I went ahead and created a modified Bitcoin client with a brand-new block chain and a few other changes (detailed below) that will make it independent of the "production" Bitcoin network.

I intend to use it to test out some code I'm writing for my next project; I don't want to accidentally break (or slowdown or otherwise interfere with) the real Bitcoin network.  It should also be useful for anybody who wants to see if they can purposely break Bitcoin (for the purposes of a security audit).

Code is hosted at github: http://github.com/gavinandresen/bitcoin-git

Patches to go from 'production' bitcoin to 'TEST network' bitcoin are also at github: http://gist.github.com/502460

... so go nuts and start hacking.

Changes are:

+ Listen port is 18333 (instead of 8333).  Uses 18332 for JSON-RPC (instead of 8332).
+ Uses irc.lfnet.org channel #bitcoinTEST  for bootstrapping.
+ Never tries to connect to "well known" nodes for bootstrapping.
+ Uses bitcoinTEST for the default data directory (e.g. ~/.bitcoinTEST on Linux, %APPDATA%/BitcoinTEST on Windows, etc)
+ Uses a different ADDRESSVERSION for Bitcoin Addresses (0xff instead of 0x0), so you can't screw up copying and pasting Bitcoin addresses (if you try to use a TEST address on the production system it will tell you it's invalid; you can, however, lose TESTcoins by trying to send them to a valid production address)
++ Has a brand-new block chain (with a different genesis block)
++ Initial difficulty is 4 times easier than production Bitcoin
++ protocol message header bytes are { 0xfa, 0xbf, 0xb5, 0xda } instead of { 0xf9, 0xbe, 0xb4, 0xd9 }

(16 July: "++" stuff added in response to the suggestions below in this thread)

A very generous TEST Bitcoin Faucet is running at: https://freebitcoins.appspot.com/TEST/

I think the TEST and production GUIs don't play well with each other; at least on my Mac, I have to quit the "real" bitcoin before running TEST.  That's probably an easy fix, I just need to figure out how...


How often do you get the chance to work on a potentially world-changing project?
1475057820
Hero Member
*
Offline Offline

Posts: 1475057820

View Profile Personal Message (Offline)

Ignore
1475057820
Reply with quote  #2

1475057820
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1475057820
Hero Member
*
Offline Offline

Posts: 1475057820

View Profile Personal Message (Offline)

Ignore
1475057820
Reply with quote  #2

1475057820
Report to moderator
1475057820
Hero Member
*
Offline Offline

Posts: 1475057820

View Profile Personal Message (Offline)

Ignore
1475057820
Reply with quote  #2

1475057820
Report to moderator
1475057820
Hero Member
*
Offline Offline

Posts: 1475057820

View Profile Personal Message (Offline)

Ignore
1475057820
Reply with quote  #2

1475057820
Report to moderator
SmokeTooMuch
Legendary
*
Offline Offline

Activity: 873


View Profile
July 15, 2010, 12:58:46 AM
 #2

make a windows binary and I'll be insta-testing

Date Registered: 2009-12-10 | I'm using GPG, pm me for my public key. | Bitcoin on Reddit: https://www.reddit.com/r/btc
You like what I'm doing? Why don't you send me a coin: 17Pj8jpUgY6qTaKgiopL5U48zxU4rTrkuB
bdonlan
Member
**
Offline Offline

Activity: 76


View Profile
July 15, 2010, 01:24:01 AM
 #3

Changing the genesis block would be a VERY good idea - better yet, change the protocol version as well. This will help avoid the possibility of the two networks merging (peers do exchange address lists...)
jib
Member
**
Offline Offline

Activity: 84


View Profile
July 15, 2010, 01:32:29 AM
 #4

Yeah, change the genesis block. At the moment if someone connects a test client but gives it the data files from a real client then the real block chain will be longest and will spread throughout the test network, right?

Looking forward to quantum computing so we can have qubitcoins.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 15, 2010, 01:40:23 AM
 #5

Very good point about the genesis block.

Unfortunately, I'm not exactly sure HOW to generate a valid genesis block; I can tweak the data but need to generate a valid block hash... hmm, I see some time in gdb in my near future...

RE: changing the protocol version:  Good Idea, too.  Every wire protocol message starts with the bytes '{ 0xf9, 0xbe, 0xb4, 0xd9 }', I'll tweak that in the TEST code so TEST and production clients can't talk to each other even if they manage to get connected.

How often do you get the chance to work on a potentially world-changing project?
bdonlan
Member
**
Offline Offline

Activity: 76


View Profile
July 15, 2010, 02:45:19 AM
 #6

Very good point about the genesis block.

Unfortunately, I'm not exactly sure HOW to generate a valid genesis block; I can tweak the data but need to generate a valid block hash... hmm, I see some time in gdb in my near future...

It should be sufficient to just change things to invert the hash in the prevBlock pointer or something... Then the genesis block doesn't need to change.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 15, 2010, 03:51:38 AM
 #7

It's ALIVE!



Source on git now has:

+ different genesis block
+ ridiculously easy minimum proof of work threshold
+ protocol message header bytes are { 0xfa, 0xbf, 0xb5, 0xda } instead of { 0xf9, 0xbe, 0xb4, 0xd9 }

If you compile and connect and turn on coin generation you'll generate a lot of play money quickly...
(I've turned off generation, but will keep my three clients -- two Linux, one Mac -- connected)

How often do you get the chance to work on a potentially world-changing project?
bdonlan
Member
**
Offline Offline

Activity: 76


View Profile
July 15, 2010, 04:56:45 AM
 #8

It's ALIVE!



Source on git now has:

+ different genesis block
+ ridiculously easy minimum proof of work threshold
+ protocol message header bytes are { 0xfa, 0xbf, 0xb5, 0xda } instead of { 0xf9, 0xbe, 0xb4, 0xd9 }

If you compile and connect and turn on coin generation you'll generate a lot of play money quickly...
(I've turned off generation, but will keep my three clients -- two Linux, one Mac -- connected)
870 blocks already? How long will that take to bootstrap once it gets going? Smiley
EricJ2190
Full Member
***
Offline Offline

Activity: 134


View Profile
July 15, 2010, 05:56:05 AM
 #9

MSVC9 won't accept the fact that pnSeed[] in net.cpp is empty. It fails with the message "error C2466: cannot allocate an array of constant size 0".

edit: After looking at pnSeed[]'s purpose (network bootstrapping), I added a single value of 0 to it which allows it to compile past that point.

edit2: It compiles fine now, but for some reason won't run. It does absolutely nothing when the EXE is run.

edit3: Nevermind. It is working now. Not sure why it wasn't before.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 16, 2010, 01:29:09 AM
 #10

I know EricJ2190 tried out the test network today-- Eric (and anybody else who might have compiled and run) you need to git pull, recompile, and nuke your ~/.bitcoinTEST directory.  The client was generating blocks WAY too fast.

That'll teach me to go messing with code I don't really understand (on the bright side, I now know what the OpenSSL BN_bn2mpi() routine does).

Oh, and Eric:  I added your pnSeed fix to my git branch.

How often do you get the chance to work on a potentially world-changing project?
XaviorPenguin
Newbie
*
Offline Offline

Activity: 8


View Profile
July 16, 2010, 02:09:51 AM
 #11

Well poo.  If I knew how to compile a Windows binary, I would and start testing for ya.  I wouldn't mind being a node/connection to help out in the network at all.

Sharecoin: SeUHqPdfnzQJtRgZ2iPta6KZzEmmPFKwpV
bdonlan
Member
**
Offline Offline

Activity: 76


View Profile
July 16, 2010, 03:08:26 AM
 #12

I'm working on an alternate bitcoin client and I'd like to try it on the test network. Is there a list of bootstrap hosts for the test network somewhere, so I don't need to implement an IRC client at this point?
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 16, 2010, 03:42:14 AM
 #13

I'm working on an alternate bitcoin client and I'd like to try it on the test network. Is there a list of bootstrap hosts for the test network somewhere, so I don't need to implement an IRC client at this point?
The TEST Faucet will be running on host:  li133-197.members.linode.com
(starting tomorrow, if all goes as planned).  You can connect to it to bootstrap.

How often do you get the chance to work on a potentially world-changing project?
bdonlan
Member
**
Offline Offline

Activity: 76


View Profile
July 16, 2010, 03:59:52 AM
 #14

I'm working on an alternate bitcoin client and I'd like to try it on the test network. Is there a list of bootstrap hosts for the test network somewhere, so I don't need to implement an IRC client at this point?
The TEST Faucet will be running on host:  li133-197.members.linode.com
(starting tomorrow, if all goes as planned).  You can connect to it to bootstrap.
*waves from across the rack*
I couldn't wait, so I set up a node on my own linode as well. You can connect at fushizen.net. Currently my custom client isn't doing much more than maintaining a connection - figuring out how to decode and verify the block chain's probably going to be a weekend project (or two).
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 16, 2010, 05:52:00 PM
 #15

TESTcoins are maturing, and the TEST Faucet is open and giving out 50 TESTcoins per visit:  https://freebitcoins.appspot.com/TEST/

Feel free to grab some play money any time; there's no coins-per-IP-address limit, but you will have to solve the CAPTCHA if you revisit.



How often do you get the chance to work on a potentially world-changing project?
knightmb
Sr. Member
****
Offline Offline

Activity: 308


Timekoin - Save Electricity, Don't Waste It!


View Profile WWW
July 17, 2010, 12:16:10 AM
 #16

The client was generating blocks WAY too fast.
My bad, I'll restrict the 32 core systems to doing the main bitcoin generation next time instead of seeing what would happen at the beginning of a test network  Wink

EricJ2190
Full Member
***
Offline Offline

Activity: 134


View Profile
July 17, 2010, 03:15:38 AM
 #17

I modified my test client to handle full precision values.

http://github.com/EricJ2190/bitcoin-git/tree/fullprecision

ArtForz
Sr. Member
****
Offline Offline

Activity: 406


View Profile
July 24, 2010, 11:50:26 PM
 #18

Generated blocks 992 - 2016 in 2h15 min Grin
Sent 3 largish transactions to the test faucet.

bitcoin: 1Fb77Xq5ePFER8GtKRn2KDbDTVpJKfKmpz
i0coin: jNdvyvd6v6gV3kVJLD7HsB5ZwHyHwAkfdw
lfm
Full Member
***
Offline Offline

Activity: 196



View Profile
July 31, 2010, 08:22:49 AM
 #19

I was unable to build the test network version on a system where the standard version builds ok. (both v. 0.3.6)

It seems it is a problem with boost 1.35. Its an older Ubuntu (9.04) system.

I tried to get boost 1.40 but I failed. It conflicts with installed stuff or something.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 31, 2010, 01:35:58 PM
 #20

Can you be more specific about where your build fails?  Is it in the new code to support the -port / -rpcport options (which I should have put on a different git branch) ?

How often do you get the chance to work on a potentially world-changing project?
Pages: [1] 2 3 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!