Generating first block after genesis block in PoS altcoin

Generating first block after genesis block in PoS altcoin

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:

    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 - 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:

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?..)))

https://ift.tt/2NCq3M8

Comments

Popular posts from this blog

bitcoin node: what is the difference between simnet and regtest?

How to check if Electrum is masking my IP with the Tor proxy?

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password