Bitcoin Forum
April 26, 2024, 07:14:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Generating first block after genesis  (Read 191 times)
crontabaltlinux (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
March 03, 2019, 05:58:05 AM
 #1

Hi! I'm currently developing a test altcoin in educational purposes, and can't for some reason generate first pow blocks after generating genesis block. Couple of years ago i successfully made workable fork of fork of dash (or something similar with terribly outdated codebase), but I'm totally unable to reproduce it with modern codebase.

So, to the point. I used PIVX repo, changed chainparams.cpp accordingly:

- removed old checkpoints;
- generated new keys;
- updated ports all over the codebase;
- changed pchMessageStart numbers;
- updated unixtime;
- changed coin name all over the codebase;
- generated genesis (and it was correct, i checked it many times);
- compiled it;
- launched coind;
- launched cpuminer, and it failed with the following in log:

Code:
2019-02-28 16:55:09 ERROR: CheckProofOfWork() : hash doesn't match nBits
2019-02-28 16:55:09 ERROR: CheckBlockHeader() : proof of work failed
2019-02-28 16:55:09 ERROR: CheckBlock() : CheckBlockHeader failed
2019-02-28 16:55:09 CreateNewBlock() : TestBlockValidity failed

I re-generated genesis with code in chainparams.cpp - it was the same as with genesis generator. I tried gen=1 and setgenerate true, and again received the same error, and hashespersec=0 in getmininginfo.

I started searching the web, and found a lot of same questions without any answer. For example, this one looks absolutely same - https://bitcoin.stackexchange.com/questions/79767/cannot-mine-genesis-first-block-pivx-fork-clone

I tried the kind of solution from this thread - https://bitcointalk.org/index.php?topic=2152157.0;prev_next=next - but without any success too.

I assumed that maybe i'm missing something, and tried to do the same with some other PIVX forks. The first one was this - https://github.com/IchibaCoin/ICHIBA - with the same error. The second one was this - https://github.com/cruxcoinsource/CruxCoin - with the same error too. Then i scratched my head, thought deeply, and run diff for all files in /src/ folder of both coins with my testcoin. Files were totally same and differed only where they were different between crux and ichiba.

I tried all possible combinations of bools in this part of chainparams.cpp:

Code:
fMiningRequiresPeers = true;
fAllowMinDifficultyBlocks = false;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
fTestnetToBeDeprecatedFieldRPC = false;
fHeadersFirstSyncingActive = false;

And when fMineBlocksOnDemand was set to true, command setgenerate true returned that wallet keypool is empty, and keypoolrefill command had no effect.

What am i doing wrong?..)))
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714158879
Hero Member
*
Offline Offline

Posts: 1714158879

View Profile Personal Message (Offline)

Ignore
1714158879
Reply with quote  #2

1714158879
Report to moderator
1714158879
Hero Member
*
Offline Offline

Posts: 1714158879

View Profile Personal Message (Offline)

Ignore
1714158879
Reply with quote  #2

1714158879
Report to moderator
1714158879
Hero Member
*
Offline Offline

Posts: 1714158879

View Profile Personal Message (Offline)

Ignore
1714158879
Reply with quote  #2

1714158879
Report to moderator
ShllFT
Jr. Member
*
Offline Offline

Activity: 117
Merit: 1


View Profile
December 23, 2020, 12:28:25 AM
 #2

Hi! I'm currently developing a test altcoin in educational purposes, and can't for some reason generate first pow blocks after generating genesis block. Couple of years ago i successfully made workable fork of fork of dash (or something similar with terribly outdated codebase), but I'm totally unable to reproduce it with modern codebase.

So, to the point. I used PIVX repo, changed chainparams.cpp accordingly:

- removed old checkpoints;
- generated new keys;
- updated ports all over the codebase;
- changed pchMessageStart numbers;
- updated unixtime;
- changed coin name all over the codebase;
- generated genesis (and it was correct, i checked it many times);
- compiled it;
- launched coind;
- launched cpuminer, and it failed with the following in log:

Code:
2019-02-28 16:55:09 ERROR: CheckProofOfWork() : hash doesn't match nBits
2019-02-28 16:55:09 ERROR: CheckBlockHeader() : proof of work failed
2019-02-28 16:55:09 ERROR: CheckBlock() : CheckBlockHeader failed
2019-02-28 16:55:09 CreateNewBlock() : TestBlockValidity failed

I re-generated genesis with code in chainparams.cpp - it was the same as with genesis generator. I tried gen=1 and setgenerate true, and again received the same error, and hashespersec=0 in getmininginfo.

I started searching the web, and found a lot of same questions without any answer. For example, this one looks absolutely same - https://bitcoin.stackexchange.com/questions/79767/cannot-mine-genesis-first-block-pivx-fork-clone

I tried the kind of solution from this thread - https://bitcointalk.org/index.php?topic=2152157.0;prev_next=next - but without any success too.

I assumed that maybe i'm missing something, and tried to do the same with some other PIVX forks. The first one was this - https://github.com/IchibaCoin/ICHIBA - with the same error. The second one was this - https://github.com/cruxcoinsource/CruxCoin - with the same error too. Then i scratched my head, thought deeply, and run diff for all files in /src/ folder of both coins with my testcoin. Files were totally same and differed only where they were different between crux and ichiba.

I tried all possible combinations of bools in this part of chainparams.cpp:

Code:
fMiningRequiresPeers = true;
fAllowMinDifficultyBlocks = false;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
fTestnetToBeDeprecatedFieldRPC = false;
fHeadersFirstSyncingActive = false;

And when fMineBlocksOnDemand was set to true, command setgenerate true returned that wallet keypool is empty, and keypoolrefill command had no effect.

What am i doing wrong?..)))

Have you solved it?
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!