ethereum / genesis_block_generator

32 stars 255 forks source link

How do I use this to make a test chain? #16

Closed plato-cambrian closed 8 years ago

plato-cambrian commented 8 years ago

The cli docs say I should experiment on my own private test chain so I can easily mine.

They link to this blog post which only has instructions for generating the real genesis block.

I asked on IRC and azariah said I should use this but change the block difficulty. Do I really need to fetch real network transactions to construct a test chain genesis block?

tgerring commented 8 years ago

You can use any genesis block you want the clients... Find an example online and change the allocation addresses to only include your private net address with lots of wei and low difficulty.

plato-cambrian commented 8 years ago

ok thanks, is this repo the wrong place for my issue? i.e. should the python script NOT make test genesis blocks?

obscuren commented 8 years ago

this is a genesis file that you can use. If you'd like to give yourself a lot of Ether can you add your address in between the alloc part:

"alloc": {
    "0xmyaddress": {
        "balance": "10000000000"
    }
}
plato-cambrian commented 8 years ago

Thanks guys!

plato-cambrian commented 8 years ago

in case that link dies:

No allocation
{
    "nonce": "0xdeadbeefdeadbeef",
    "timestamp": "0x0", 
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 
    "extraData": "0x686f727365", 
    "gasLimit": "0x8000000", 
    "difficulty": "0x400", 
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", 
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
   }
}

Allocating to one address:
"alloc": {
    "0xmyaddress": {
        "balance": "10000000000"
    }
}

One last question, that balance is in "Wei's", right? so that number would actually be some miniscule fraction of one "ether" and probably not enough to deploy a contract?

obscuren commented 8 years ago

That's indeed wei. Just supply an amount less than 2**256 :-)