Author

Topic: How to change the merkel hash of some cryptocoin? (Read 1059 times)

legendary
Activity: 1540
Merit: 1001
Crypto since 2014
November 10, 2014, 03:09:15 PM
#5
i did that all yesterday too,but when i come to testnet, to create merkel ,it just does nothing,i can wait hours

I normally just skip the test net and go straight to the main net. It is less confusing that way.
member
Activity: 70
Merit: 10
i did that all yesterday too,but when i come to testnet, to create merkel ,it just does nothing,i can wait hours
member
Activity: 70
Merit: 10
for example litecoindark, i wanna fork it
Follow this guide: http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guide

You'll also need the genesis mining code. I found it with a quick google.

Here it is:
Quote
    // If genesis block hash does not match, then generate new genesis hash.
    if (true && block.GetHash() != hashGenesisBlock)
    {
        printf("Searching for genesis block...\n");
        // This will figure out a valid hash and Nonce if you're
        // creating a different genesis block:
        uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
        uint256 thash;

        while(true)
        {
            thash = scrypt_blockhash(BEGIN(block.nVersion));
            if (thash <= hashTarget)
                break;
            if ((block.nNonce & 0xFFF) == 0)
            {
                printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
            }
            ++block.nNonce;
            if (block.nNonce == 0)
            {
                printf("NONCE WRAPPED, incrementing time\n");
                ++block.nTime;
            }
        }
        printf("block.nTime = %u \n", block.nTime);
        printf("block.nNonce = %u \n", block.nNonce);
        printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());
Source: http://stackoverflow.com/questions/20772606/how-to-create-a-genesis-block-of-my-altercoin
(I added "true &&" to the beginning so it is easier to follow the tutorial.

Place it above block.print() in main.cpp.
tnx to u
legendary
Activity: 1540
Merit: 1001
Crypto since 2014
for example litecoindark, i wanna fork it
Follow this guide: http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guide

You'll also need the genesis mining code. I found it with a quick google.

Here it is:
Quote
    // If genesis block hash does not match, then generate new genesis hash.
    if (true && block.GetHash() != hashGenesisBlock)
    {
        printf("Searching for genesis block...\n");
        // This will figure out a valid hash and Nonce if you're
        // creating a different genesis block:
        uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
        uint256 thash;

        while(true)
        {
            thash = scrypt_blockhash(BEGIN(block.nVersion));
            if (thash <= hashTarget)
                break;
            if ((block.nNonce & 0xFFF) == 0)
            {
                printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
            }
            ++block.nNonce;
            if (block.nNonce == 0)
            {
                printf("NONCE WRAPPED, incrementing time\n");
                ++block.nTime;
            }
        }
        printf("block.nTime = %u \n", block.nTime);
        printf("block.nNonce = %u \n", block.nNonce);
        printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());
Source: http://stackoverflow.com/questions/20772606/how-to-create-a-genesis-block-of-my-altercoin
(I added "true &&" to the beginning so it is easier to follow the tutorial.

Place it above block.print() in main.cpp.
member
Activity: 70
Merit: 10
for example litecoindark, i wanna fork it
Jump to: