btcd icon indicating copy to clipboard operation
btcd copied to clipboard

Add miningaddr argument in generate

Open wbobeirne opened this issue 6 years ago • 3 comments

I'm working on a little testing tool for simnet & lnd nodes, and it would be extremely convenient if you could specify a miningaddr on the fly per generate, rather than at startup. I'm trying to make it easy to fund nodes quickly, but due to miningaddr only being configurable as a btcd argument, I would have to restart btcd each time to fund a node.

Ideally I'd instead like to generate a new address from the node, and generate a block with a command like btcctl generate 1 --miningaddr=[result from lncli newaddress here]. I'm not sure how generate and miningaddr are put together, but hopefully this wouldn't be too difficult.

wbobeirne avatar Mar 28 '19 20:03 wbobeirne

I would like to see this as well. But I would suggest not touching generate and instead implementing generatetoaddress behaving the same as in bitcoin-cli.

I work on a testing tool for simnet clusters and I want to support both btcd/bitcoind as master backend node for mining into a faucet. Currently I have to branch the code (and have prior miningaddr config in btcd case).

https://github.com/darwin/simverse/blob/551b896c16aab7870520c3fbd5c3782bd2b40ab3/toolbox/generate#L8-L12

darwin avatar Apr 24 '19 21:04 darwin

Related to https://github.com/btcsuite/btcd/pull/845

Roasbeef avatar Apr 24 '19 23:04 Roasbeef

I have rebased off of the latest master and updated the approach on #1441. Please re-review, hoping to get it merged 🙏

yashbhutwala avatar Sep 10 '25 14:09 yashbhutwala