diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-09 16:31:37 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-09 16:31:37 +0800 |
commit | 315a422ba754eae10db21990a809f608f7af62d4 (patch) | |
tree | 56924b100b906cd4f6da5ac13540c175df756988 /core/genesis.go | |
parent | 9e91579105e94395a108d43ec3ac0ae0e0f139c5 (diff) | |
parent | 1de796f10134bb4aa245591e0d8802e320892efb (diff) | |
download | dexon-315a422ba754eae10db21990a809f608f7af62d4.tar dexon-315a422ba754eae10db21990a809f608f7af62d4.tar.gz dexon-315a422ba754eae10db21990a809f608f7af62d4.tar.bz2 dexon-315a422ba754eae10db21990a809f608f7af62d4.tar.lz dexon-315a422ba754eae10db21990a809f608f7af62d4.tar.xz dexon-315a422ba754eae10db21990a809f608f7af62d4.tar.zst dexon-315a422ba754eae10db21990a809f608f7af62d4.zip |
Merge pull request #1888 from obscuren/testnet
cmd, core, eth: added official testnet
Diffstat (limited to 'core/genesis.go')
-rw-r--r-- | core/genesis.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go index 62e039d1a..4c5c17f60 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -159,6 +159,27 @@ func WriteGenesisBlockForTesting(db ethdb.Database, accounts ...GenesisAccount) func WriteTestNetGenesisBlock(chainDb ethdb.Database, nonce uint64) (*types.Block, error) { testGenesis := fmt.Sprintf(`{ + "nonce": "0x%x", + "difficulty": "0x20000", + "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", + "coinbase": "0x0000000000000000000000000000000000000000", + "timestamp": "0x00", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x", + "gasLimit": "0x2FEFD8", + "alloc": { + "0000000000000000000000000000000000000001": { "balance": "1" }, + "0000000000000000000000000000000000000002": { "balance": "1" }, + "0000000000000000000000000000000000000003": { "balance": "1" }, + "0000000000000000000000000000000000000004": { "balance": "1" }, + "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376" } + } +}`, types.EncodeNonce(nonce)) + return WriteGenesisBlock(chainDb, strings.NewReader(testGenesis)) +} + +func WriteOlympicGenesisBlock(chainDb ethdb.Database, nonce uint64) (*types.Block, error) { + testGenesis := fmt.Sprintf(`{ "nonce":"0x%x", "gasLimit":"0x%x", "difficulty":"0x%x", |