Bitcoin Forum
May 23, 2024, 10:02:35 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 1 ~ 5 LTC- Help me Create Genesis Block for My altcoin  (Read 1233 times)
Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 14, 2014, 02:22:57 AM
 #1

Hi ALL:
I also want to make a Altcoin, however, I encountered a problem..
I hope to create a POS altcoin, I downloaded the ITC source code: https://github.com/information-coin/informationcoin
I want to create a Genesis Block,I hope to have a similar litecoin Genesis code, to help me.
Dear coders, help me, I am a poor student, I have 5 LTC, can give you
Code:
// This part was used to generate the genesis block.
// Uncomment to use it again.

// 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;
char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
loop
{
#if defined(USE_SSE2)
// Detection would work, but in cases where we KNOW it always has SSE2,
// it is faster to use directly than to use a function pointer or conditional.
#if defined(_M_X64) || defined(__x86_64__) || defined(_M_AMD64) || (defined(MAC_OSX) && defined(__i386__))
// Always SSE2: x86_64 or Intel MacOS X
scrypt_1024_1_1_256_sp_sse2(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#else
// Detect SSE2: 32bit x86 Linux or Windows
scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#endif
#else
// Generic scrypt
scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
#endif
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());
}
El Dude
Hero Member
*****
Offline Offline

Activity: 770
Merit: 500


View Profile
May 14, 2014, 04:48:57 AM
 #2

Stop making crap coins .

Bitcoin and Litecoin hodler
Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 14, 2014, 06:47:25 AM
 #3

I also want to have a altcoin... It even junk, I also want to have one..  Grin Grin Grin Grin Grin Grin
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
May 14, 2014, 11:43:18 AM
 #4

Here is the tutorial:
https://bitcointalk.org/index.php?topic=391983.msg4223449#msg4223449

Elbandi
RomeoCharlie
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
May 14, 2014, 12:48:34 PM
 #5

Stop making crap coins .

 Cheesy Cheesy Cheesy
true... true...
what's more funny - is to ask some questions here, where everyone is your enemy ))
Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 14, 2014, 12:52:18 PM
 #6

Thank you!!!!
It prompts the error:

Code:
2014-05-14 12:32:23 Litecoin version v0.8.6.2-gfe7b87a-beta (Thu, 9 Jan 2014 15:38:53 -1000)
2014-05-14 12:32:23 Using OpenSSL version OpenSSL 1.0.1g 7 Apr 2014
2014-05-14 12:32:23 Default data directory C:\Users\cckkk\AppData\Roaming\Litecoin
2014-05-14 12:32:23 Using data directory C:\Users\cckkk\AppData\Roaming\Litecoin
2014-05-14 12:32:23 Using at most 125 connections (2048 file descriptors available)
2014-05-14 12:32:23 init message: Verifying wallet...
2014-05-14 12:32:23 dbenv.open LogDir=C:\Users\cckkk\AppData\Roaming\Litecoin\database ErrorFile=C:\Users\cckkk\AppData\Roaming\Litecoin\db.log
2014-05-14 12:32:23 Bound to [::]:9441
2014-05-14 12:32:23 Bound to 0.0.0.0:9441
2014-05-14 12:32:23 init message: Loading block index...
2014-05-14 12:32:23 Opening LevelDB in C:\Users\cckkk\AppData\Roaming\Litecoin\blocks\index
2014-05-14 12:32:23 Opened LevelDB successfully
2014-05-14 12:32:23 Opening LevelDB in C:\Users\cckkk\AppData\Roaming\Litecoin\chainstate
2014-05-14 12:32:23 Opened LevelDB successfully
2014-05-14 12:32:23 LoadBlockIndexDB(): last block file = 0
2014-05-14 12:32:23 LoadBlockIndexDB(): transaction index disabled
2014-05-14 12:32:23 Initializing databases...
2014-05-14 12:32:23 3b8e68113b0642ec7a9f8d0abd4b8812900f37040a4ca7ab221453b21960a46b
2014-05-14 12:32:23 3b8e68113b0642ec7a9f8d0abd4b8812900f37040a4ca7ab221453b21960a46b
2014-05-14 12:32:23 8616fea39dec184c9b4c749d6ed93edc13fadcdb536dc6b8736f79ee9660a318
2014-05-14 12:32:23 CBlock(hash=3b8e68113b0642ec7a9f8d0abd4b8812900f37040a4ca7ab221453b21960a46b, input=01000000000000000000000000000000000000000000000000000000000000000000000018a36096ee796f73b8c66d53dbdcfa13dc3ed96e9d744c9b4c18ec9da3fe1686a1b96153f0ff0f1e6d9b2b00, PoW=00000eeea7e66a24081f91b3442f11a51a23571a1e6bbed53debbfc0bd229990, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=8616fea39dec184c9b4c749d6ed93edc13fadcdb536dc6b8736f79ee9660a318, nTime=1398913441, nBits=1e0ffff0, nNonce=2857837, vtx=1)
2014-05-14 12:32:23   CTransaction(hash=8616fea39dec184c9b4c749d6ed93edc13fadcdb536dc6b8736f79ee9660a318, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d01044c6b4d6179203173742c20323031342c476f6c644265616e7320697320616e20696e746572657374696e6720636f756e74696e6720756e69742c2053637279707420504f532e546f64617920697320746865204d617920317374204c61626f75722044617920686f6c69646179)
    CTxOut(error)
  vMerkleTree: 8616fea39dec184c9b4c749d6ed93edc13fadcdb536dc6b8736f79ee9660a318
2014-05-14 12:32:23 Pre-allocating up to position 0x1000000 in blk00000.dat
2014-05-14 12:32:23 ERROR: CTransaction::CheckTransaction() : coinbase script size
2014-05-14 12:32:23 ERROR: CheckBlock() : CheckTransaction failed
2014-05-14 12:32:23 InvalidChainFound: invalid block=3b8e68113b0642ec7a9f8d0abd4b8812900f37040a4ca7ab221453b21960a46b  height=0  log2_work=20.000022  date=2014-05-01 03:04:01

How do I edit the following file:

https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp

Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 14, 2014, 12:54:58 PM
 #7

Thank you very much for providing the teaching,  I met a new problem.
Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 15, 2014, 09:26:10 AM
 #8

5LTC too Too little Huh
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
May 15, 2014, 09:41:30 AM
 #9

Thank you!!!!

How do I edit the following file:[/size]
https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp
Before this line:
https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp#L82
add this:
Code:
return true;

Before this line:
https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp#L126
add this:
Code:
return 0;

Before this:
https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp#L137
Add this:
Code:
return NULL;
Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 20, 2014, 02:34:34 AM
Last edit: July 24, 2014, 03:58:11 PM by Bitcoin_ADM
 #10

elbandi:
thank you!!!!
I almost forgot this post. I think no one is willing to help me...
I have solved my problem, but still thank you for your reply.

Bitcoin_ADM (OP)
Newbie
*
Offline Offline

Activity: 44
Merit: 0


View Profile
May 21, 2014, 10:10:06 AM
Last edit: May 21, 2014, 10:32:29 AM by Bitcoin_ADM
 #11

thank you!!!
I met a problem again, I want to know the following line of code:
https://github.com/litecoin-project/litecoin/blob/v0.8.6.2/src/checkpoints.cpp#L58
8000, it is how to calculate.
what is estimated number.
Code:
static const CCheckpointData data = {
        &mapCheckpoints,
        1383887110, // * UNIX timestamp of last checkpoint block
        2179203, // * total number of transactions between genesis and last checkpoint
                    // (the tx=... number in the SetBestChain debug.log lines)
        8000.0 // * estimated number of transactions per day after checkpoint
    };

elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
May 21, 2014, 10:40:10 AM
 #12

it's not az exact number. if your coin is popular, and there are lof of transaction, use high number. use block explorer to calculate the daily tr number.
but i think 8k is ok.

Peoplerun
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
May 21, 2014, 10:49:09 AM
 #13

5LTC too Too little Huh

5 LTC's a bit less
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!