3

I am working on a private blockchain (currently block #16117). I have pregenerated the DAG for epoch 1 as well. So, I started the geth instance with --autodag=false. However, I still get the following message when I start mining:

I0707 10:24:57.871976 eth/backend.go:452] Automatic pregeneration of ethash DAG ON (ethash dir: ~/.ethash)

I am not sure how to disable this. Is the --autodag=false command wrong? Is there a way to do this from the JavaScript Console?

geth version - 1.4.9-stable

| improve this question | | | | |
  • Why do you want to disable DAG Generation? out of curiosity. – niksmac Jul 8 '16 at 3:13
  • 1
    @niksmac While mining my private blockchain, , automatic generation of DAG for epoch 1 started at block #16092. I had a lot of processes running at that time and the DAG generation failed due to low memory which ultimately stopped the mining process. So, I pre-generated DAG for epoch 1 and then started mining again. I want to disable this because I don't want the miner to crash while generating DAG for epoch 2 again. – galahad Jul 8 '16 at 3:21
  • Okay, so DAG is supposed to contain the previous work you have done to prove your work; PoW, so it has to recreate to match the new blocks in it. the way i do is to delete the chain data and start from block #1 – niksmac Jul 8 '16 at 3:32
  • Yes. Starting over from the beginning is a temporary solution but that would delete all the data, which is not desired. I saw this --autodag option in geth --help but couldn't figure out how to use it. – galahad Jul 8 '16 at 13:53
  • 1
    @Avatar Yes. That solved the problem. – galahad Jan 3 '17 at 0:40
4

Setting the --autodag option to false doesn't seem to work. I typed this command in the JS console and it worked:

miner.stopAutoDAG()

Output:

I0708 11:01:29.112749 eth/backend.go:498] Automatic pregeneration of ethash DAG OFF (ethash dir: ~/.ethash)
| improve this answer | | | | |
3

Just to add to the accepted answer...

The --autodag flag doesn't take a value, so it can't be set to false.

The DAG will always be pregenerated if mining is enabled from the CLI using the --mine flag. What the --autodag flag allows you to do is pregenerate the DAG even if mining is not enabled.

The pertinent part of the code is in flags.go:

AutoDAG:   ctx.GlobalBool(AutoDAGFlag.Name) || ctx.GlobalBool(MiningEnabledFlag.Name),
| improve this answer | | | | |

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.