Before Mining Genesis Block – Bitcoin Stack Exchange
Im attempting to make a test altcoin and I created the genesis block, merkle root and nonce. When I compile and run the daemon, The coin is attempting to connect other IPs for hours so I can’t mine the genesis block. I’ve switched P2P and RPC port.
Why is this happening ?
You’re supposed to run a 2nd daemon and let that one connect to the very first one
have you set the testnet = 1 te the config opstopping? You should very first see if you are able to mine the genesis block on the testnet and then check on the real network.
You need to set the nonce te numerous places and same with the merkle root.
The default implementation won’t let you mine if you’re not connected to any peers (except for on the Regression Test network) because any blocks you mine wouldn’t be able to be distributed. Check out miner.cpp::BitcoinMiner() (https://github.com/bitcoin/bitcoin/blob/v0.9.Three/src/miner.cpp#L512-L517).
You may want to create your own artificial mining method, like MineGenesisBlock() , within chainparams.cpp, and run it ter the initialization of each set of parameters. That way you won’t have to turn mining on (‘setgenerate true’) to mine the genesis block.
Every cryptocurrency derived from Bitcoin has a Genesis Block, the very very first block te the blockchain, whose creation is hard-coded into the total knot code. Ter order to prove that it’s authentic, the usual rules about hashing the Merkle root and the Overeenstemming information apply. So, one has to come up with some earnestly magic numbers to waterput te the code.
The established mechanism, documented ter all the coin cloning guides, involves setting the values to zero for the very very first run, getting an error message and using the values displayed ter the loom verkeersopstopping to pack into the source code. However, the section ter the Bitcoin code that computes the required hashes for debug printing has bot liquidated from the codebase prior to 0.9 release, around the very end of 2013. The story goes that it makes the chain more secure for miners, but I suspect the usual obfuscation by the developers.
The coins that have already bot cloned prior to 2014, like Litecoin, and have running blockchains with the Genesis Block ter place are not affected by this switch. Neither are the more latest projects that are willing to work with a dated codebase. However, wij have an ambitious objective of using the latest Litecoin code, due to all the security and voorstelling improvements they merged ter from Bitcoin, plus support for Segwit. So, wij have a challenge of developing a method to compute the values on our own.
Wij could search for the original code or use an example of one, but it may well have to be ported overheen and debugged. There are several OSS standalone Genesis Block hashing programs te C, Go, and Python, that we’ll evaluate further.