Blockchain 4 min read

Why miner.start Returns Null in Geth Dev Mode and How to Fix It

This article explains that the null return from miner.start in Geth’s dev mode is caused by a new --dev.period parameter introduced in recent versions, and shows how adding --dev.period 1 resolves the issue, allowing continuous block mining.

Senior Brother's Insights
Senior Brother's Insights
Senior Brother's Insights
Why miner.start Returns Null in Geth Dev Mode and How to Fix It
Earlier versions of Geth in --dev mode started mining automatically when miner.start() was called. After a Geth update the call returns null and mining only occurs after a transaction is submitted.

Background

In developer mode Geth creates an ephemeral proof‑of‑authority network with a pre‑funded account. The original workflow was:

geth --dev
miner.start()

and blocks were produced continuously.

Cause

Starting with recent Geth releases a new flag --dev.period was added. Its definition is:

--dev.period <seconds>   Block period in developer mode (0 = mine only when a transaction is pending) (default: 0)

The default value 0 disables automatic mining, so miner.start() appears to do nothing and returns null.

Solution

Launch the node with the original --dev flag.

Add a non‑zero period, e.g. --dev.period 1 (any positive integer works).

Restart the node and invoke miner.start() again.

Example command: geth --dev --dev.period 1 After the restart the node mines continuously; the block number increases in the logs and via eth.blockNumber regardless of the return value of miner.start().

Notes

The --dev.period value must be greater than zero; setting it to 0 reproduces the issue.

This flag is documented in the Geth command‑line reference but is often overlooked in community solutions.

Conclusion

Adjusting --dev.period to a non‑zero value restores the expected mining behavior in Geth’s developer mode.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Ethereumgethminer.startdev mode
Senior Brother's Insights
Written by

Senior Brother's Insights

A public account focused on workplace, career growth, team management, and self-improvement. The author is the writer of books including 'SpringBoot Technology Insider' and 'Drools 8 Rule Engine: Core Technology and Practice'.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.