Bitcoin Forum
May 27, 2024, 03:11:26 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: Genesis block  (Read 804 times)
Apocalipsis (OP)
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
February 23, 2014, 09:53:06 PM
 #1

Hi.
I want to create one coin for personal usage,and I am taking Franko coin,as a source.
Can somebody tell me ,how can I mine the genesis block,what should I change,if I have got such code?
Code:
    block.nTime    = 1393188908; //Your time zone: 5/9/2013
        block.nBits    = 0x1e0ffff0;
        block.nNonce   = 731837;

        if (fTestNet)
        {
            block.nTime    = 1393188907;// 7357 TEST
            block.nNonce   = 385607496;
        }

        //// debug print
        uint256 hash = block.GetHash();
        printf("%s\n", hash.ToString().c_str());
        printf("%s\n", hashGenesisBlock.ToString().c_str());
        printf("%s\n", block.hashMerkleRoot.ToString().c_str());
        assert(block.hashMerkleRoot == uint256("0xb78f79f1d10029cc45ed3d5a1db7bd423d4ee170c03baf110a62565d16a21dca"));
        block.print();
        assert(hash == hashGenesisBlock);

        // Start new block file
        try {
            unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
            CDiskBlockPos blockPos;
            CValidationState state;
            if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime))
                return error("LoadBlockIndex() : FindBlockPos failed");
            if (!block.WriteToDisk(blockPos))
                return error("LoadBlockIndex() : writing genesis block to disk failed");
            if (!block.AddToBlockIndex(state, blockPos))
                return error("LoadBlockIndex() : genesis block not accepted");
        } catch(std::runtime_error &e) {
            return error("LoadBlockIndex() : failed to initialize block database: %s", e.what());
        }
    }

    return true;
}



void PrintBlockTree()
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
February 23, 2014, 10:15:37 PM
 #2

https://bitcointalk.org/index.php?topic=391983.msg4223449#msg4223449
Apocalipsis (OP)
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
February 23, 2014, 10:41:44 PM
 #3


Much appreciate!
Apocalipsis (OP)
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
February 23, 2014, 11:05:11 PM
 #4


But I get this error.
I tried to fix it,but couldn't/
Code:
src/main.cpp: In function 'bool InitBlockIndex()'
src/main.php 2903:95: error scrypt_1024_1_1_256_sp_generic was now declared in this scope/
Makefile.Release:1163: recipe for targer 'build/main.o' failed
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!