0

I'm having integration tests with private Ethereum network running in Docker. Generating of DAG takes few minutes and at least 2 Gb (1Gb for epoch 0 and 1). I've set difficulty in custom genesis block 0x1 and it's still to much.

I can run tests on local machine and mount volume to /root/.ethash to reuse DAG between tests. But it prevents me from running tests on Bitbucket because of time and storage limitations.

Is there any way to avoid generating DAG for tests?

4ntoine
  • 19,816
  • 21
  • 96
  • 220

1 Answers1

1

Ethash mining needs the DAG.

A quick workaround for private testnets is to use Clique (PoA consensus) instead.

You can configure Clique in the genesis.json like this:

  "config": {

    "clique": {
      "period": 5,
      "epoch": 30000
    }
  }

The sealing will happen at regular intervals of period seconds. There is no other impact on the working of the network or the contracts.

The only potential downside is that Clique needs at least 2 nodes.

rustyx
  • 80,671
  • 25
  • 200
  • 267