Bitcoin Forum
April 25, 2024, 04:45:25 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Source revision, Assertion `globalChainParams' failed  (Read 201 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 27, 2018, 01:03:31 PM
 #1

So I added 2 lines to bitcoin's newest source for validate & create genesis block.

at chainparams.cpp,

Code:
genesis = CreateGenesisBlock(1519619579, 44453, 0x1f00ffff, 1, 500 * COIN);  
const Consensus::Params& consensusParams = Params().GetConsensus();
while(!CheckProofOfWork(genesis.GetHash(), genesis.nBits, consensusParams)){ ++genesis.nNonce; }

but after compile (by 'make', 'make install'), and run (by './xxxcoind'), following errors.

lee@newlite:~/Desktop/BitcoinEssence/src$ ./bitcoinessenced bitcoinessenced: chainparams.cpp:524: const CChainParams& Params(): Assertion `globalChainParams' failed. Aborted (core dumped)

chainparams.cpp:524 line is,


Code:
const CChainParams &Params() {
    assert(globalChainParams);  // this is 524 line.
    return *globalChainParams;
}


Why and how to solve this? Thanks..
1714020325
Hero Member
*
Offline Offline

Posts: 1714020325

View Profile Personal Message (Offline)

Ignore
1714020325
Reply with quote  #2

1714020325
Report to moderator
1714020325
Hero Member
*
Offline Offline

Posts: 1714020325

View Profile Personal Message (Offline)

Ignore
1714020325
Reply with quote  #2

1714020325
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714020325
Hero Member
*
Offline Offline

Posts: 1714020325

View Profile Personal Message (Offline)

Ignore
1714020325
Reply with quote  #2

1714020325
Report to moderator
1714020325
Hero Member
*
Offline Offline

Posts: 1714020325

View Profile Personal Message (Offline)

Ignore
1714020325
Reply with quote  #2

1714020325
Report to moderator
1714020325
Hero Member
*
Offline Offline

Posts: 1714020325

View Profile Personal Message (Offline)

Ignore
1714020325
Reply with quote  #2

1714020325
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
February 27, 2018, 08:52:07 PM
Merited by Foxpup (1), bob123 (1)
 #2

Then instead of using the checkproofofwork function, copy out its code into your while loop and refer to the variables directly from within the ChainParams. This is simple programming debugging and troubleshooting, you should not need hand holding and someone to tell you exactly what to do.



Not gonna lie, the fact that you are constantly asking for people to give you specific, hand holding instructions both here and on Bitcoin Stack Exchange indicates to me that you should not be creating your own cryptocurrency. Even "just for educational purposes", you should understand how to read and write code before doing this. You can learn how cryptocurrencies work without reading the code anyways, there's lots of documentation on the specifics. The things that you are asking are simple programming questions that you should be able to figure out yourself.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 28, 2018, 06:32:26 AM
 #3

Then instead of using the checkproofofwork function, copy out its code into your while loop and refer to the variables directly from within the ChainParams. This is simple programming debugging and troubleshooting, you should not need hand holding and someone to tell you exactly what to do.
Even after doing that, still debug.log says ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)...

Seems there is no hope...

AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
February 28, 2018, 12:35:43 PM
Last edit: February 28, 2018, 02:06:36 PM by AdolfinWolf
 #4

Then instead of using the checkproofofwork function, copy out its code into your while loop and refer to the variables directly from within the ChainParams. This is simple programming debugging and troubleshooting, you should not need hand holding and someone to tell you exactly what to do.
Even after doing that, still debug.log says ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)...

Seems there is no hope...



Note that i am not an expert in coding and debugging, but this error
Code:
CBlockDiskPos(nFile=0, nPos=8)...
might have something to do with you having an invalid hash/nounce..

See this as reference; https://bitcoin.stackexchange.com/questions/60299/altcoin-creation-from-bitcoin-readblockfromdisk-errors-in-block-header-at-cbloc

But it seems that you've already read that answer, assuming you're leegod on SE?

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
March 01, 2018, 04:59:55 AM
 #5

Then instead of using the checkproofofwork function, copy out its code into your while loop and refer to the variables directly from within the ChainParams. This is simple programming debugging and troubleshooting, you should not need hand holding and someone to tell you exactly what to do.
Even after doing that, still debug.log says ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)...

Seems there is no hope...



Note that i am not an expert in coding and debugging, but this error
Code:
CBlockDiskPos(nFile=0, nPos=8)...
might have something to do with you having an invalid hash/nounce..

See this as reference; https://bitcoin.stackexchange.com/questions/60299/altcoin-creation-from-bitcoin-readblockfromdisk-errors-in-block-header-at-cbloc

But it seems that you've already read that answer, assuming you're leegod on SE?
yes I already read it. leegod is my nickname. And as first reply of that thread said, it doesn't work with new source. Still has CBlockDiskPos error.
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!