download/install geth from https://github.com/ethereum/go-ethereum/wiki/Installation-instructions-for-Windows
setup private net jason file under ~/.privether, an example of privategenesis.json
{
"nonce": "0x00006d6f7264656e",
"difficulty": "0x000002",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc": {
"cd2a3d9f938e13cd947ec05abc7fe734df8dd826": { "balance": "10000000000000000" }
}
}
initialize the private net and specify a network id
geth --datadir ~/.ethereum/privatenet init .privether/privategenesis.json
geth --datadir ~/.ethereum/privatenet --networkid=346
in another console, attach to this private net
geth attach ipc:\\.\pipe\geth.ipc
and happy mining!
> personal.newAccount("Password123")
"0x01e08a06618d5a96956080ead0c8fc2452cf3311"
> miner.setEtherbase(personal.listAccounts[0])
true
> eth.getBalance(eth.coinbase).toNumber()
0
> miner.start(2)
null
> eth.getBalance(eth.coinbase).toNumber()
1.415e+21
Comments
Post a Comment