New coin daemon crashes ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)

New coin daemon crashes ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)

Hi so I generated the genesis block using

 std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain)
 {
if (chain == CBaseChainParams::MAIN)
    return std::unique_ptr<CChainParams>(new CMainParams());
else if (chain == CBaseChainParams::TESTNET)
    return std::unique_ptr<CChainParams>(new CTestNetParams());
else if (chain == CBaseChainParams::REGTEST)
    return std::unique_ptr<CChainParams>(new CRegTestParams());
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
 }

 void SelectParams(const std::string& network)
 {
SelectBaseParams(network);
globalChainParams = CreateChainParams(network);
 }

 void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
 {
globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout);
 }
 void MineGenesisBlock(CBlock &genesis)
 {
 arith_uint256 best = arith_uint256();
 int n=0;
 arith_uint256 hashTarget = arith_uint256().SetCompact(genesis.nBits);
 while (UintToArith256(genesis.GetHash()) > hashTarget) {
 arith_uint256 c=UintToArith256(genesis.GetHash());

 if(c < best || n==0)
 {
 best = c;
 n=1;
 printf("%s %s %s\n",genesis.GetHash().GetHex().c_str(),hashTarget.GetHex().c_str(),
 best.GetHex().c_str());
 }
 ++genesis.nNonce;
 if (genesis.nNonce == 0) { ++genesis.nTime; }
 }
 //printf("HASH IS: %s\n", UintToArith256(genesis.GetHash()).ToString().c_str());
 printf("Converting genesis hash to string: %s\n",genesis.ToString().c_str());
 }

in the chainparams.cpp.
I updated chainparams.cpp which now looks like (for mainnet)

class CMainParams : public CChainParams {
public:
CMainParams() {
    strNetworkID = "main";
    consensus.nSubsidyHalvingInterval = 4204800;
    consensus.BIP34Height = 710000;
    consensus.BIP34Hash = uint256S("0x");
    consensus.BIP65Height = 918684; // bab3041e8977e0dc3eeff63fe707b92bde1dd449d8efafb248c27c8264cc311a
    consensus.BIP66Height = 811879; // 7aceee012833fa8952f8835d8b1b3ae233cd6ab08fdb27a771d2bd7bdc491894
    consensus.powLimit = uint256S("000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
    consensus.nPowTargetTimespan = 60 * 60; // 1 hour
    consensus.nPowTargetSpacing = 30; //30 seconds
    consensus.fPowAllowMinDifficultyBlocks = true;
    consensus.fPowNoRetargeting = false;
    consensus.nRuleChangeActivationThreshold = 6048; // 75% of 8064
    consensus.nMinerConfirmationWindow = 8064; // nPowTargetTimespan / nPowTargetSpacing * 4
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
    consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008

    // Deployment of BIP68, BIP112, and BIP113.
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1522425880; // March 19th, 2018
    consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1555745400; // April 20th, 2019

    // Deployment of SegWit (BIP141, BIP143, and BIP147)
    consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
    consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1522425880; // March 19th, 2018
    consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1555745400; // April 20th, 2019

    // The best chain should have at least this much work.
    consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");

    // By default assume that the signatures in ancestors of this block are valid.
    consensus.defaultAssumeValid = uint256S("0x000004f4a1b621addbc20231d4eebbea37b98e51f8bb9b49d0a43a44bd8bcb4f"); //1353397

    /**
     * The message start string is designed to be unlikely to occur in normal data.
     * The characters are rarely used upper ASCII, not valid as UTF-8, and produce
     * a large 32-bit integer with any alignment.
     */
    pchMessageStart[0] = 0xf2;
    pchMessageStart[1] = 0xc7;
    pchMessageStart[2] = 0xb2;
    pchMessageStart[3] = 0xd3;
    nDefaultPort = 3333;
    nPruneAfterHeight = 100000;

    genesis = CreateGenesisBlock(1522425880, 1417710, 0x1e0ffff0, 1, 64 * COIN);
    consensus.hashGenesisBlock = genesis.GetHash();
//MineGenesisBlock(genesis);
    assert(consensus.hashGenesisBlock == uint256S("0x000004f4a1b621addbc20231d4eebbea37b98e51f8bb9b49d0a43a44bd8bcb4f"));
    assert(genesis.hashMerkleRoot == uint256S("0x72e38d1b2fb983abb19bbb5fbbc189eeccaf9e3e313f104063ab2f4a50cbae35"));

    // Note that of those with the service bits flag, most only support a subset of possible options
    vSeeds.emplace_back("198.199.89.249", true);

    base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,26);
    base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
    base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,50);
    base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,176);
    base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
    base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};

    vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));

    fDefaultConsistencyChecks = false;
    fRequireStandard = true;
    fMineBlocksOnDemand = false;

    checkpointData = (CCheckpointData) {
        {
            {  0, uint256S("0x")},
        }
    };

    chainTxData = ChainTxData{
        // Data as of block 59c9b9d3fec105bdc716d84caa7579503d5b05b73618d0bf2d5fa639f780a011 (height 1353397).
        1522425880, // * UNIX timestamp of last known number of transactions
        0,  // * total number of transactions between genesis and that timestamp
                //   (the tx=... number in the SetBestChain debug.log lines)
        0.00     // * estimated number of transactions per second after that timestamp
    };
}
};  

but when I run honeycombd it says check debug.log which looks like

2018-03-30 16:54:24 Honeycomb version v0.16.0.1-8c413e0-dirty
2018-03-30 16:54:24 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-03-30 16:54:24 Assuming ancestors of block 000004f4a1b621addbc20231d4eebbea37b98e51f8bb9b49d0a43a44bd8bcb4f have valid signatures.
2018-03-30 16:54:24 Using the 'standard' SHA256 implementation
2018-03-30 16:54:24 Using RdRand as an additional entropy source
2018-03-30 16:54:24 Default data directory /root/.honeycomb
2018-03-30 16:54:24 Using data directory /root/.honeycomb
2018-03-30 16:54:24 Using config file /root/.honeycomb/honeycomb.conf
2018-03-30 16:54:24 Using at most 125 automatic connections (1024 file descriptors available)
2018-03-30 16:54:24 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-03-30 16:54:24 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-03-30 16:54:24 Using 2 threads for script verification
2018-03-30 16:54:24 scheduler thread start
2018-03-30 16:54:24 HTTP: creating work queue of depth 16
2018-03-30 16:54:24 Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation.
2018-03-30 16:54:24 HTTP: starting 4 worker threads
2018-03-30 16:54:24 init message: Verifying wallet(s)...
2018-03-30 16:54:24 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-03-30 16:54:24 Using wallet wallet.dat
2018-03-30 16:54:24 CDBEnv::Open: LogDir=/root/.honeycomb/database ErrorFile=/root/.honeycomb/db.log
2018-03-30 16:54:24 Cache configuration:
2018-03-30 16:54:24 * Using 2.0MiB for block index database
2018-03-30 16:54:24 * Using 8.0MiB for chain state database
2018-03-30 16:54:24 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-03-30 16:54:24 init message: Loading block index...
2018-03-30 16:54:24 Opening LevelDB in /root/.honeycomb/blocks/index
2018-03-30 16:54:24 Opened LevelDB successfully
2018-03-30 16:54:24 Using obfuscation key for /root/.honeycomb/blocks/index: 0000000000000000
2018-03-30 16:54:24 LoadBlockIndexDB: last block file = 0
2018-03-30 16:54:24 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2018-03-30 16:54:24 Checking all blk files are present...
2018-03-30 16:54:24 LoadBlockIndexDB: transaction index disabled
2018-03-30 16:54:24 Initializing databases...
2018-03-30 16:54:24 Pre-allocating up to position 0x1000000 in blk00000.dat
2018-03-30 16:54:24 Opening LevelDB in /root/.honeycomb/chainstate
2018-03-30 16:54:24 Opened LevelDB successfully
2018-03-30 16:54:24 Using obfuscation key for /root/.honeycomb/chainstate: 6b88b7971b9e4a0a
2018-03-30 16:54:24 init message: Rewinding blocks...
2018-03-30 16:54:24  block index               7ms
2018-03-30 16:54:24 init message: Loading wallet...
2018-03-30 16:54:24 nFileVersion = 160001
2018-03-30 16:54:24 Keys: 2002 plaintext, 0 encrypted, 2002 w/ metadata, 2002 total
2018-03-30 16:54:24  wallet                   51ms
2018-03-30 16:54:24 setKeyPool.size() = 2000
2018-03-30 16:54:24 mapWallet.size() = 0
2018-03-30 16:54:24 mapAddressBook.size() = 1
2018-03-30 16:54:24 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2018-03-30 16:54:24 *** Failed to read block
2018-03-30 16:54:24 Error: Error: A fatal internal error occurred, see debug.log for details  

what am I doing wrong?

https://ift.tt/2Grb1UX

Comments

Popular posts from this blog

sendrawtransaction and txn-mempool-conflict

couldn't connect to server: EOF reached (code 1)