sr.machado
Sr. Member
Offline
Activity: 364
Merit: 250
Twitter: @leandrogmachado
|
|
April 11, 2014, 05:48:50 PM Last edit: April 11, 2014, 07:25:24 PM by sr.machado |
|
Testing... seems wonderful! 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: // 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 Why I receive this error? My debug.log file: 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:
|
BTC: 1LeandroRqTJf4stf2uD3TeYDszenqNHfz Bitcoin protocol consultor
|
|
|
Proteu5
Newbie
Offline
Activity: 52
Merit: 0
|
|
April 12, 2014, 04:05:22 AM |
|
Testing... seems wonderful! 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: // 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.jpgWhy I receive this error? My debug.log file: 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.jpgYour 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
|
|
|
|
YarkoL
Legendary
Offline
Activity: 996
Merit: 1013
|
|
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.
|
“God does not play dice"
|
|
|
sr.machado
Sr. Member
Offline
Activity: 364
Merit: 250
Twitter: @leandrogmachado
|
|
April 12, 2014, 01:34:56 PM Last edit: April 12, 2014, 09:00:05 PM by sr.machado |
|
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. 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? 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
|
BTC: 1LeandroRqTJf4stf2uD3TeYDszenqNHfz Bitcoin protocol consultor
|
|
|
satoru
Newbie
Offline
Activity: 9
Merit: 0
|
|
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. 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. 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? 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
|
|
|
|
sr.machado
Sr. Member
Offline
Activity: 364
Merit: 250
Twitter: @leandrogmachado
|
|
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: // 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: 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: /** 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 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
|
BTC: 1LeandroRqTJf4stf2uD3TeYDszenqNHfz Bitcoin protocol consultor
|
|
|
YarkoL
Legendary
Offline
Activity: 996
Merit: 1013
|
|
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.
|
“God does not play dice"
|
|
|
sr.machado
Sr. Member
Offline
Activity: 364
Merit: 250
Twitter: @leandrogmachado
|
|
April 14, 2014, 06:34:48 PM |
|
81 blocks. I stop the coin, recompile now and try again.
Thanks
|
BTC: 1LeandroRqTJf4stf2uD3TeYDszenqNHfz Bitcoin protocol consultor
|
|
|
wingding
|
|
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)
|
|
|
|
chrisvl
Legendary
Offline
Activity: 1274
Merit: 1006
Trainman
|
|
May 01, 2015, 09:28:59 PM |
|
Hi, This is your genesis block hash: 2013-12-30 04:03:26 84d3cf22c9d4a4cbda424fc0e5a7169f33780395039b3959fec424649d690d07 Put that to this line: This is your merkleroot: 2013-12-30 04:03:26 b6580b90a6dd4b1169d76f034d408cdaa07f44e653bca4da0cd4216d8b22cc0d Put that to this line: After if you get somethink like this: 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 before this line ( block.print()): 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 ?
|
|
|
|
NattyLiteCoin
|
|
May 01, 2015, 11:52:22 PM |
|
Wow. This is what a thread on altcoin forum was like 12 months ago. Amazing.
|
|
|
|
|
wsxdrfv
Jr. Member
Offline
Activity: 413
Merit: 5
|
|
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.
|
|
|
|
ir.hn
Member
Offline
Activity: 322
Merit: 54
Consensus is Constitution
|
|
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
|
|
|
|
wsxdrfv
Jr. Member
Offline
Activity: 413
Merit: 5
|
|
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? 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
|
|
|
|
ir.hn
Member
Offline
Activity: 322
Merit: 54
Consensus is Constitution
|
|
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
|
|
|
|
YarkoL
Legendary
Offline
Activity: 996
Merit: 1013
|
|
February 16, 2018, 08:34:50 PM |
|
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()); } } }
|
“God does not play dice"
|
|
|
wsxdrfv
Jr. Member
Offline
Activity: 413
Merit: 5
|
|
February 17, 2018, 05:12:02 AM |
|
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) ^ --------------
|
|
|
|
YarkoL
Legendary
Offline
Activity: 996
Merit: 1013
|
|
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.
|
“God does not play dice"
|
|
|
wsxdrfv
Jr. Member
Offline
Activity: 413
Merit: 5
|
|
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?
|
|
|
|
|