Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: CryptoMine on December 30, 2013, 04:55:50 PM



Title: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: CryptoMine on December 30, 2013, 04:55:50 PM
I am always one to Google/Search forums until I find the answer, but after 10 hours of trying, I have come to the forums to get an answer.

I am modifying the new Litecoin script (for educational reasons) here: https://github.com/litecoin-project/litecoin

For the life of me, I am unable to generate a genesis block, I keep getting:

Code:
main.cpp:2796: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.

I check my debug.log file and get:

Code:
2013-12-30 04:03:26 84d3cf22c9d4a4cbda424fc0e5a7169f33780395039b3959fec424649d690d07
2013-12-30 04:03:26 f5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f
2013-12-30 04:03:26 b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d
2013-12-30 04:03:26 CBlock(hash=84d3cf22c9d4a4cbda424fc0e5a7169f33780395039b3959fec424649d690d07, input=0100000000000000000000000000000000000000000000000000000000000000000000000dcc228b6d21d40cdaa4bc53e6447fa0da8c404d036fd769114bdda6900b58b6f6028c4ef0ff0f1e00000000, PoW=7cf4e4a52ed1ba6569c2d9a9f50a8f1e4ac4c2064408de1e20c5292da185cd8c, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d, nTime=1317798646, nBits=1e0ffff0, nNonce=0, vtx=1)
2013-12-30 04:03:26   CTransaction(hash=b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d01043a54686520477561726469616e20312f31322f3133204d6972616e6461204861727420486f7720746f2073757276697665204368726973746d6173)
    CTxOut(nValue=50.00000000, scriptPubKey=040184710fa689ad5023690c80f3a4)
  vMerkleTree: b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d

Which doesn't give me:

block.nTime = X
block.nNonce = X
block.GetHash = X

As mentioned https://bitcointalk.org/index.php?topic=189350.msg2035449#msg2035449 and many other forums I have visited in the past 10hrs

I am inserting the hashMerkleRoot, block.nTime and block.nBits in correctly (after generating the hashMerkleRoot from debug.log) but after I try to run the daemon (or testnet) I am getting that same error.

Any ideas?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: elbandi on December 30, 2013, 05:24:39 PM
Hi,

This is your genesis block hash:
Quote
2013-12-30 04:03:26 84d3cf22c9d4a4cbda424fc0e5a7169f33780395039b3959fec424649d690d07

Put that to this line:
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L34

This is your merkleroot:
Quote
2013-12-30 04:03:26 b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d

Put that to this line:
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L2786

After if you get somethink like this:
Quote
CheckProofOfWork() : hash doesn't match nBits

This genesis block is not good, because doest fit for start difficulty.
need a new one. Put this source code (http://pastebin.com/jDMPUNuP) before this line (block.print()):
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L2787

run the app, this will "mine" a new genesis block (need lot of time!!) for you.
 if it's founded, modify your source: nNonce, nTime and the new hash (GetHash = XX) for genesis block hash.

you can remove the inserted code, and you have a new altcoin  ;)

(if you want a testnet genesis block, do the same and dont forget to start with -testnet, and modify the testnet nNonce, nTime and hash!)

Elbandi


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: CryptoMine on December 30, 2013, 05:34:06 PM
Thanks you! I've regained my sanity!

That worked perfectly! and I'm sure this will help other people too!!

Please PM me your MegaCoin Wallet ID and I will send you the bounty :)


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: Sharrow on December 31, 2013, 07:46:54 PM
Thanks for this info too, dude.

I'm testing a coin (strictly for humanitarian issues) using different source code and the error was almost the same. From your info, it seems the genesis hash in debug.log was on a different line to the expected value. The main VPS server is working fine but the log file is busy so I'm expecting trouble soon.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: Sharrow on December 31, 2013, 09:37:56 PM
In response to my previous post, there seems to be something unusual in the genesis block that was shown in debug.log on my main Linux server. The hash shown in the log files doesn't seem to be the final genesis hash.

To cut a long story short, the debug.log showed what looked to be THE genesis hash but testcoind must've still been running in the background, creating the actual genesis hash, which no doubt I killed the process when recompiling the files.

Basically... if you come across this, make sure you leave your /whatevercoind to process its genesis hash uninterrupted. The only way if found out (the second time around) on the Linux VPS server was when trying to transfer the coin's directory using sudo cp testcoind /usr/bin/testcoind. The message saying "Text file busy" suggests that something is going on in the background. It's been running for 4 hours now; apparently it took 6 days on the Bitcoin creators original run  :o


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 05:20:16 AM
I too have been messing around with the Litecoin 0.8.6.1 sources for fun and insight, but I can't get litecoind to work after it has created a genesis block...

I start with an empty ~/.litecoin dir - no blocks, no chainstate, no database. I have set the start difficulty to ">> 24", nNonce to 0, nBits is the default 0x1e0ffff0, I have set nTime and written a timestamp message. I run litecoind to get the correct MerkleRoot for my timestamp message and then I enable the genesis block generation and start litecoind again, and it begins mining a genesis block which when done ends with this message:

Code:
litecoind: main.cpp:2833: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.

In debug.log I see that I successfully mined a block, so I set the new nNonce and genesis block hash - both nTime and nBits stay the same for some reason - and then I start litecoind again but only this happens:

Code:
Error: Failed to read block
: Error initializing block database.

Do you want to build the block database now?

And if I start again:

Code:
Error: Failed to read block
Error: Failed to connect best block

The debug log reveals this:

Code:
2014-01-01 15:13:35 Opened LevelDB successfully
2014-01-01 15:13:35 LoadBlockIndexDB(): last block file = 0
2014-01-01 15:13:35 LoadBlockIndexDB(): last block file info: CBlockFileInfo(blocks=1, size=281, heights=
0...0, time=2014-01-01...2014-01-01)
2014-01-01 15:13:35 LoadBlockIndexDB(): transaction index disabled
2014-01-01 15:13:35 init message: Verifying blocks...
2014-01-01 15:13:35  block index              41ms
2014-01-01 15:13:35 init message: Loading wallet...
2014-01-01 15:13:35 nFileVersion = 80601
2014-01-01 15:13:35  wallet                  534ms
2014-01-01 15:13:35 ERROR: CheckProofOfWork() : nBits below minimum work
2014-01-01 15:13:35 ERROR: CBlock::ReadFromDisk() : errors in block header
2014-01-01 15:13:35 *** Failed to read block
2014-01-01 15:13:35 Error: Failed to read block

Anyone who had the same problem and managed to solve it?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: elbandi on January 02, 2014, 09:38:26 AM
empty ~/.litecoin dir!


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 12:36:38 PM
empty ~/.litecoin dir!

That gives the exact same results :/

First it rebuilds the database, I see in the debug.log that it makes an accepted transaction to the blockchain, but then it fails reading/verifying the block.

debug.log:

Code:
...
2014-01-02 12:31:37 keypool added key 98, size=98
2014-01-02 12:31:37 keypool added key 99, size=99
2014-01-02 12:31:37 keypool added key 100, size=100
2014-01-02 12:31:37 keypool added key 101, size=101
2014-01-02 12:31:37 keypool reserve 1
2014-01-02 12:31:37 keypool keep 1
2014-01-02 12:31:37  wallet                 1266ms
2014-01-02 12:31:37 ERROR: CheckProofOfWork() : nBits below minimum work
2014-01-02 12:31:37 ERROR: CBlock::ReadFromDisk() : errors in block header
2014-01-02 12:31:37 *** Failed to read block
2014-01-02 12:31:37 Error: Failed to read block
2014-01-02 12:31:37 init message: Loading addresses...
2014-01-02 12:31:37 Loaded 0 addresses from peers.dat  0ms
2014-01-02 12:31:37 Error: Failed to connect best block


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 12:42:31 PM
I have found the problem. It does not like that I change the minimum network difficulty (bnProofOfWorkLimit). As soon as I restore it to the defauld ">> 20" (which is 1/4096), it works perfectly! I've tried to find where else the default value may be set and tested for verification, but I can't locate it. Any ideas?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: nocoin on January 02, 2014, 12:45:19 PM
I have found the problem. It does not like that I change the minimum network difficulty (bnProofOfWorkLimit). I've tried to find where else the default value of ">> 20" (1/4096) may be set and tested for verification, but I can't locate it. Any ideas?
(geneses)block.nBits
https://en.bitcoin.it/wiki/Difficulty


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: elbandi on January 02, 2014, 12:58:50 PM
I have found the problem. It does not like that I change the minimum network difficulty (bnProofOfWorkLimit). As soon as I restore it to the defauld ">> 20" (which is 1/4096), it works perfectly! I've tried to find where else the default value may be set and tested for verification, but I can't locate it. Any ideas?
ah, if you increase the minimum network difficulty, you have to calculate the right nBits for genesis block.
maybe you can try this:
Code:
printf("min nBit:  %08x\n", bnProofOfWorkLimit.GetCompact());
after this:
Code:
        printf("%s\n", hash.ToString().c_str());
        printf("%s\n", hashGenesisBlock.ToString().c_str());
        printf("%s\n", block.hashMerkleRoot.ToString().c_str());
this will print a hex value, set this to block.nBits.

and gen a new GenesisBlock hash.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 01:52:59 PM
Thank you for the help. Now waiting for a block to be found with the new settings...


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 02:56:05 PM
Block found - and everything is working with the new difficulty! The only thing that confuses me is that "getinfo" reports 0 blocks and 0 balance, but perhaps the genesis block in the wallet is not accounted for?

Again, thanks for the help elbandi and nocoin!


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: roundrobin on January 02, 2014, 09:20:32 PM
Things are working now. Multiple nodes up, communicating with eachother. Is it normal that every block I mine solo comes from a unique random address?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: Stygian0708 on March 11, 2014, 05:40:01 AM
I am having one hell of a time, I have tried everything in this guide and it still does not work here are the issues I am having after making the changes

Code:
cnz@cryptopirates:~/testing/Denarius/DenariusCoin/src$ ./DenariusCoind -reindex
DenariusCoin server starting
cnz@cryptopirates:~/testing/Denarius/DenariusCoin/src$ Error: Failed to read block
cnz@cryptopirates:~/testing/Denarius/DenariusCoin/src$

I look in the debug log and there's this info

Code:
2014-03-11 05:37:22 DenariusCoin version v0.8.6.2-g85f303d (2014-03-10 23:46:35 -0500)
2014-03-11 05:37:22 Using OpenSSL version OpenSSL 1.0.1 14 Mar 2012
2014-03-11 05:37:22 Default data directory /home/cnz/.denariuscoin
2014-03-11 05:37:22 Using data directory /home/cnz/.denariuscoin
2014-03-11 05:37:22 Using at most 125 connections (1024 file descriptors available)
2014-03-11 05:37:22 Using 4 threads for script verification
2014-03-11 05:37:22 init message: Verifying wallet...
2014-03-11 05:37:22 dbenv.open LogDir=/home/cnz/.denariuscoin/database ErrorFile=/home/cnz/.denariuscoin/db.log
2014-03-11 05:37:22 Bound to [::]:60666
2014-03-11 05:37:22 Bound to 0.0.0.0:60666
2014-03-11 05:37:22 init message: Loading block index...
2014-03-11 05:37:22 Wiping LevelDB in /home/cnz/.denariuscoin/blocks/index
2014-03-11 05:37:22 Opening LevelDB in /home/cnz/.denariuscoin/blocks/index
2014-03-11 05:37:22 Opened LevelDB successfully
2014-03-11 05:37:22 Wiping LevelDB in /home/cnz/.denariuscoin/chainstate
2014-03-11 05:37:22 Opening LevelDB in /home/cnz/.denariuscoin/chainstate
2014-03-11 05:37:22 Opened LevelDB successfully
2014-03-11 05:37:22 Initializing databases...
2014-03-11 05:37:22 init message: Verifying blocks...
2014-03-11 05:37:22  block index              53ms
2014-03-11 05:37:22 init message: Loading wallet...
2014-03-11 05:37:23 nFileVersion = 80602
2014-03-11 05:37:23  wallet                 1144ms
2014-03-11 05:37:23 init message: Loading addresses...
2014-03-11 05:37:23 Loaded 0 addresses from peers.dat  1ms
2014-03-11 05:37:23 mapBlockIndex.size() = 0
2014-03-11 05:37:23 nBestHeight = 0
2014-03-11 05:37:23 setKeyPool.size() = 100
2014-03-11 05:37:23 mapWallet.size() = 0
2014-03-11 05:37:23 mapAddressBook.size() = 1
2014-03-11 05:37:23 Reindexing block file blk00000.dat...
2014-03-11 05:37:23 net thread start
2014-03-11 05:37:23 dnsseed thread start
2014-03-11 05:37:23 Loading addresses from DNS seeds (could take a while)
2014-03-11 05:37:23 opencon thread start
2014-03-11 05:37:23 addcon thread start
2014-03-11 05:37:23 trying connection 64.39.227.156:43706 lastseen=359587.8hrs
2014-03-11 05:37:23 connect() failed after select(): Connection refused
2014-03-11 05:37:23 msghand thread start
2014-03-11 05:37:23 dumpaddr thread start
2014-03-11 05:37:23 init message: Done loading
2014-03-11 05:37:23 ERROR: CheckProofOfWork() : hash doesn't match nBits
2014-03-11 05:37:23 ERROR: CheckBlock() : proof of work failed
2014-03-11 05:37:23 ERROR: ProcessBlock() : CheckBlock FAILED
2014-03-11 05:37:23 Unable to open file /home/cnz/.denariuscoin/blocks/blk00001.dat
2014-03-11 05:37:23 Reindexing finished
2014-03-11 05:37:23 Initializing databases...
2014-03-11 05:37:23 14d111fc6f3909764a2891ef4d48f0e4f1a2a01c3532df36115899f9e68ad521
2014-03-11 05:37:23 14d111fc6f3909764a2891ef4d48f0e4f1a2a01c3532df36115899f9e68ad521
2014-03-11 05:37:23 12a320fe62f0a510c17cbfa587ca5e4a3812a8d6e7d2a9f748cfa91ae5d3b386
2014-03-11 05:37:23 min nBit:  1e0fffff
2014-03-11 05:37:23 CBlock(hash=14d111fc6f3909764a2891ef4d48f0e4f1a2a01c3532df36115899f9e68ad521, input=01000000000000000000000000000000000000000000000000000000000000000000000086b3d3e51aa9cf48f7a9d2e7d6a812384a5eca87a5bf7cc110a5f062fe20a312b9aa8e4effff0f1ecd513f7c, PoW=46a5474200e21b7f4d0fa281c8dd10be396bcbc3c75fa5b6d7537bea945ab0e3, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=12a320fe62f0a510c17cbfa587ca5e4a3812a8d6e7d2a9f748cfa91ae5d3b386, nTime=1317972665, nBits=1e0fffff, nNonce=2084524493, vtx=1)
2014-03-11 05:37:23   CTransaction(hash=12a320fe62f0a510c17cbfa587ca5e4a3812a8d6e7d2a9f748cfa91ae5d3b386, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d0104244d617263682031302c2032303134202d2050726f6f66206f66206e6f207072656d696e65)
    CTxOut(error)
  vMerkleTree: 12a320fe62f0a510c17cbfa587ca5e4a3812a8d6e7d2a9f748cfa91ae5d3b386
2014-03-11 05:37:23 Pre-allocating up to position 0x1000000 in blk00000.dat
2014-03-11 05:37:23 ERROR: CheckProofOfWork() : hash doesn't match nBits
2014-03-11 05:37:23 ERROR: CBlock::ReadFromDisk() : errors in block header
2014-03-11 05:37:23 *** Failed to read block
2014-03-11 05:37:23 Error: Failed to read block
2014-03-11 05:37:23 ERROR: LoadBlockIndex() : genesis block not accepted
2014-03-11 05:37:23 Shutdown : In progress...
2014-03-11 05:37:23 opencon thread interrupt
2014-03-11 05:37:23 addcon thread interrupt
2014-03-11 05:37:23 msghand thread interrupt
2014-03-11 05:37:23 dumpaddr thread stop
2014-03-11 05:37:23 net thread interrupt
2014-03-11 05:37:23 Flush(false)
2014-03-11 05:37:23 wallet.dat refcount=0
2014-03-11 05:37:23 wallet.dat checkpoint
2014-03-11 05:37:23 wallet.dat detach
2014-03-11 05:37:23 wallet.dat closed
2014-03-11 05:37:23 DBFlush(false) ended              33ms
2014-03-11 05:37:23 StopNode()
2014-03-11 05:37:23 Flushed 0 addresses to peers.dat  3ms
2014-03-11 05:37:23 Committing 0 changed transactions to coin database...
2014-03-11 05:37:23 Flush(true)
2014-03-11 05:37:23 wallet.dat refcount=0
2014-03-11 05:37:23 wallet.dat checkpoint
2014-03-11 05:37:23 wallet.dat detach
2014-03-11 05:37:23 wallet.dat closed
2014-03-11 05:37:23 DBFlush(true) ended               2ms
2014-03-11 05:37:23 Shutdown : done

any help would be greatly appreciated


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: Cryptokk on March 11, 2014, 10:24:00 AM
Hi,

didn't read all the thread. But this will help you with Litecoin clients:

(this work only if you already did the basis (=change your timestamp, ntime, ect...) and ready to mine your merkle/genesis.)

- Open main.cpp
- Go to "bool InitBlockIndex()"
- Search "block.print();"
- ABOVE, you copy this:

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());
}

This is a script that doing all the annoying job for you.
How to use it ?

- First you need to empty your merkleroot, genesis and nnonce (merkle = "0x", genesis="0x", nonce=0.
- Then you compil and start the client.
- The client will show an error but show the merkleroot.
- Now change you merkle root variable for your new one.
- Compil again and start again.
- Your client will try to mine your genesis block, this operation can be very fast as she can be very slow.
- After this, the client will show again an error but give you the genesis (gethash) and nonce.
- reopen your client script, change the genesis and nonce (and verify your ntime).
- REMOVE the script I gave you (or comment).
- Compil and enjoy ;)

I don't know if someone got the bounty, but i'm not looking after, just helping =)


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: madhatr on April 03, 2014, 10:19:40 PM
I too have been messing around with the Litecoin 0.8.6.1 sources for fun and insight, but I can't get litecoind to work after it has created a genesis block...

I start with an empty ~/.litecoin dir - no blocks, no chainstate, no database. I have set the start difficulty to ">> 24", nNonce to 0, nBits is the default 0x1e0ffff0, I have set nTime and written a timestamp message. I run litecoind to get the correct MerkleRoot for my timestamp message and then I enable the genesis block generation and start litecoind again, and it begins mining a genesis block which when done ends with this message:

Code:
litecoind: main.cpp:2833: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.

In debug.log I see that I successfully mined a block, so I set the new nNonce and genesis block hash - both nTime and nBits stay the same for some reason - and then I start litecoind again but only this happens:

Code:
Error: Failed to read block
: Error initializing block database.

Do you want to build the block database now?

And if I start again:

Code:
Error: Failed to read block
Error: Failed to connect best block

The debug log reveals this:

Code:
2014-01-01 15:13:35 Opened LevelDB successfully
2014-01-01 15:13:35 LoadBlockIndexDB(): last block file = 0
2014-01-01 15:13:35 LoadBlockIndexDB(): last block file info: CBlockFileInfo(blocks=1, size=281, heights=
0...0, time=2014-01-01...2014-01-01)
2014-01-01 15:13:35 LoadBlockIndexDB(): transaction index disabled
2014-01-01 15:13:35 init message: Verifying blocks...
2014-01-01 15:13:35  block index              41ms
2014-01-01 15:13:35 init message: Loading wallet...
2014-01-01 15:13:35 nFileVersion = 80601
2014-01-01 15:13:35  wallet                  534ms
2014-01-01 15:13:35 ERROR: CheckProofOfWork() : nBits below minimum work
2014-01-01 15:13:35 ERROR: CBlock::ReadFromDisk() : errors in block header
2014-01-01 15:13:35 *** Failed to read block
2014-01-01 15:13:35 Error: Failed to read block

Anyone who had the same problem and managed to solve it?


I have this identical problem right now but i have not changed the starting diff.     I will empty my ./coin folder and start the daemon and it searches for genesis block(thanks to the added code) but always ends with
Code:
bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.
Aborted


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: softron on April 04, 2014, 04:20:49 PM
Nice guide


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: satoru on April 10, 2014, 07:10:49 PM

Using bitcoin-sCrypt as source. I changed the usual. testnet works fine. find a  gen block no errors. switch to mainnet, everything looks fine, but when i try to mine mainnet it shows 0 hashrate and doesnt start mining?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on April 11, 2014, 02:10:35 PM

Using bitcoin-sCrypt as source. I changed the usual. testnet works fine. find a  gen block no errors. switch to mainnet, everything looks fine, but when i try to mine mainnet it shows 0 hashrate and doesnt start mining?

Check your debug.log and see if it's connected to a peer.



Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: sr.machado on April 11, 2014, 05:48:50 PM
Testing... seems wonderful! :D

UPDATE:

Hi,

didn't read all the thread. But this will help you with Litecoin clients:

(this work only if you already did the basis (=change your timestamp, ntime, ect...) and ready to mine your merkle/genesis.)

- Open main.cpp
- Go to "bool InitBlockIndex()"
- Search "block.print();"
- ABOVE, you copy this:

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());
}

This is a script that doing all the annoying job for you.
How to use it ?

- First you need to empty your merkleroot, genesis and nnonce (merkle = "0x", genesis="0x", nonce=0.
- Then you compil and start the client.
- The client will show an error but show the merkleroot.
- Now change you merkle root variable for your new one.
- Compil again and start again.
- Your client will try to mine your genesis block, this operation can be very fast as she can be very slow.
- After this, the client will show again an error but give you the genesis (gethash) and nonce.
- reopen your client script, change the genesis and nonce (and verify your ntime).
- REMOVE the script I gave you (or comment).
- Compil and enjoy ;)

I don't know if someone got the bounty, but i'm not looking after, just helping =)

I make this steps but when I open the client do not show the MerkleRoot that you say - The client will show an error but show the merkleroot. but I copy the Merkle that have on debug.log and now I will compile.. I will send news.

Thanks

NEW UPDATE - REASON: TESTS

https://i.imgur.com/wP8La8b.jpg

Why I receive this error?

My debug.log file:
Code:
2014-04-11 18:44:00 



















2014-04-11 18:44:00 XXX version v0.8.6.2-g10d589b-beta (Thu, 3 Apr 2014 21:58:44 -1000)
2014-04-11 18:44:00 Using OpenSSL version OpenSSL 1.0.1g 7 Apr 2014
2014-04-11 18:44:00 Default data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-11 18:44:00 Using data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-11 18:44:00 Using at most 125 connections (2048 file descriptors available)
2014-04-11 18:44:00 Using 2 threads for script verification
2014-04-11 18:44:00 init message: Verificando carteira...
2014-04-11 18:44:00 dbenv.open LogDir=C:\Users\Leandro\AppData\Roaming\XXX\database ErrorFile=C:\Users\Leandro\AppData\Roaming\XXX\db.log
2014-04-11 18:44:00 Bound to [::]:25991
2014-04-11 18:44:00 Bound to 0.0.0.0:25991
2014-04-11 18:44:00 init message: Carregando índice de blocos...
2014-04-11 18:44:00 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\blocks\index
2014-04-11 18:44:00 Opened LevelDB successfully
2014-04-11 18:44:00 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\chainstate
2014-04-11 18:44:00 Opened LevelDB successfully
2014-04-11 18:44:00 LoadBlockIndexDB(): last block file = 0
2014-04-11 18:44:00 LoadBlockIndexDB(): transaction index disabled
2014-04-11 18:44:00 Initializing databases...
2014-04-11 18:44:00 b103277b47c133eeb6b58486d9bec984dee754bfda81010844221637e58113b9
2014-04-11 18:44:00 0000000000000000000000000000000000000000000000000000000000000000
2014-04-11 18:44:00 53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29
2014-04-11 18:44:00 CBlock(hash=b103277b47c133eeb6b58486d9bec984dee754bfda81010844221637e58113b9, input=010000000000000000000000000000000000000000000000000000000000000000000000298a6f76913c06f26c3a0b57a7f59f72fd553bb9901529e0324bc43ffd4ce55399004853f0ff0f1e00000000, PoW=daf38cbceaac5a570916ae3b11bcb32ce288631677bad01fe41b54978af520ba, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29, nTime=1397227673, nBits=1e0ffff0, nNonce=0, vtx=1)
2014-04-11 18:44:00   CTransaction(hash=53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d010444323031342f30342f313120427564676574204368696566204973204f62616d61e28099732043686f696365206173204e6577204865616c7468205365637265746172792e)
    CTxOut(nValue=3.00000000, scriptPubKey=04678afdb0fe5548271967f1a67130)
  vMerkleTree: 53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29

Thanks

New Update - REASON: Other error

So, I've cleaned the Merkle and the Genesis to 0x and now I receive this message:
https://i.imgur.com/2oxYYI3.jpg


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: Proteu5 on April 12, 2014, 04:05:22 AM
Testing... seems wonderful! :D

UPDATE:

Hi,

didn't read all the thread. But this will help you with Litecoin clients:

(this work only if you already did the basis (=change your timestamp, ntime, ect...) and ready to mine your merkle/genesis.)

- Open main.cpp
- Go to "bool InitBlockIndex()"
- Search "block.print();"
- ABOVE, you copy this:

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());
}

This is a script that doing all the annoying job for you.
How to use it ?

- First you need to empty your merkleroot, genesis and nnonce (merkle = "0x", genesis="0x", nonce=0.
- Then you compil and start the client.
- The client will show an error but show the merkleroot.
- Now change you merkle root variable for your new one.
- Compil again and start again.
- Your client will try to mine your genesis block, this operation can be very fast as she can be very slow.
- After this, the client will show again an error but give you the genesis (gethash) and nonce.
- reopen your client script, change the genesis and nonce (and verify your ntime).
- REMOVE the script I gave you (or comment).
- Compil and enjoy ;)

I don't know if someone got the bounty, but i'm not looking after, just helping =)

I make this steps but when I open the client do not show the MerkleRoot that you say - The client will show an error but show the merkleroot. but I copy the Merkle that have on debug.log and now I will compile.. I will send news.

Thanks

NEW UPDATE - REASON: TESTS

https://i.imgur.com/wP8La8b.jpg

Why I receive this error?

My debug.log file:
Code:
2014-04-11 18:44:00 



















2014-04-11 18:44:00 XXX version v0.8.6.2-g10d589b-beta (Thu, 3 Apr 2014 21:58:44 -1000)
2014-04-11 18:44:00 Using OpenSSL version OpenSSL 1.0.1g 7 Apr 2014
2014-04-11 18:44:00 Default data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-11 18:44:00 Using data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-11 18:44:00 Using at most 125 connections (2048 file descriptors available)
2014-04-11 18:44:00 Using 2 threads for script verification
2014-04-11 18:44:00 init message: Verificando carteira...
2014-04-11 18:44:00 dbenv.open LogDir=C:\Users\Leandro\AppData\Roaming\XXX\database ErrorFile=C:\Users\Leandro\AppData\Roaming\XXX\db.log
2014-04-11 18:44:00 Bound to [::]:25991
2014-04-11 18:44:00 Bound to 0.0.0.0:25991
2014-04-11 18:44:00 init message: Carregando índice de blocos...
2014-04-11 18:44:00 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\blocks\index
2014-04-11 18:44:00 Opened LevelDB successfully
2014-04-11 18:44:00 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\chainstate
2014-04-11 18:44:00 Opened LevelDB successfully
2014-04-11 18:44:00 LoadBlockIndexDB(): last block file = 0
2014-04-11 18:44:00 LoadBlockIndexDB(): transaction index disabled
2014-04-11 18:44:00 Initializing databases...
2014-04-11 18:44:00 b103277b47c133eeb6b58486d9bec984dee754bfda81010844221637e58113b9
2014-04-11 18:44:00 0000000000000000000000000000000000000000000000000000000000000000
2014-04-11 18:44:00 53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29
2014-04-11 18:44:00 CBlock(hash=b103277b47c133eeb6b58486d9bec984dee754bfda81010844221637e58113b9, input=010000000000000000000000000000000000000000000000000000000000000000000000298a6f76913c06f26c3a0b57a7f59f72fd553bb9901529e0324bc43ffd4ce55399004853f0ff0f1e00000000, PoW=daf38cbceaac5a570916ae3b11bcb32ce288631677bad01fe41b54978af520ba, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29, nTime=1397227673, nBits=1e0ffff0, nNonce=0, vtx=1)
2014-04-11 18:44:00   CTransaction(hash=53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d010444323031342f30342f313120427564676574204368696566204973204f62616d61e28099732043686f696365206173204e6577204865616c7468205365637265746172792e)
    CTxOut(nValue=3.00000000, scriptPubKey=04678afdb0fe5548271967f1a67130)
  vMerkleTree: 53e54cfd3fc44b32e0291590b93b55fd729ff5a7570b3a6cf2063c91766f8a29

Thanks

New Update - REASON: Other error

So, I've cleaned the Merkle and the Genesis to 0x and now I receive this message:
https://i.imgur.com/2oxYYI3.jpg

Your missing a step from the guide, re-read it closely. Just mind you, if you intent to release a coin; know that it will change your life - don't take short cuts, and always be professional (my 2 cents) That being said...You need to populate your 0x lines after error one.

1) Restart
2) New TimeStamp
3) 0x
4) Error
5) Populate
6) Follow guide ;)


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on April 12, 2014, 07:47:38 AM
And most importantly: learn to code so you know what you are doing.

It doesn't matter right now when you're playing with the technology, but if you're serious about crypto,
decent programming skills are a must.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: sr.machado on April 12, 2014, 01:34:56 PM
Quote
Your missing a step from the guide, re-read it closely. Just mind you, if you intent to release a coin; know that it will change your life - don't take short cuts, and always be professional (my 2 cents) That being said...You need to populate your 0x lines after error one.

1) Restart
2) New TimeStamp
3) 0x
4) Error
5) Populate
6) Follow guide ;)


Thank you, but the error do not show the Merkle on the error (so, the error quoted is debug.log file?).

I will re-read the tutorial, I'm autodidact (correct write?) and on my official language don't have tutorials.

Thanks for your patience.

Quote
And most importantly: learn to code so you know what you are doing.

It doesn't matter right now when you're playing with the technology, but if you're serious about crypto,
decent programming skills are a must.

So, my intention is just for study case, I not  show the name of coin because people can copy before I finish! :)

Thanks a lot for help, I will begin again!


Recompiled, same error...

So, what is the Merkle and What is the Genesis here?

Code:
2014-04-12 20:56:32 



















2014-04-12 20:56:32 XXX version v0.8.6.2-g10d589b-beta (Thu, 3 Apr 2014 21:58:44 -1000)
2014-04-12 20:56:32 Using OpenSSL version OpenSSL 1.0.1g 7 Apr 2014
2014-04-12 20:56:32 Default data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-12 20:56:32 Using data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-12 20:56:32 Using at most 125 connections (2048 file descriptors available)
2014-04-12 20:56:32 Using 2 threads for script verification
2014-04-12 20:56:32 init message: Verificando carteira...
2014-04-12 20:56:32 dbenv.open LogDir=C:\Users\Leandro\AppData\Roaming\XXX\database ErrorFile=C:\Users\Leandro\AppData\Roaming\XXX\db.log
2014-04-12 20:56:32 Bound to [::]:25992
2014-04-12 20:56:32 Bound to 0.0.0.0:25992
2014-04-12 20:56:32 init message: Carregando índice de blocos...
2014-04-12 20:56:32 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\blocks\index
2014-04-12 20:56:32 Opened LevelDB successfully
2014-04-12 20:56:32 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\chainstate
2014-04-12 20:56:32 Opened LevelDB successfully
2014-04-12 20:56:32 LoadBlockIndexDB(): last block file = 0
2014-04-12 20:56:32 LoadBlockIndexDB(): transaction index disabled
2014-04-12 20:56:32 Initializing databases...
2014-04-12 20:56:32 a9d4e70111de34a5fe4d805b73a8c9d47467ee0cc24a8ee8b0f26ae5c7573a0a
2014-04-12 20:56:32 0000000000000000000000000000000000000000000000000000000000000000
2014-04-12 20:56:32 ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f
2014-04-12 20:56:32 CBlock(hash=a9d4e70111de34a5fe4d805b73a8c9d47467ee0cc24a8ee8b0f26ae5c7573a0a, input=0100000000000000000000000000000000000000000000000000000000000000000000006fe7e7e6b9c75c55c98b259cebe842a639af4afafedc82114f169824a3e37ced00000000f0ff0f1e00000000, PoW=f3fc25ec33ed2050cc0af566733116790642cc48b488d9e37fb084b8ef9e6efd, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f, nTime=0, nBits=1e0ffff0, nNonce=0, vtx=1)
2014-04-12 20:56:32   CTransaction(hash=ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d01044c604e592054696d65732031322f4170722f32303134204f62616d612c20436974696e67204e6577204c6177732c20536179732074686520472e4f2e502e204973204d6f76696e6720746f20526573747269637420566f74696e6720526967687473)
    CTxOut(nValue=3.00000000, scriptPubKey=04678afdb0fe5548271967f1a67130)
  vMerkleTree: ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f






Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: satoru on April 14, 2014, 05:08:13 PM

Using bitcoin-sCrypt as source. I changed the usual. testnet works fine. find a  gen block no errors. switch to mainnet, everything looks fine, but when i try to mine mainnet it shows 0 hashrate and doesnt start mining?

Check your debug.log and see if it's connected to a peer.


thanks for response, didnt think this to be a problem since testnet worked, i will check and see.

Quote
Your missing a step from the guide, re-read it closely. Just mind you, if you intent to release a coin; know that it will change your life - don't take short cuts, and always be professional (my 2 cents) That being said...You need to populate your 0x lines after error one.

1) Restart
2) New TimeStamp
3) 0x
4) Error
5) Populate
6) Follow guide ;)


Thank you, but the error do not show the Merkle on the error (so, the error quoted is debug.log file?).

I will re-read the tutorial, I'm autodidact (correct write?) and on my official language don't have tutorials.

Thanks for your patience.

Quote
And most importantly: learn to code so you know what you are doing.

It doesn't matter right now when you're playing with the technology, but if you're serious about crypto,
decent programming skills are a must.

So, my intention is just for study case, I not  show the name of coin because people can copy before I finish! :)

Thanks a lot for help, I will begin again!


Recompiled, same error...

So, what is the Merkle and What is the Genesis here?

Code:
2014-04-12 20:56:32 



















2014-04-12 20:56:32 XXX version v0.8.6.2-g10d589b-beta (Thu, 3 Apr 2014 21:58:44 -1000)
2014-04-12 20:56:32 Using OpenSSL version OpenSSL 1.0.1g 7 Apr 2014
2014-04-12 20:56:32 Default data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-12 20:56:32 Using data directory C:\Users\Leandro\AppData\Roaming\XXX
2014-04-12 20:56:32 Using at most 125 connections (2048 file descriptors available)
2014-04-12 20:56:32 Using 2 threads for script verification
2014-04-12 20:56:32 init message: Verificando carteira...
2014-04-12 20:56:32 dbenv.open LogDir=C:\Users\Leandro\AppData\Roaming\XXX\database ErrorFile=C:\Users\Leandro\AppData\Roaming\XXX\db.log
2014-04-12 20:56:32 Bound to [::]:25992
2014-04-12 20:56:32 Bound to 0.0.0.0:25992
2014-04-12 20:56:32 init message: Carregando índice de blocos...
2014-04-12 20:56:32 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\blocks\index
2014-04-12 20:56:32 Opened LevelDB successfully
2014-04-12 20:56:32 Opening LevelDB in C:\Users\Leandro\AppData\Roaming\XXX\chainstate
2014-04-12 20:56:32 Opened LevelDB successfully
2014-04-12 20:56:32 LoadBlockIndexDB(): last block file = 0
2014-04-12 20:56:32 LoadBlockIndexDB(): transaction index disabled
2014-04-12 20:56:32 Initializing databases...
2014-04-12 20:56:32 a9d4e70111de34a5fe4d805b73a8c9d47467ee0cc24a8ee8b0f26ae5c7573a0a
2014-04-12 20:56:32 0000000000000000000000000000000000000000000000000000000000000000
2014-04-12 20:56:32 ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f
2014-04-12 20:56:32 CBlock(hash=a9d4e70111de34a5fe4d805b73a8c9d47467ee0cc24a8ee8b0f26ae5c7573a0a, input=0100000000000000000000000000000000000000000000000000000000000000000000006fe7e7e6b9c75c55c98b259cebe842a639af4afafedc82114f169824a3e37ced00000000f0ff0f1e00000000, PoW=f3fc25ec33ed2050cc0af566733116790642cc48b488d9e37fb084b8ef9e6efd, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f, nTime=0, nBits=1e0ffff0, nNonce=0, vtx=1)
2014-04-12 20:56:32   CTransaction(hash=ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d01044c604e592054696d65732031322f4170722f32303134204f62616d612c20436974696e67204e6577204c6177732c20536179732074686520472e4f2e502e204973204d6f76696e6720746f20526573747269637420566f74696e6720526967687473)
    CTxOut(nValue=3.00000000, scriptPubKey=04678afdb0fe5548271967f1a67130)
  vMerkleTree: ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f





2014-04-12 20:56:32 a9d4e70111de34a5fe4d805b73a8c9d47467ee0cc24a8ee8b0f26ae5c7573a0a Block hashed using the non-existent Merkel - pzTimestamp
2014-04-12 20:56:32 0000000000000000000000000000000000000000000000000000000000000000 Genesis block, all the nNonces are set to 0 in main.cpp (this is normal)
2014-04-12 20:56:32 ed7ce3a32498164f1182dcfefa4aaf39a642e8eb9c258bc9555cc7b9e6e7e76f Valid Merkel Hash, generated using epoch time




 


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: sr.machado on April 14, 2014, 05:55:19 PM
Are ok, I get my test-coin running and ok, but I'm receiving too much coins that block permit.

My Genesis:
Code:
// Genesis block
        const char* pszTimestamp = "NY Times 13/Apr/2014 Obama Lets N.S.A. Exploit Some Internet Flaws, Officials Say";
        CTransaction txNew;
        txNew.vin.resize(1);
        txNew.vout.resize(1);
        txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
        txNew.vout[0].nValue = 3 * COIN;
        txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
        CBlock block;
        block.vtx.push_back(txNew);
        block.hashPrevBlock = 0;
        block.hashMerkleRoot = block.BuildMerkleTree();
        block.nVersion = 1;
        block.nTime    = 1397432434;
        block.nBits    = 0x1e0ffff0;
        block.nNonce   = 793395;

        if (fTestNet)
        {
            block.nTime    = 1397431832;
            block.nNonce   = 2434602;
        }

nSubsidy and time to create a new coin:
Code:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
    int64 nSubsidy = 3 * COIN;

    // Subsidy is cut in half every 840000 blocks, which will occur approximately
    nSubsidy >>= (nHeight / 840000); // XXX: 840k blocks

    return nSubsidy + nFees;
}

static const int64 nTargetTimespan = 8 * 60 * 60; // XXX: 8 hours target diff
static const int64 nTargetSpacing = 10 * 60; // XXX: 10 minutes to generate a new block
static const int64 nInterval = nTargetTimespan / nTargetSpacing;

main.h file with coins:
Code:
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;                      // 1000KB block hard limit
/** Obsolete: maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/4;         // 250KB  block soft limit
/** Default for -blockmaxsize, maximum size for mined blocks **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 250000;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 17000;
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = 100000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
/** The maximum number of orphan transactions kept in memory */
static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100;
/** The maximum number of entries in an 'inv' protocol message */
static const unsigned int MAX_INV_SZ = 50000;
/** The maximum size of a blk?????.dat file (since 0.8) */
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
/** Dust Soft Limit, allowed with additional fee per output */
static const int64 DUST_SOFT_LIMIT = 100000; // 0.001 OBM
/** Dust Hard Limit, ignored as wallet inputs (mininput default) */
static const int64 DUST_HARD_LIMIT = 1000;   // 0.00001 OBM mininput
/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 5040000 * COIN; // 5 Million
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 100;
/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov  5 00:53:20 1985 UTC
/** Maximum number of script-checking threads allowed */
static const int MAX_SCRIPTCHECK_THREADS = 16;
#ifdef USE_UPNP
static const int fHaveUPnP = true;
#else
static const int fHaveUPnP = false;
#endif


extern CScript COINBASE_FLAGS;
dPriority on main.h
Code:
static bool AllowFree(double dPriority)
    {
        // Large (in bytes) low-priority (new, small-coin) transactions
        // need a fee.
        return dPriority > COIN * 144 / 250;
    }

Why my coins are generating new blocks every 1 or 2 minutes?


Thanks




Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on April 14, 2014, 06:08:50 PM
The rate of block generation depends on your hashing rate. How many blocks have you mined since the genesis? Your diff adjustment interval is 48 blocks, so after that it should take a little longer.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: sr.machado on April 14, 2014, 06:34:48 PM
81 blocks.
I stop the coin, recompile now and try again.

Thanks


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wingding on May 08, 2014, 07:30:53 PM
Is there any advange using bitcoin-scrypt vs litecoin for this?
(I tried to build new block chain using litecoin, but get into same problems, the tips above did not fix)


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: chrisvl on May 01, 2015, 09:28:59 PM
Hi,

This is your genesis block hash:
Quote
2013-12-30 04:03:26 84d3cf22c9d4a4cbda424fc0e5a7169f33780395039b3959fec424649d690d07

Put that to this line:
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L34

This is your merkleroot:
Quote
2013-12-30 04:03:26 b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d

Put that to this line:
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L2786

After if you get somethink like this:
Quote
CheckProofOfWork() : hash doesn't match nBits

This genesis block is not good, because doest fit for start difficulty.
need a new one. Put this source code (http://pastebin.com/jDMPUNuP) before this line (block.print()):
Quote
https://github.com/litecoin-project/litecoin/blob/master-0.8/src/main.cpp#L2787

run the app, this will "mine" a new genesis block (need lot of time!!) for you.
 if it's founded, modify your source: nNonce, nTime and the new hash (GetHash = XX) for genesis block hash.

you can remove the inserted code, and you have a new altcoin  ;)

(if you want a testnet genesis block, do the same and dont forget to start with -testnet, and modify the testnet nNonce, nTime and hash!)

Elbandi
I have the same problem on sha256 all its ok on debug.log but nNONCE=0 any solution ?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: NattyLiteCoin on May 01, 2015, 11:52:22 PM
Wow. This is what a thread on altcoin forum was like 12 months ago. Amazing.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: tearodactyl on May 04, 2017, 06:11:17 PM
Updated 2017 status of the Genesis Block http://practicecoin.com/index.php/2017/04/19/genesis-block/


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wsxdrfv on February 13, 2018, 05:34:52 AM
So I want to clone newest source and make alt-coin.

But where is the part that make debug.log file for check and apply new genesis block's hash value?

So now, how to know what value should be replaced to

assert(consensus.hashGenesisBlock == uint256s("?"));
assert(genesis.hashMerkleRoot == unit256s("?));

at chainparams.cpp 's line 123~130 around.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: ir.hn on February 13, 2018, 05:50:54 AM
So I want to clone newest source and make alt-coin.

But where is the part that make debug.log file for check and apply new genesis block's hash value?

So now, how to know what value should be replaced to

assert(consensus.hashGenesisBlock == uint256s("?"));
assert(genesis.hashMerkleRoot == unit256s("?));

at chainparams.cpp 's line 123~130 around.

you need some printf statements to get started, I still don't have working genesis blocks but if you put the printf statements in like I have in my coin it should get you farther:

github.com/yenten2/yenten


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wsxdrfv on February 13, 2018, 06:28:29 AM
So I want to clone newest source and make alt-coin.

But where is the part that make debug.log file for check and apply new genesis block's hash value?

So now, how to know what value should be replaced to

assert(consensus.hashGenesisBlock == uint256s("?"));
assert(genesis.hashMerkleRoot == unit256s("?));

at chainparams.cpp 's line 123~130 around.

you need some printf statements to get started, I still don't have working genesis blocks but if you put the printf statements in like I have in my coin it should get you farther:

github.com/yenten2/yenten

Thx, so this part you wrote?

Code:
hashGenesisBlock = genesis.GetHash(); 
67           printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());
68 #if 0
69         {
70             printf("calc new genesis block\n");
71             printf("hashMerkleRoot %s\n", genesis.hashMerkleRoot.ToString().c_str());
72             printf("bnProofOfWorkLimit 0x%x\n", bnProofOfWorkLimit.GetCompact());
73             printf("genesis.nBits 0x%x\n", genesis.nBits);
74
 
75             for (genesis.nNonce = 0; ; genesis.nNonce++) {
76                 hashGenesisBlock = genesis.GetHash();
77                 if (hashGenesisBlock <= bnProofOfWorkLimit.getuint256()) break;
78             }
79
 
80             printf("hashGenesisBlock %s\n", hashGenesisBlock.ToString().c_str());
81             printf("genesis.nNonce %d\n", genesis.nNonce);
82         }
83 #endif

So then, where this printf result text be recorded we can know the hash value? I can't find any file generated at .bitcoin folder


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: ir.hn on February 14, 2018, 01:14:21 AM
mostly this one:

printf("genesis.GetHash = %s\n", genesis.GetHash().ToString().c_str());

I haven't gotten the others working yet either.  but when you run bitcoind or whatever it is called, it should display a hash that will "work".  then it will say testnet hash failed, put that code under the testnet genesis.gethash and it will give you a working hash for that and same with regnet.

Problem is those hashes don't meet the difficulty requirements so it will need to be mined but I don't know how to do that.  If you use a simple algorithm like sha256 or x11 you can check this out to generate them:

https://github.com/lhartikk/GenesisH0


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on February 16, 2018, 08:34:50 PM
Code:
if (false  && (block.GetHash() != hashGenesisBlock))
        {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
       if (block.nNonce % 10000 == 0) {
   printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
       }
           }
}



Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wsxdrfv on February 17, 2018, 05:12:02 AM
Code:
if (false  && (block.GetHash() != hashGenesisBlock))
       {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
      if (block.nNonce % 10000 == 0) {
  printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
      }
           }
}

Hi.
This code does not work on new source.
What variables should be changed to what?

I found only, 'block' should be 'genesis', but about others, I don't know. And CBigNum() does not exist in new source.

And when try to 'make', errors.

---------------
chainparams.cpp: In constructor ‘CMainParams::CMainParams()’:
chainparams.cpp:130:41: error: ‘CBigNum’ was not declared in this scope
            uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256(
                                         ^
chainparams.cpp:131:37: error: no match for ‘operator>’ (operand types are ‘uint256’ and ‘uint256’)
            while (genesis.GetHash() > hashTarget)
                                     ^
--------------


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on February 18, 2018, 03:58:27 PM

It's one implementation of the general genesis mining algo, taken from older source.. You need
to tweak it a little, but I prefer to leave that as an easy exercise.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wsxdrfv on February 20, 2018, 09:40:00 AM

It's one implementation of the general genesis mining algo, taken from older source.. You need
to tweak it a little, but I prefer to leave that as an easy exercise.
How to do it? How to set hashTarget based on new source?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: YarkoL on February 20, 2018, 04:46:43 PM

Well, if you want to learn this stuff, you need to know some C++ and then
it won't be that hard to figure out. Especially since there are lots of threads like
this on bitcointalk, just search.
 
If you just want to launch your own cryptocurrency, these days you can do that
very easily on Ethereum or some other smart contract platform.


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: chrisvl on February 20, 2018, 08:45:39 PM
Code:
if (false  && (block.GetHash() != hashGenesisBlock))
       {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
      if (block.nNonce % 10000 == 0) {
  printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
      }
           }
}

Hi.
This code does not work on new source.
What variables should be changed to what?

I found only, 'block' should be 'genesis', but about others, I don't know. And CBigNum() does not exist in new source.

And when try to 'make', errors.

---------------
chainparams.cpp: In constructor ‘CMainParams::CMainParams()’:
chainparams.cpp:130:41: error: ‘CBigNum’ was not declared in this scope
            uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256(
                                         ^
chainparams.cpp:131:37: error: no match for ‘operator>’ (operand types are ‘uint256’ and ‘uint256’)
            while (genesis.GetHash() > hashTarget)
                                     ^
--------------


Wich source do you use ?


Title: Re: The genesis block is hurting my soul.. Please help [25 MegaCoin bounty]
Post by: wsxdrfv on February 20, 2018, 09:30:14 PM
Code:
if (false  && (block.GetHash() != hashGenesisBlock))
       {
           printf("Mining genesis\n");
           uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
           while (block.GetHash() > hashTarget)
           {
               ++block.nNonce;
               if (block.nNonce == 0)
               {
                   printf("NONCE WRAPPED, incrementing time");
                   ++block.nTime;
               }
      if (block.nNonce % 10000 == 0) {
  printf("nonce %08u: hash = %s \n", block.nNonce, block.GetHash().ToString().c_str());
      }
           }
}

Hi.
This code does not work on new source.
What variables should be changed to what?

I found only, 'block' should be 'genesis', but about others, I don't know. And CBigNum() does not exist in new source.

And when try to 'make', errors.

---------------
chainparams.cpp: In constructor ‘CMainParams::CMainParams()’:
chainparams.cpp:130:41: error: ‘CBigNum’ was not declared in this scope
            uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256(
                                         ^
chainparams.cpp:131:37: error: no match for ‘operator>’ (operand types are ‘uint256’ and ‘uint256’)
            while (genesis.GetHash() > hashTarget)
                                     ^
--------------


Wich source do you use ?

Litecoin's newest source.