Hello, I am having some problems with the genesis block. I am new to C++, but what I know is that because my assert of the genesis hash is failing, it means that I am putting the wrong genesis hash. Here is my code for generating the genesis hash (I'm using the genesis generator from
https://github.com/hashcrack256/node-genesis-block):
node genesis -p 040839e4f568674e93581cf1db43a7b09a8ba9d440bad64b296c1554cf7c9c9714d1b5d19c3aadc01647ab41266d4fe2745afa72166c3d69a66cd35c4f3a0b5de0 -t 1618258400 -n 404483 -a sha256d -v 5000000000 -z "Ion got it on me." -b 0x1d00ffff
And in my chainparams.cpp:
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "Ion got it on me.";
const CScript genesisOutputScript = CScript() << ParseHex("040839e4f568674e93581cf1db43a7b09a8ba9d440bad64b296c1554cf7c9c9714d1b5d19c3aadc01647ab41266d4fe2745afa72166c3d69a66cd35c4f3a0b5de0") << OP_CHECKSIG;
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
As well as:
genesis = CreateGenesisBlock(1618258400, 404483, 0x1d00ffff, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000005a48ef8e68ac2f26d0987784eaace9dc304f9f579a652f83c958d5fadb1"));
assert(genesis.hashMerkleRoot == uint256S("0x941d67c6b23e01ae4f16284613133be33c46d23d38fe150c34ab92bc7bd04176"));
What exactly am I missing? What missing parameter am I missing that affects the genesis hash, so that the assert fails? The reason I'm not using your provided genesis generator is because it gives me a ton of
chainparams.cpp:27:5: error: ‘arith_uint256’ was not declared in this scope
errors for more than just line 27. What I'm doing to put your code into chainparams.cpp, is copy and pasting
https://raw.githubusercontent.com/NicolasChoukroun/altcoin-genesis/master/creategenesis.cpp under all of the #include in chainparams.cpp. There is probably something I'm doing wrong here, and I'm way too new to C++ to know what I'm doing wrong. Any help would be greatly appreciated!