2

I am trying to create a private blockchain with Ethereum (only with one node). I followed this tutorial: https://media.consensys.net/how-to-build-a-private-ethereum-blockchain-fbf3904f337

In the end I fired the following command:

go-ethereum/build/bin/geth --mine --nodiscover --maxpeers 0 --networkid 13 --rpc --rpccorsdomain "*"

My geth process is hanging at the following step (after generating DAG):

INFO [09-25|22:04:29] Generating DAG in progress               epoch=1 percentage=98 elapsed=5m2.991s
INFO [09-25|22:04:33] Generating DAG in progress               epoch=1 percentage=99 elapsed=5m6.578s
INFO [09-25|22:04:33] Generated ethash verification cache      epoch=1 elapsed=5m6.582s

I was expecting to see some blocks are mining as mentioned in the tutorial. Can anyone tell me what can possibly go wrong? Any way out to fix it?

Alien
  • 15,141
  • 6
  • 37
  • 57
user3606212
  • 83
  • 2
  • 7

3 Answers3

2

I got the same issue, all I did was repeatedly used miner.start() a few times and it will show

 Updated mining threads                   threads=1

after a few attempts mining started and the account received funds

Joshua Duxbury
  • 4,892
  • 4
  • 32
  • 51
2

One issue I did have which I've diagnosed is the genesis file wasn't being generated properly on my private network and therefore was defaulting to the default genesis block.

Run the following command to view the genesis block

eth.getBlock(0)

if the block looks identical to the below then your custom genesis block hasn't been created successfully.

{
difficulty: 17179869184,
extraData: "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
gasLimit: 5000,
gasUsed: 0,
hash: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
miner: "0x0000000000000000000000000000000000000000",
mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
nonce: "0x0000000000000042",
number: 0,
parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
size: 540,
stateRoot: "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
timestamp: 0,
totalDifficulty: 17179869184,
transactions: [],
transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
uncles: []
}

delete your data directory and reinitialise

geth --datadir=./eth/data init genesis.json

Some helpfull commands to help people debug further

debug.verbosity(6) -- Enables detailed error messages

miner.start(1) -- Allways use this instead of miner.start()

eth.syncing -- Is this node syncing with any other node on the network? (not always reliable)

References https://github.com/ethereum/go-ethereum/issues/15087

Joshua Duxbury
  • 4,892
  • 4
  • 32
  • 51
1

Have you set your Etherbase (i.e. default primary local account). The miner needs a place to store the mined Ether.

Jake Henningsgaard
  • 704
  • 1
  • 6
  • 16
  • 1
    Having the same issue here. I set the primary account to eth.accounts[0], but still geth is telling me, that it is generating the dag. – Mehrad Rafigh Oct 11 '17 at 14:56
  • 1
    Did you create an account? No accounts are created automatically. – Jake Henningsgaard Oct 11 '17 at 15:44
  • 2
    Hi Jake! Thanks for replying. I created a new account and unlocked it. I think I tried like a gazillion options, but still no luck. Just as a disclaimer, I am running geth in a Docker Container – Mehrad Rafigh Oct 11 '17 at 16:10