Bitcoin Forum
June 14, 2024, 05:51:09 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Altcoin error  (Read 129 times)
dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 23, 2021, 06:38:44 AM
 #1

Hi All

Just trying to create a altocoin but keep getting the following:

ERROR: LoadBlockIndexGuts: CheckProofOfWork failed: CBlockIndex(pprev=0, nHeight=0, merkle=c298c8e917156163387f87789bf0d933a4f1e9ef07d72250907af59b407f02ef, hashBlock=00000000f5cc3785e66f40b2ccfa9b44997b8c5d4df7c4af3f03d999b1582fe1)


I used the following method to mine my genesis block:
https://bitcointalk.org/index.php?topic=5134256.0

It seems like it got the right details for main and test net. If i put a random genesis block it fails with the following:

chainparams.cpp:257: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x00000000f59f133f1c0b427081a348db846d8cfc919d478a4b0e3529dcb8aezz")' failed.
Aborted (core dumped)


Any help would be much appreciated.

Thanks

dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 23, 2021, 06:46:39 AM
 #2

Additional info:

2021-07-23T06:43:24Z init message: Loading block index...
2021-07-23T06:43:24Z Opening LevelDB in /home/ubuntu/.cerebralcoin/blocks/index
2021-07-23T06:43:24Z Opened LevelDB successfully
2021-07-23T06:43:24Z Using obfuscation key for /home/ubuntu/.cerebralcoin/blocks/index: 0000000000000000
2021-07-23T06:43:24Z ERROR: LoadBlockIndexGuts: CheckProofOfWork failed: CBlockIndex(pprev=0, nHeight=0, merkle=c298c8e917156163387f87789bf0d933a4f1e9ef07d72250907af59b407f02ef, hashBlock=00000000f5cc3785e66f40b2ccfa9b44997b8c5d4df7c4af3f03d999b1582fe1)
2021-07-23T06:43:24Z : Error loading block database.
Please restart with -reindex or -reindex-chainstate to recover.
: Error loading block database.
Please restart with -reindex or -reindex-chainstate to recover.
2021-07-23T06:43:24Z Aborted block database rebuild. Exiting.
2021-07-23T06:43:24Z Shutdown: In progress...
2021-07-23T06:43:24Z scheduler thread interrupt
2021-07-23T06:43:24Z Shutdown: done


Also if i restart iwth the -reindex flag it just locks up
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1554
Merit: 7546


Protocols over bureaucrats


View Profile
July 23, 2021, 06:47:39 AM
 #3

I don't know what's wrong with that implementation (probably nothing), but I had tried it with Remember remember the 5th of November's genesis generator and it worked: [ANN] Genesis Block Generator

Be aware and don't do the same mistake I had done. You'll have to replace genesis.hashMerkleRoot with the byteswapped result.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 24, 2021, 02:55:56 AM
 #4

./genesis_generator 040a5250da9b77dbc0055c01a8f0a5c65d84002267812548c0dc4d340a52ec3d1dcc748870a8ff4 12dee73a163ef33216f4f2e316cce85fe85d85f784a9cc08a42 "BBC 2/Jul/2021 Italy beat England on penalties to win Euro 2020" 0x1e0ffff0

Coinbase: 010001043f42424320322f4a756c2f32303231204974616c79206265617420456e676c616e64206 f6e2070656e616c7469657320746f2077696e204575726f2032303230

PubkeyScript: 41040a5250da9b77dbc0055c01a8f0a5c65d84002267812548c0dc4d340a52ec3d1dcc748870a8f f412dee73a163ef33216f4f2e316cce85fe85d85f784a9cc08a42ac

Merkle Hash: 8aefb3a9fc1ca9746c3cbbbfc7a436a64c69d0dd829640e967576efaa70d2351
Byteswapped: 51230da7fa6e5767e9409682ddd0694ca636a4c7bfbb3c6c74a91cfca9b3ef8a
Generating block...
1600507 Hashes/s, Nonce 171116727
Block found!
Hash: 0000000098024f2ee61aa77cf797ebaf6b96b0eca7106b554c086c2b87672d73
Nonce: 171975643
Unix time: 1627093404

I tried the script and got the above. so added the required lines:
    genesis = CreateGenesisBlock(1627093404, 171975643, 0x1e0ffff0, 1, 50 * COIN);
    consensus.hashGenesisBlock = genesis.GetHash();
    assert(consensus.hashGenesisBlock == uint256S("0x0000000098024f2ee61aa77cf797ebaf6b96b0eca7106b554c086c2b87672d73"));
    assert(genesis.hashMerkleRoot == uint256S("0x51230da7fa6e5767e9409682ddd0694ca636a4c7bfbb3c6c74a91cfca9b3ef8a"));

But go the following when i ran:

CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x0000000098024f2ee61aa77cf797ebaf6b96b0eca7106b554c086c2b87672d73")' failed.
Aborted (core dumped)

So seems like the genesisBlock isnt right maybe?

BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1554
Merit: 7546


Protocols over bureaucrats


View Profile
July 24, 2021, 05:46:46 AM
 #5

Have you changed the pszTimestamp in line 53? You should enter your genesis message there; if you left Satoshi's it'd be justified to not operate properly.

Have you also changed the genesisOutputScript in line 54? You should enter your public key there.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 25, 2021, 09:04:53 AM
 #6

Yup changed it in there

static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
    const char* pszTimestamp = "BBC 2/Jul/2021 Italy beat England on penalties to win Euro 2020";
    const CScript genesisOutputScript = CScript() << ParseHex("040a5250da9b77dbc0055c01a8f0a5c65d84002267812548c0dc4d340a52ec3d1dcc748870a8ff4 12dee73a163ef33216f4f2e316cce85fe85d85f784a9cc08a42") << OP_CHECKSIG;
    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}

Tried again to create genesis block:
./genesis_generator 040a5250da9b77dbc0055c01a8f0a5c65d84002267812548c0dc4d340a52ec3d1dcc748870a8ff4 12dee73a163ef33216f4f2e316cce85fe85d85f784a9cc08a42 "BBC 2/Jul/2021 Italy beat England on penalties to win Euro 2020" 0x1e0ffff0

Coinbase: 010001043f42424320322f4a756c2f32303231204974616c79206265617420456e676c616e64206 f6e2070656e616c7469657320746f2077696e204575726f2032303230

PubkeyScript: 41040a5250da9b77dbc0055c01a8f0a5c65d84002267812548c0dc4d340a52ec3d1dcc748870a8f f412dee73a163ef33216f4f2e316cce85fe85d85f784a9cc08a42ac

Merkle Hash: 8aefb3a9fc1ca9746c3cbbbfc7a436a64c69d0dd829640e967576efaa70d2351
Byteswapped: 51230da7fa6e5767e9409682ddd0694ca636a4c7bfbb3c6c74a91cfca9b3ef8a
Generating block...
1680454 Hashes/s, Nonce 2841872302
Block found!
Hash: 00000000ff6b4a379aefb19c1d37825581c6735a43baea81f2695e4dea10103e
Nonce: 2843361029
Unix time: 1627201294



Using the values created:

genesis = CreateGenesisBlock(1627201294, 2843361029, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x00000000ff6b4a379aefb19c1d37825581c6735a43baea81f2695e4dea10103e")); //seems to be wrong
assert(genesis.hashMerkleRoot == uint256S("0x51230da7fa6e5767e9409682ddd0694ca636a4c7bfbb3c6c74a91cfca9b3ef8a")); //using byteswapped

I cant seem to find what i have done wrong. I keep getting the following:
cerebralcoind: chainparams.cpp:190: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x00000000ff6b4a379aefb19c1d37825581c6735a43baea81f2695e4dea10103e")' failed.
Aborted (core dumped)

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!