I am trying to create my private testnet using geth. However, even when I use a CustomGenesis block from a json file, when I start geth and run admin.nodeInfo, the genesis and head hashes are of the main network.
Here is the CustomGenesis.json:-
{
"nonce": "0x0ae067964324234907200d849",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x4000",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x16d38897146fb767e709386f416bbc88aed53171",
"alloc": {
"0x16d38897146fb767e709386f416bbc88aed53171": {
"balance": "10000000000000000000"
}
}
}
Here is the command I am using to start my private testnet:-
geth --identity "Dev1" --datadir "/home/dev1admin/ethereum/private_test1/chain" --port "30304" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1729 --nat "none" --verbosity 5 console init "/home/dev1/ethereum/private_test1/CustomGenesis.json"
The output of admin.nodeInfo command:-
{
enode:"enode://0e576e1aa07d4ee4ea7fc34fe7a0e46ef16f9b835ce58b76dd7b675eea67d7546c3daf3b3115badabc24235d1056c508b108ba7d0f88bbf3687edae5db9165f7@[::]:30304?discport=0",
id: "0e576e1aa07d4ee4ea7fc34fe7a0e46ef16f9b835ce58b76dd7b675eea67d7546c3daf3b3115badabc24235d1056c508b108ba7d0f88bbf3687edae5db9165f7",
ip: "::",
listenAddr: "[::]:30304",
name: "Geth/Dev1/v1.5.5-stable-ff07d548/linux/go1.7.3",
ports: {
discovery: 0,
listener: 30304
},
protocols: {
eth: {
difficulty: 17179869184,
genesis: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
head: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
network: 1729
}
}
}
I don't want to use the --dev option with geth because I want to pre-allocate some ether. Also, just using a network id to differentiate between networks seems wrong to me (I also want to be able to set a custom nonce to ensure that no one else connects to my network unless they know my nonce).