Bitcoin Forum
May 25, 2024, 06:44:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How would I go about putting the setgenerate true and gen=1 back into bitcoind?  (Read 109 times)
TheBitcoineers (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 1


View Profile WWW
January 12, 2021, 01:39:39 PM
 #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?
vjudeu
Hero Member
*****
Offline Offline

Activity: 696
Merit: 1603



View Profile
January 12, 2021, 04:05:41 PM
 #2

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Longhorn901
Member
**
Offline Offline

Activity: 72
Merit: 17


View Profile
January 12, 2021, 10:51:43 PM
 #3

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.

Visit Tribe Crypto on Discord! https://discord.gg/BzSeuGs/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!