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?

  • Do you mean why the mining process is mandatory even if you are on a private network? – FrenchieiSverige Mar 28 '17 at 20:23
  • What is your main concern? How to mine a transaction in private test net? or How do miners work? – Prashant Prabhakar Singh Mar 29 '17 at 4:35
  • @FrenchieiSverige Yes. Why mining is needed in private network? – snehal Mar 29 '17 at 14:06
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.