I'm trying to run a private mining network for testing purposes for a website, but I'd like to only have the mining network "mine when needed" to keep the memory footprint of my test blockchain low. For this reason, in console mode I run a script called mineWhenNeeded.js, available here.

When I run geth console with the arguments listed below, I get that the mining is functioning correctly, starting when transactions are listed and stopping when there are no transactions left to process. However, when I run geth js with the below Popen command:

miner_process = subprocess.Popen(
                "--datadir", datadir,
                "--networkid", networkid,
                "--port", discPort,
                "--rpcport", rpcPort,
                "--rpcapi", "admin,eth,miner,personal,web3"
                "--nat", "none",
                "--lightserv", "90",
                "--etherbase", "0x13ec78bf464b00a400253e795e2f8ca0da68185c",
                "js", "~/my-eth-chain/mineWhenNeeded.js"

mining never starts, and none of my test transactions get run - although I'm able to connect fine via a test rpc connection. Is there some other way this should be done?

If I change the last arguments to:

                "--minerthreads", "1"

It still does not mine, what gives?

  • the only way I'm able to get this to work is by making an rpc call to miner_start – Mike Flynn Jul 9 '18 at 0:43

Your Answer

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

Browse other questions tagged or ask your own question.