for example litecoindark, i wanna fork it
Follow this guide:
http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guideYou'll also need the genesis mining code. I found it with a quick google.
Here it is:
// 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.