Author

Topic: How would I go about putting the setgenerate true and gen=1 back into bitcoind? (Read 123 times)

member
Activity: 72
Merit: 17
If your just looking for something to play with I think Bitcoin Core version 0.12.1 was the last version that had setgenerate available.
Just fork that version and your all set.

Or look at the differences going from 12.1 to 13.0 and back out the changes they made.

For a small coin it's good to have setgenerate available, I'm keeping an old coin alive because everyone can mine on their wallet to keep the chain moving.
copper member
Activity: 813
Merit: 1944
You don't need it. Think about the future! If your coin will reach some level of adoption, then not everyone will be a miner. And then you will need to remove it again from your code. Assuming that not all users are mining is a good thing and should be kept as is. Unless you are trying to create a coin where always everyone will be able to mine it, no matter what. But that puts difficulty into question, so maybe I shouldn't dig deeper into details of such construction here.

So, if you want to solo mine, the easiest way is just creating a pool and attaching only your miner into it. Then, if you want to add more miners, you always can do it in a simple way (and you will do it anyway to test what will happen where there will be more than one miner in your network or if someone will try to make a pool on your coin). Using getblocktemplate, parsing it and producing blocks based on that is the way to go. If you are mining alone and built-in miner is sufficient, then generatetoaddress can be used (but you have to make sure that you are restarting it in case of new block coming in).

Usually, performance of the build-in miner is poor. Also, updating your client each time to only update built-in miner can be tedious. More than that: if you want to compare performance of many different mining algorithms, then you have to make many different versions instead of having just one full node and connecting all miners into it.

So yes, you can bring back generating into your client, but expect many problems with that setup.
newbie
Activity: 14
Merit: 1
Hello. I am creating a cryptocurrency and would like to allow users to mine the new crypto directly from the core client. What code do I have to put back into bitcoin core in order to re-enable the gen=1 and setgenerate true?
Jump to: