0

I followed the instructions in this answer to get a private testnet.

When I start mining in dev/private network using miner.start() what exactly is being mined?

Since I am the only node in the test network and I am not sending any transaction, I don't understand what the newly mined blocks contain!

Is the network supposed to mine a block every x seconds even if there is no transaction in the network?

marked as duplicate by Richard Horrocks, Rob Hitchens - B9lab, Jamie Hale, eth May 11 '17 at 2:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    In answer to your final question: yes :-) – Richard Horrocks May 9 '17 at 10:31
  • why is it so? Isn't it wasteful to add blocks having the same state as the previous one? Wouldn't it increase the size of the blockchain needlessly? – pd176 May 9 '17 at 11:04
  • 1
    Adding new blocks to the chain increases the security of any previous blocks that contain transactions, as it makes it economically more difficult to change older blocks by creating a new version of the chain. In your case you have no blocks that contain any transactions, but the code has no intelligence to know this. – Richard Horrocks May 9 '17 at 11:07
  • okay makes sense! But won't the merkle roots of 2 blocks be same if there is no state change across them? – pd176 May 9 '17 at 11:20
  • I suppose the root of the state trie will be the same, but other things will be different in the block header. (Or have I missed your point?) – Richard Horrocks May 9 '17 at 11:24