5

I'm working on smart contracts and using Ethereum wallet. I have formed a private test net and successfully deployed smart contracts on that network. But, I didn't get how the miner functionality works in this scenario.

Why mining is needed in private network?

Can someone explain me how mining is done in private test net on Ethereum?

FrenchieiSverige
  • 1,498
  • 1
  • 12
  • 23
snehal
  • 121
  • 1
  • 7

2 Answers2

4

Even if you are the only one on this network, and that you are of course a trusty node, mining is important for 2 things: confirming your transactions and creating new coins.

The transactions are included into blocks that are mined, and since you are the only one on your private network, you also got the reward that you successfully mined the block. An interesting thing you may have noticed is that Ethereum creates a new block even if there is no new transations. From this link, you can see the answer:

Those empty blocks are constantly adding new layers of difficulty to ensure the practical immutability of past blocks.

Moreover, you can find more information here.

FrenchieiSverige
  • 1,498
  • 1
  • 12
  • 23
1

Depends on the consensus engine your are using. If you are using Ethash (proof-of-work), you would need to mine blocks (with geth, or ethminer).

If you use a Parity private network, you have several additional options.

  • The original Ethereum Ethash (proof-of-work).
  • You could use the InstantSeal engine, which basically listens to new transactions and creates a new block as soon as any transaction is pending.
  • The Aura Validator Engine which operates on a proof-of-authority network and achieves consensus by referring to a list of validators (referred to as authorities, when they are linked to physical entities).
  • The Tendermint engine.

For Geth, there is also a new validator engine in the works, called Clique (EIP-225).

Disclosure, I work for Parity.

q9f
  • 32,913
  • 47
  • 156
  • 395