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?

pd176
  • 439
  • 4
  • 14
  • 1
    In answer to your final question: yes :-) – Richard Horrocks May 09 '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 09 '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 09 '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 09 '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 09 '17 at 11:24
  • You mentioned that the code has no intelligence of knowing that a block contains no transaction! But checking the merkle root and equating it with the previous block merkle root will tell the code that the new block has no transaction right? – pd176 May 09 '17 at 11:32

0 Answers0