Title: More Genesis Block Discussion Post by: AlexMerced on April 27, 2013, 09:03:21 PM This is a seperate discussion from the one about how to generate a Genesis Block here:
https://bitcointalk.org/index.php?topic=187888.0 This thread I want to past the parts of the code that cover the genesis block for discussion of what the code is doing so I can better understand the process. I am using the SmallChange source code who's commit really well shows you all the edits you need to make a new Altcoin, I've been able to make all the changes except the pieces below which I am still trying to understand before I do any major tinkering (all the following snippets are found in main.cpp)... to see the small change source edits go here: https://github.com/bfroemel/smallchange/commit/947a0fafd8d033f6f0960c4ff0748f76a3d58326 Code: 1971 1974 pchMessageStart[1] = 0xc1; In this part I guess it just relates to generating the Gblock and puting in the number there. Code: 1992 - I'm assuming there are all the variables, but what is what and would I get them all from running a genesis block generating script. Code: // Genesis block This is the part that confuses me the most, what does the sentence have to do to it. Is the genesis block a numerical version of that phrase and they need to match? Code: 2013 - block.nTime = 1317972665; here seems to be just more plugging in of the variables from above Title: Re: More Genesis Block Discussion Post by: twobits on April 28, 2013, 08:10:22 AM The phrase is hashed into the block.
It is meant to be a proof of date. It is mean to be some fact that would not have been known before the date in it, to prove the block was made on of after that date. Title: Re: More Genesis Block Discussion Post by: AlexMerced on April 28, 2013, 02:25:41 PM Do I just change the phrase and the software will hash it, or do I need to Pre hash the text?
Title: Re: More Genesis Block Discussion Post by: AlexMerced on April 29, 2013, 01:15:34 PM Quote 1996 + // Genesis block: 1997 + // block.nTime = 1366559428 1998 + // block.nNonce = 2085386442 1999 + // block.GetHash = 384b060671f4a93948e9c168216dadb0ca2fbc54aa11c86b0345b6af1c59b2f5 2000 + // CBlock(hash=384b060671f4a93948e9, PoW=00000951e146b0026411, ver=1, 2001 + // hashPrevBlock=00000000000000000000, hashMerkleRoot=5a2e19825b, 2002 + // nTime=1366559428, nBits=1e0ffff0, nNonce=2085386442, vtx=1) 2003 + // CTransaction(hash=5a2e19825b, ver=1, vin.size=1, vout.size=1, nLockTime=0) 2004 + // CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d010441746f646f3a207265706c616365207769746820736f6d657468696e672074686 17420656e7375726573206e6f207072656d696e696e6720746f6f6b20706c616365) 2005 + // CTxOut(error) 2006 + // vMerkleTree: 5a2e19825b Let me rephrase the question, of the variables above, when creating an altcoin how many of them HAVE to be changes, if they need to be changes how many of them are arbrtitrary how many need to be generated by some other process. Title: Re: More Genesis Block Discussion Post by: twelph on May 01, 2013, 02:08:24 AM Bump because I would like to know this as well.
Title: Re: More Genesis Block Discussion Post by: solracx on May 02, 2013, 01:43:23 AM Do I just change the phrase and the software will hash it, or do I need to Pre hash the text? Choose a date. Change the text. Start with nonce = 0. Have it calculate the new block. Get the block hash and make it the merkel root. Done. Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 02, 2013, 02:19:33 AM here's another quote about the same deal for peoples reference:
Quote I got most of the coding done, it's mainly the gensis block is where I'm stuck at, if anyone would like to help pm me, ... the guy working with beertokens and WEEDS set-up a tool where anybody can create a genesis block fairly easily ... multi-coin and etc https://bitcointalk.org/index.php?topic=24209.msg300830#msg300830 (https://bitcointalk.org/index.php?topic=24209.msg300830#msg300830) https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt (https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt) for people who need advice compiling in windows... install openssl-1.0.1d or e, then make sure the include dir is in the build script. For windows build you see details here: https://bitcointalk.org/index.php?topic=149479.0 Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 02, 2013, 02:22:36 AM Do I just change the phrase and the software will hash it, or do I need to Pre hash the text? Choose a date. Change the text. Start with nonce = 0. Have it calculate the new block. Get the block hash and make it the merkel root. Done. sounds easy enough, most people discuss doing this using linux which I'm not as familiar with. Should I be ok doing this in codeblocks, basically changing the variables as you mention then building the code and running it? I also have VC++ but havn't learned how to use it yet mainly been using codeblocks so far. Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 02, 2013, 12:36:51 PM http://www.epochconverter.com/
this will give you the epoc time for block_nTime= Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 03, 2013, 12:29:47 PM lightenup gave me this advice for generating a genesis block:
Quote Well, change something in the genesis block data and observe the assertion when you start the node software. For actual genesis block generation look at what happens after the assertion in the code: Code: assert(block.hashMerkleRoot == uint256("0x5a2e19825b4162f68602039040f1e05d9f924ff00a3aff7327ca6abd6f3279bc")); // If genesis block hash does not match, then generate new genesis hash. if (false && block.GetHash() != hashGenesisBlock) { So you'd need to change this if(false && ... ) to if (true && ...) s.t. the node software tries to find the genesis hash. Concerning your previous question: you need to lookup base58. It appears that the letter S is encoded as 62 and s (smaller case S) is 63, 64 would be a T a.s.o. .. I just counted away from the original Litecoin code base where it has been an L. So using all the other advice can someone confirm the following for me: - Step 1 Set the nonce value to 0 and change the Timestamp to a recent headling - change the false&& to true&& - Compile the software - When It attempts to find the block and see if it does not match the timestamp if will begin mining the new genesis block - Once it does this successfully example the block.dat and get the hash - hardcode the hash into the code - job complete Is this about right? Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 05, 2013, 12:35:38 PM What I did so far:
Change pszTimestamp to a sentence from newspaper change block.nTime to current time compile run compiled source with -testnet -noirc now u see some lines and a crash Code: b115383690ee67ebeef9a7e754342638cd7bbf488561998e6d1bc1ed367484f6 // Block derived from pszTimestamp corresponding to code: Code: //// debug print update main.cpp with the mentioned merkleroot (it crashed because of the last assert) and run again you should have already changed the false to true in Code: // If genesis block hash does not match, then generate new genesis hash. so it will find a genesis block for your string after a long time you get: Code: nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000) Now you have the valid Genesisblock and nNonce: block.nNonce = 3939341 block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33 Update your code with these values and your ready to go! Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 05, 2013, 02:25:13 PM What I did so far: Change pszTimestamp to a sentence from newspaper change block.nTime to current time compile run compiled source with -testnet -noirc now u see some lines and a crash Code: b115383690ee67ebeef9a7e754342638cd7bbf488561998e6d1bc1ed367484f6 // Block derived from pszTimestamp corresponding to code: Code: //// debug print update main.cpp with the mentioned merkleroot (it crashed because of the last assert) and run again you should have already changed the false to true in Code: // If genesis block hash does not match, then generate new genesis hash. so it will find a genesis block for your string after a long time you get: Code: nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000) Now you have the valid Genesisblock and nNonce: block.nNonce = 3939341 block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33 Update your code with these values and your ready to go! nice, where am I putting -testnet -noirc, is that in command line or make file? Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 05, 2013, 03:11:24 PM In command line..
Don't really think it matters much, as long as you delete ur wallet u should be able to start over again any time. However you can tweak the test setting for testimg purposes (see what difficulty does etc..). I'm now mining my own coin :-p However i haven't actually found the genesis block. I expected it to be in my wallet with a transaction, but it isn't.. Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 05, 2013, 04:23:44 PM In command line.. Don't really think it matters much, as long as you delete ur wallet u should be able to start over again any time. However you can tweak the test setting for testimg purposes (see what difficulty does etc..). I'm now mining my own coin :-p However i haven't actually found the genesis block. I expected it to be in my wallet with a transaction, but it isn't.. From what I read I think some will create a script that automatically mines the genesis block to save time, otherwise I guess it takes awhile, I guess for Saotoshi it took 6 days Keep me updated on your progress in this thread! What's the name of your coin? Title: Re: More Genesis Block Discussion Post by: Gavin Andresen on May 05, 2013, 04:31:40 PM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 05, 2013, 04:53:03 PM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. I'm trying to learn been studying furiously Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 05, 2013, 05:35:42 PM Gavin, you can probably a question i'm having.. I "mined" the genesis block, and it shows op in the daemon when I query it with getblockhash 0. I also see that it contains exactly 1 transaction like it's supposed to.
What I don't get is that "mining" (generating sounds better) the genesis block happens before you actually create a wallet so that one transaction is not "in" my wallet. I assume this is caused by the txNew lines in LoadBlockIndex: Code: CTransaction txNew; This was changes in the Smallchange code to: Code: CTransaction txNew; I'm assuming that this code creates a transaction from the genesis block to a wallet address. In Litecoin this is Code: CScript() << ParseHex("040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9") << OP_CHECKSIG; In SmallChange this is changed to 0x0 but that doesn't matter because the value is 0 anyway. I copied that smallchange code however and changed the value to 10. Now when I look at the genesis block I get: Code: "tx" : [ Code: hashMerkleRoot=d966cccce1, nTime=1367758074, nBits=1e0ffff0, nNonce=924421, vtx=1) when I try to read the transaction i get Code: error: {"code":-5,"message":"No information available about transaction"} Now for the question... How can I populate this line Code: txNew.vout[0].scriptPubKey = CScript() << 0x0 << OP_CHECKSIG; If I don't have a wallet yet? Or do you simply create the wallet first, retrieve the address and start again? Thanks Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 05, 2013, 06:54:19 PM OK Think I found the answer.. Gavin if you could confirm I understand it that would be very nice :D
The key used in the source at Code: txNew.vout[0].scriptPubKey Is the public ECDSA key for that address right? So all you have to do is create a public/private ECDSA keypair and convert the public key to an address using: Version = 1 byte of 0 (zero); on the test network, this is 1 byte of 111 // Or whatever is set in base58.h Key hash = Version concatenated with RIPEMD-160(SHA-256(public key)) Checksum = 1st 4 bytes of SHA-256(SHA-256(Key hash)) Xxxcoin Address = Base58Encode(Key hash concatenated with Checksum) To import the private key in my new wallet I would have to follow these steps: Code: 1 - Take a private key Does that sum it up? Thanks Title: Re: More Genesis Block Discussion Post by: marcus_of_augustus on May 06, 2013, 04:30:36 AM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. I agree, I was thinking this also .... people are free to experiment but who would want to put trust in a blockchain that was began by someone who was not yet fully competent to create their own genesis block is probably the free market answer ... Title: Re: More Genesis Block Discussion Post by: AlexMerced on May 06, 2013, 11:09:08 AM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. I agree, I was thinking this also .... people are free to experiment but who would want to put trust in a blockchain that was began by someone who was not yet fully competent to create their own genesis block is probably the free market answer ... I get that but who said I'm trying to compete with bitcoin, as I've said before I'm doing this to learn more about bitcoin and also to commemorate f.a. Hayek. Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 06, 2013, 11:59:27 AM I agree, I was thinking this also .... people are free to experiment but who would want to put trust in a blockchain that was began by someone who was not yet fully competent to create their own genesis block is probably the free market answer ... So what then? I thought this forum was meant for people to ask questions, apparently I was wrong in that assumption. I'm trying to understand how it all works. Best way for me to learn is to actually do stuff (If you ever developed anything you'd know you don't learn that from books ;-)). I just checked somethings.. the last two altcoins were created by peopl with less than 20 posts on this forum.. Does that mean they are geniusses? I'd rather put my trust in someone that asks things if he's not sure, than in someone who doesnt.. As for that matter, let's say I am developing an altcoin to be released, wouldn't you rather have it released by someone who's been asking around? So far I managed to do almost everything without asking for help, but even that one question I asked is still unanswered on the forum.. Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 06, 2013, 12:05:58 PM OK Think I found the answer.. Gavin if you could confirm I understand it that would be very nice :D The key used in the source at Code: txNew.vout[0].scriptPubKey Is the public ECDSA key for that address right? To answer yet again my own question: It is... And the steps I provided are correct.. Below a simple python script to generate the WIF and Wallet address (courtesy of a number of ppl on the forum) Code: import hashlib, binascii Might have to be adapted a bit for your purpose depending on what's in base58.cpp Also a nice script to generate ECDSA keypairs (for testing purposes only!) Code: #!/usr/bin/env python Title: Re: More Genesis Block Discussion Post by: marcus_of_augustus on May 07, 2013, 10:56:03 AM Doesn't mean I'm not liking this thread .... :)
Title: Re: More Genesis Block Discussion Post by: tyrion70 on May 07, 2013, 11:04:47 AM Doesn't mean I'm not liking this thread .... :) :P good! In the meanwhile I'm getting the hang of it.. The thing that I have the most problems with is the language itself.. Never did anything with c++.. It's not too hard, but you have to get to know the syntax and variable definitions..Title: Re: More Genesis Block Discussion Post by: shakezula on May 09, 2013, 11:08:02 PM after a long time you get... How long? What kind of processing power? Title: Re: More Genesis Block Discussion Post by: shakezula on May 10, 2013, 12:23:36 AM OK, scratch that. Now I have mined a Genesis block, set up some .conf info--how do I mine my new coin? Everything I get from ./coinname getinfo looks right, but I get error 500 when trying to connect minerd...
Whats the next step? Title: Re: More Genesis Block Discussion Post by: joehop67 on May 16, 2013, 08:50:13 PM Okay So I know this thread is a bit old but I need some help. I tried the steps to get the genesis block (Change nonce to 0 and change "if (false && block.GetHash()" to "if (true && block.GetHash()") I did all that and compiled it and it ran for about half an hour before displaying this error: "litecoind: main.cpp:2061: bool LoadBlockIndex(bool): Assertion `block.GetHash() == hashGenesisBlock' failed." Also tried with SmallChange and got the same result.
Any idea how I could fix this? Title: Re: More Genesis Block Discussion Post by: Meizirkki on August 12, 2013, 11:21:07 PM Code: [s]txNew.vout[0].scriptPubKey [/s] Quote Quote block.nNonce = 2346298 block.GetHash = 49cc7e4d0c6fb00ae3aea9aecf4a7d307c908d5d7e247c6874cf8244e286911a CBlock(hash=49cc7e4d0c6fb00ae3aea9aecf4a7d307c908d5d7e247c6874cf8244e286911a, input=0100000000000000000000000000000000000000000000000000000000000000000000009470a34f0ff567feff10effc36ede7a52d9bf02675b92923d55a43f0466a7e975f234734f0ff0f1e3acd2300, PoW=000009daf88f3a7f9aab10a2d65d32ecc85243395210b941c944a6c7c22b4e5b, ver=1, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=977e6a46f0435ad52329b97526f09b2da5e7ed36fcef10fffe67f50f4fa37094, nTime=877077343, nBits=1e0ffff0, nNonce=2346298, vtx=1) CTransaction(hash=977e6a46f0435ad52329b97526f09b2da5e7ed36fcef10fffe67f50f4fa37094, ver=1, vin.size=1, vout.size=1, nLockTime=0) CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 04ffff001d01042c4b6164756e76616c7461616a617420707973c3a479747469206c69696b656e7 465656e207374616469737361) CTxOut(nValue=514000000.00000000, scriptPubKey=04f93d54b7873cad866b9d9670717c) vMerkleTree: 977e6a46f0435ad52329b97526f09b2da5e7ed36fcef10fffe67f50f4fa37094 EDIT: Nevermind! I just had to mine another block and it showed up. Title: Re: More Genesis Block Discussion Post by: awais3344 on February 24, 2014, 07:07:22 AM this is quite an old thread, but I think it would be best place to post for help.
I changed the ntime to current epoch time, and changed nnonce to 0. Now i compiled and run the qt. it says assertion failed src\main.cpp line 2870 expression: hash == hashgenesisblock. Okay, so i went to appdata folder, and then there is qt folder. but there is an empty db.log file, and there is no debug.log file. I run the wallet even through testnet and noirc, still no debug.log file appears. can anyone help? Title: Re: More Genesis Block Discussion Post by: apple_talk on February 25, 2014, 10:49:40 PM What I did so far: Change pszTimestamp to a sentence from newspaper change block.nTime to current time compile run compiled source with -testnet -noirc now u see some lines and a crash Code: b115383690ee67ebeef9a7e754342638cd7bbf488561998e6d1bc1ed367484f6 // Block derived from pszTimestamp corresponding to code: Code: //// debug print update main.cpp with the mentioned merkleroot (it crashed because of the last assert) and run again you should have already changed the false to true in Code: // If genesis block hash does not match, then generate new genesis hash. so it will find a genesis block for your string after a long time you get: Code: nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000) Now you have the valid Genesisblock and nNonce: block.nNonce = 3939341 block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33 Update your code with these values and your ready to go! Complied & got following error... root@PC:~/Desktop/litecoin-master-0.8/src# ABCcoind -testnet -noirc -debug -debugnet ABCcoind: main.cpp:2820: bool InitBlockIndex(): Assertion `block.hashMerkleRoot == uint256("0x")' failed. Aborted (core dumped) in Test folder "debug.log" file 2014-02-25 19:40:36 ABCcoin version v0.8.6.2-g85f303d-beta () 2014-02-25 19:40:36 Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013 2014-02-25 19:40:36 Default data directory /home/user/.ABCcoin 2014-02-25 19:40:36 Using data directory /home/user/.ABCcoin 2014-02-25 19:40:36 Using at most 125 connections (1024 file descriptors available) 2014-02-25 19:40:36 Using 3 threads for script verification 2014-02-25 19:40:36 init message: Verifying wallet... 2014-02-25 19:40:36 dbenv.open LogDir=/home/user/.ABCcoin/database ErrorFile=/home/user/.ABCcoin/db.log 2014-02-25 19:40:36 Bound to [::]:2095 2014-02-25 19:40:36 Bound to 0.0.0.0:2095 2014-02-25 19:40:36 init message: Loading block index... 2014-02-25 19:40:36 Opening LevelDB in /home/user/.ABCcoin/blocks/index 2014-02-25 19:40:36 Opened LevelDB successfully 2014-02-25 19:40:36 Opening LevelDB in /home/user/.ABCcoin/chainstate 2014-02-25 19:40:36 Opened LevelDB successfully 2014-02-25 19:40:36 LoadBlockIndexDB(): last block file = 0 2014-02-25 19:40:36 LoadBlockIndexDB(): transaction index disabled 2014-02-25 19:40:36 Initializing databases... 2014-02-25 19:40:36 76f8df0283035323c583d14526d80fa06c22d8bfc0a4c564aa0e6549f4fbc4f5 2014-02-25 19:40:36 0000000000000000000000000000000000000000000000000000000000000000 2014-02-25 19:40:36 1eecade19537e2891642e0995c119941d4dcf384b60ae013fcadf7b97a8cd5a9 I even deleted Complied, change block.nTime, same output on screen & debug values also same. What could be wrong? Title: Re: More Genesis Block Discussion Post by: Meizirkki on March 01, 2014, 06:20:31 AM Iirc you now have the valid merkleroot from the debug:
Quote 2014-02-25 19:40:36 1eecade19537e2891642e0995c119941d4dcf384b60ae013fcadf7b97a8cd5a9 Which you need to put in place of the previous merkleroot you deleted. After you recompile and run the code, it should start hashing a genesis block for you. (if you have the function in place and enabled) Title: Re: More Genesis Block Discussion Post by: apple_talk on March 01, 2014, 05:53:02 PM OK, scratch that. Now I have mined a Genesis block, set up some .conf info--how do I mine my new coin? Everything I get from ./coinname getinfo looks right, but I get error 500 when trying to connect minerd... Whats the next step? I am also having same question, got everything but now how do I get new coin. ./ABCcoind -server -rpcallowip=* root@ABCcoin:~/ABC/src# ./ABCcoind getinfo { "version" : 80602, "protocolversion" : 70003, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 0, "timeoffset" : 0, "connections" : 0, "proxy" : "", "difficulty" : 0.00024414, "testnet" : false, "keypoololdest" : 1393660893, "keypoolsize" : 98, "paytxfee" : 0.00000000, "mininput" : 0.00001000, "unlocked_until" : 0, "errors" : "" } root@ABCcoin:~/ABC/src# ./ABCcoind getmininginfo { "blocks" : 0, "currentblocksize" : 1000, "currentblocktx" : 0, "difficulty" : 0.00024414, "errors" : "", "generate" : true, "genproclimit" : 2, "hashespersec" : 0, "networkhashps" : 0, "pooledtx" : 0, "testnet" : false } Minerd.exe -a scrypt -o http://192.168.1.116:20120 -u ABCcoinrpc -p test --no-stratum --no-longpoll -t 1 [2014-03-01 09:29:35] 1 miner threads started, using 'scrypt' algorithm. [2014-03-01 09:29:35] HTTP request failed: The requested URL returned error: 500 Internal Server Error [2014-03-01 09:29:35] json_rpc_call failed, retry after 30 seconds [2014-03-01 09:30:05] HTTP request failed: The requested URL returned error: 500 Internal Server Error Port is correct & listening. Title: Re: More Genesis Block Discussion Post by: awais3344 on March 02, 2014, 09:08:06 AM i ran my coin daemon on 2 pcs. And used daemon=1 and addnode=xx.xx.xx.xx (other pc's ip with running daemon)
they never connect. Title: Re: More Genesis Block Discussion Post by: Meizirkki on March 02, 2014, 10:08:52 PM iirc you can use a --connect=IP argument with the daemon. That should get your nodes to connect to each other.
And apple_talk, you need at least 2 peers in your coins network to mine. Title: Re: More Genesis Block Discussion Post by: defaced on March 02, 2014, 10:57:56 PM someone cast res on this thread.
Title: Re: More Genesis Block Discussion Post by: awais3344 on March 03, 2014, 09:41:53 AM iirc you can use a --connect=IP argument with the daemon. That should get your nodes to connect to each other. And apple_talk, you need at least 2 peers in your coins network to mine. I did use -connect and it says couldn't connect to host server. Title: Re: More Genesis Block Discussion Post by: Meizirkki on March 03, 2014, 11:09:10 AM iirc you can use a --connect=IP argument with the daemon. That should get your nodes to connect to each other. And apple_talk, you need at least 2 peers in your coins network to mine. I did use -connect and it says couldn't connect to host server. Title: Re: More Genesis Block Discussion Post by: awais3344 on March 03, 2014, 04:52:45 PM iirc you can use a --connect=IP argument with the daemon. That should get your nodes to connect to each other. And apple_talk, you need at least 2 peers in your coins network to mine. I did use -connect and it says couldn't connect to host server. yeah i cloned doge. which has port 22555 by default Title: Re: More Genesis Block Discussion Post by: apple_talk on March 05, 2014, 03:11:16 PM i ran my coin daemon on 2 pcs. And used daemon=1 and addnode=xx.xx.xx.xx (other pc's ip with running daemon) they never connect. Thanks it works :) need 2 PCs Title: Re: More Genesis Block Discussion Post by: apple_talk on March 05, 2014, 03:13:53 PM What is public ECDSA key ?
https://bitcointalk.org/index.php?topic=494319.msg5447917 Thanks Title: Re: More Genesis Block Discussion Post by: awais3344 on March 05, 2014, 05:44:19 PM i ran my coin daemon on 2 pcs. And used daemon=1 and addnode=xx.xx.xx.xx (other pc's ip with running daemon) they never connect. Thanks it works :) need 2 PCs didnt work for me :-\ but have fun :) Title: Re: More Genesis Block Discussion Post by: Lloydie on March 19, 2014, 02:06:05 PM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 06, 2014, 06:50:29 PM Using following code in main.cpp if using n-Scrypt (X11), it gives error when compiling. Any suggestion?
Code: if (true && block.GetHash() != hashGenesisBlock) Error when compiling: main.cpp: In function ‘bool InitBlockIndex()’: main.cpp:2996:35: error: ‘SCRYPT_SCRATCHPAD_SIZE’ was not declared in this scope char scratchpad[SCRYPT_SCRATCHPAD_SIZE]; ^ main.cpp:3012:91: error: ‘scratchpad’ was not declared in this scope scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad); ^ main.cpp:3012:101: error: ‘scrypt_1024_1_1_256_sp_generic’ was not declared in this scope scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad); ^ Title: Re: More Genesis Block Discussion Post by: voileipa on April 06, 2014, 08:30:35 PM Here is a python script for generating the parameters needed for sha256/scrypt genesis block
https://github.com/lhartikk/GenesisH0 Title: Re: More Genesis Block Discussion Post by: YarkoL on April 06, 2014, 08:39:08 PM Using following code in main.cpp if using n-Scrypt (X11), it gives error when compiling. Any suggestion? What value have you set for the scratchpad size? Title: Re: More Genesis Block Discussion Post by: apple_talk on April 06, 2014, 11:24:45 PM Thanks Guys.
here is main.cpp file. Code: http://pastebin.com/TSemSTkK The generating code works fine for scrypt, but for some reason not n-scrypt (X11). I have included complete code of main.cpp. It seems the GenesisH0 needs update to support X11 scrypt. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 03:13:45 PM Ran on Ubuntu 13.10 64bit
/GenesisH0# python genesis.py -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -n 2083236893 -t 1231006505 Traceback (most recent call last): File "genesis.py", line 2, in <module> import scrypt ImportError: No module named scrypt what package I need using APT-GET, thanks UPDATE:- Never mind, needed python-pip installed first. sudo apt-get install python-pip pip install scrypt construct and then genesis.py scrypt runs. but, using these values in X11 scrypt does not work. fine for litecoin scrypt. Wondering is it possible maybe get scrypt updated to support X11, which is becoming standard now. Title: Re: More Genesis Block Discussion Post by: YarkoL on April 07, 2014, 04:44:18 PM Well you obviously need python implementation of scrypt...
Are trying to make your own coin? I strongly recommend that you learn a bit of c++ so that you know what kind of questions to ask when obstacles present themselves. Especially since people might even invest their hard-earned money in the coin you have rolled. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 04:52:35 PM Well you obviously need python implementation of scrypt... Are trying to make your own coin? I strongly recommend that you learn a bit of c++ so that you know what kind of questions to ask when obstacles present themselves. Especially since people might even invest their hard-earned money in the coin you have rolled. yes I do have some experience & knowledge in C++, perl. I know code is looking for declared global or local variable SCRYPT_SCRATCHPAD_SIZE, Title: Re: More Genesis Block Discussion Post by: YarkoL on April 07, 2014, 05:50:52 PM edit. I took a look at Vertcoin source, and there you have main.cpp 4745: Code: unsigned long int scrypt_scratpad_size_current_block = ((1 << (GetNfactor(pblock->nTime) + 1)) * 128 ) + 63; Looks like n-scrypt resizes scratchpad per block. Your best bet is to study Vertcoin or some other similar coin and make changes accordingly. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 06:37:24 PM edit. I took a look at Vertcoin source, and there you have main.cpp 4745: Code: unsigned long int scrypt_scratpad_size_current_block = ((1 << (GetNfactor(pblock->nTime) + 1)) * 128 ) + 63; Looks like n-scrypt resizes scratchpad per block. Your best bet is to study Vertcoin or some other similar coin and make changes accordingly. use the above python script got values & hash, updated main.cpp & checkpoint.cpp removed genesis generating code from main.cpp Compile the code. Ran it... root@PC:~/src# ./vicoind vicoind: main.cpp:3050: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed. Aborted (core dumped) so I guess you are right, the scrypt does not support X11 scrypt coin. I looked at the code of the scrypt it is few lines, is it possible to modify it, maybe you can help out. Code: import hashlib, binascii, struct, array, os, time, sys, optparse Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 06:39:00 PM Now something like
https://github.com/evan82/darkcoin/blob/master/src/main.cpp uses same setup as well? Title: Re: More Genesis Block Discussion Post by: YarkoL on April 07, 2014, 06:50:53 PM It looks like InitBlockIndex() is the same in Darkcoin, so you could try running that and see if you get the values.
Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 08:08:49 PM It looks like InitBlockIndex() is the same in Darkcoin, so you could try running that and see if you get the values. Got same result using darkcoin as well. their must be easy way to change the python scrypt in include X11 info as well. Title: Re: More Genesis Block Discussion Post by: YarkoL on April 07, 2014, 10:00:38 PM Ok. I had yet another look at this. I thought scrypt-n is one of the x11 algorithms but apparently it is not.. :-[
Because of that, the genesis block-producing code that you posted will not work, as it is for "standard scrypt". When I have little more time I'll see if I can figure it out. But first let's be clear; are you after X11 or scrypt-N coin? Title: Re: More Genesis Block Discussion Post by: apple_talk on April 07, 2014, 10:10:25 PM Ok. I had yet another look at this. I thought scrypt-n is one of the x11 algorithms but apparently it is not.. :-[ Because of that, the genesis block-producing code that you posted will not work, as it is for "standard scrypt". When I have little more time I'll see if I can figure it out. But first let's be clear; are you after X11 or scrypt-N coin? X11 btw, I used the existing code... copied working X11 hash/root/timestamp from another coin, it worked like charm. So it is just the matter of script generating that needs update. Title: Re: More Genesis Block Discussion Post by: YarkoL on April 08, 2014, 12:00:46 AM Edit:
For the sake of possible future readers, rather than handing them a fully baked solution, I will just give outline of the procedure. Y'know. give man a fish / teach him to fish and so on... So if you want to get a new genesis block out of Darkcoin that uses X11 or any coin at all that has been forked out of Bitcoin, here are the steps, most of which can be inferred from this thread also. You need to change szTimesstamp and nTime. Zero the nonce, merkle root and old genesis block. Compile and run. Boom. Here's the genesis block and merkle root as they come from the printf statements in InitBlockIndex(). If you substitute them into the code, your gen block will be accepted, but you will run into this: Code: hash doesn't match nBits. The code snippet (see above) that begins with Code: if (true && block.GetHash() != hashGenesisBlock) will help you to find the right hash for nBits. You just need to read what it does. It is looping an algorithm and increasing nonce to find a block that satisfies the difficulty. I.e. it is mining. Is it running scrypt? No it isn't, this is X11, so get rid of all that. Where do you get the X11 algorithm? Take a look at the error message you're getting. That should be enough... Title: Re: More Genesis Block Discussion Post by: apple_talk on April 08, 2014, 02:24:19 AM appreciate :)
I will try it shortly. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 08, 2014, 07:04:41 AM did not work, it failed.
Title: Re: More Genesis Block Discussion Post by: YarkoL on April 08, 2014, 07:07:18 AM did not work, it failed. Worked for me. What error report? Title: Re: More Genesis Block Discussion Post by: defaced on April 08, 2014, 01:09:07 PM Edit: For the sake of possible future readers, rather than handing them a fully baked solution, I will just give outline of the procedure. Y'know. give man a fish / teach him to fish and so on... So if you want to get a new genesis block out of Darkcoin that uses X11 or any coin at all that has been forked out of Bitcoin, here are the steps, most of which can be inferred from this thread also. You need to change szTimesstamp and nTime. Zero the nonce, merkle root and old genesis block. Compile and run. Boom. Here's the genesis block and merkle root as they come from the printf statements in InitBlockIndex(). If you substitute them into the code, your gen block will be accepted, but you will run into this: Code: hash doesn't match nBits. The code snippet (see above) that begins with Code: if (true && block.GetHash() != hashGenesisBlock) will help you to find the right hash and nBits. You just need to read what it does. It is looping an algorithm and increasing nonce to find a block that satisfies the difficulty. I.e. it is mining. Is it running scrypt? No it isn't, this is X11, so get rid of all that. Where do you get the X11 algorithm? Take a look at the error message you're getting. That should be enough... I think this is the best way to handle it. Teaching people to fish that is. Title: Re: More Genesis Block Discussion Post by: apple_talk on April 08, 2014, 08:42:48 PM did not work, it failed. Worked for me. What error report? PM you error message yesterday. btw, found X11 relate gen code, not sure if this is valid... Code: if (true && block.GetHash() != hashGenesisBlock) Title: Re: More Genesis Block Discussion Post by: YarkoL on April 08, 2014, 09:10:45 PM apple_talk:
replied to your pm btw, found X11 relate gen code, not sure if this is valid... Why not try and see? ;D Title: Re: More Genesis Block Discussion Post by: joblessminer on April 09, 2014, 05:08:57 PM I think this is the best way to handle it. Teaching people to fish that is. Haha... you are part of some jealous assh#ole herd, I see assh## like you never help anyone & can't stand anyone else helping out as well. If anyone needs help with genesis please contact me, I will help out for free. Title: Re: More Genesis Block Discussion Post by: anush3070 on April 15, 2014, 09:21:21 AM Hello,
You can use this Code to find Genesis Block for N-Scrypt, Insert it before ///debug print comment which would be near hashMerkleRoot and compile ^_^: Code: if (true &&block.GetHash() != hashGenesisBlock) Title: Re: More Genesis Block Discussion Post by: nesticely on April 18, 2014, 08:17:48 AM I have the following problem - when I compile daemon based on fehcoin (with pszTimestamp, block.nTime etc. changes) and I run it, I get empty nNonce:
Code: Loading block index... block.nNonce = 0 Why is this happening? Title: Re: More Genesis Block Discussion Post by: anush3070 on April 18, 2014, 08:22:01 AM I have the following problem - when I compile daemon based on fehcoin (with pszTimestamp, block.nTime etc. changes) and I run it, I get empty nNonce: Code: Loading block index... block.nNonce = 0 Why is this happening? Do This Modification in the Code: Hello, You can use this Code to find Genesis Block for N-Scrypt, Insert it before ///debug print comment which would be near hashMerkleRoot and compile ^_^: Code: if (true &&block.GetHash() != hashGenesisBlock) Title: Re: More Genesis Block Discussion Post by: nesticely on April 18, 2014, 06:06:04 PM I have the following problem - when I compile daemon based on fehcoin (with pszTimestamp, block.nTime etc. changes) and I run it, I get empty nNonce: Code: Loading block index... block.nNonce = 0 Why is this happening? Do This Modification in the Code: Hello, You can use this Code to find Genesis Block for N-Scrypt, Insert it before ///debug print comment which would be near hashMerkleRoot and compile ^_^: Code: if (true &&block.GetHash() != hashGenesisBlock) thank ;D ;D ;D Title: Re: More Genesis Block Discussion Post by: hadi on May 26, 2014, 09:36:59 AM Hey... My x11 source code is Code: //// debug print i cant get hashGenesisBlock. after compiling with true time and hash,just recieve this error " failed to read block " what i do ? Title: Re: More Genesis Block Discussion Post by: voileipa on May 26, 2014, 10:01:46 AM Hey... My x11 source code is Code: //// debug print i cant get hashGenesisBlock. after compiling with true time and hash,just recieve this error " failed to read block " what i do ? Title: Re: More Genesis Block Discussion Post by: PereguineBerty on May 26, 2014, 08:27:05 PM See what you guys mean with X11 errors. I've played around with Scrypt in the past and it's pretty much plain sailing but with x11 PoS it's been an absolute nightmare so far...
Even after getting what appears to be valid merkle root, nonce and genesis hash, it still fails when running on both testnet and main-net with this error: Code: Assertion `block.GetHash() == (!fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet)' failed. I've taken Yarkol's advice and it has been pretty helpful but if the debug.log clearly states these values and no other errors, then I'm a loss as to why the genesis blocks aren't being created. Code: Opened LevelDB successfully The testnet (the output above) and main-net genesis hashes have been added into main.h but it still fails to run? Title: Re: More Genesis Block Discussion Post by: hadi on May 27, 2014, 10:17:54 AM i dont know why i have not " block.GetHash() == 000030b4df1fca238412d3acb536f920fb3fe4fc2b1255c40e78d54ac791e1ac" section in my debug.log in x11 algorytm.
here is my main.cpp Code: // Only add the genesis block if not reindexing (in which case we reuse the one already on disk) and my wallet closed with Failed to read block and my debug.log is Code: 2014-05-27 09:31:24 any idea about working ? i recompile it over 10 times Title: Re: More Genesis Block Discussion Post by: YarkoL on May 27, 2014, 11:19:02 AM @PereguineBerty
It's hard to say what the issue exactly is, but hardly a x11 error if you haven't got past the hash identity assertion yet. Maybe you could start by simplifying this a little Code: !fTestNet ? hashGenesisBlock : hashGenesisBlockTestNet) i.e scrap the ternary operator, feed straight values into it so you can begin to track down why the block hash isn't the same as your gen block hash Title: Re: More Genesis Block Discussion Post by: PereguineBerty on May 27, 2014, 08:10:25 PM Thanks for the info YarkoL.
I managed to get it working fine today. After doing the same thing a long time ago with Scrypt, I recollect it taking a while to grind through a range of hashes and nonces. Thought this was going to happen again and it threw me off the trail because all the correct stuff was there instantly and it seemed too good to be true, so I ignored it (stupidly) :) Got issues with segmentation faults and missing setgenerate RPC commands now. Oh happy days!!! Title: Re: More Genesis Block Discussion Post by: YarkoL on May 27, 2014, 08:17:39 PM Yeah X11 is more cpu-friendly :) Title: Re: More Genesis Block Discussion Post by: PereguineBerty on May 27, 2014, 08:23:28 PM Hehe.. detecting a subtle hint of sarcasm there :)
Title: Re: More Genesis Block Discussion Post by: e1ghtSpace on June 14, 2014, 09:26:46 PM Can someone please help me?
This is what I have in main.cpp: Code: const char* pszTimestamp = "14 June 2014 Soceroos lose to Chile 3-1 in FIFA world cup"; And in debug.log all I get is: Code: CBlock(hash=694b3a55a61339b43c01421b13f710e22e33a7eabda1cd48103bb9f376081d16, ver=0, hashPrevBlock=0000000000000000000000000000000000000000000000000000000000000000, hashMerkleRoot=0000000000000000000000000000000000000000000000000000000000000000, nTime=0, nBits=00000000, nNonce=0, vtx=1, vchBlockSig=) What did I do wrong? (i'm trying to replace 0x0 with the Merkle Root) Title: Re: More Genesis Block Discussion Post by: YarkoL on June 14, 2014, 11:46:48 PM try moving the block.print() statement
before the assertion Title: Re: More Genesis Block Discussion Post by: Restincoin on June 21, 2014, 09:33:38 PM I hope someone can help me out with my pb
I got genesisblock on testnet, I try to test mining my testnet coins. I use 2 computers with each one ubuntu VM and different IP. I launch daemon and I try to get my PCs connected I use the following cmd: Quote ./myCoind -testnet with following config: Quote rpcuser=user rpcpassword=pass server=1 addnode=ip_PC1 addnode=ip_PC2 rpcport=xxxxx listen=1 My pb is i can't get connections with PC1 and PC2. Quote "walletversion" : 60000, "balance" : 0.00000000, "newmint" : 0.00000000, "stake" : 0.00000000, "blocks" : 0, "timeoffset" : 0, "moneysupply" : 0.00000000, "connections" : 0, "proxy" : "", "ip" : "0.0.0.0", "difficulty" : { In debug.log I have Quote trying connection ip_PC1:xxxxx lastseen=0.9hrs connection timeout trying connection ip_PC1:xxxxx lastseen=0.9hrs connection timeout trying connection ip_PC1:xxxxx lastseen=0.9hrs connection timeout I don't know if i need to configure port forward in VM or my internet box. There is something I can check that will help me spot where the pb is coming from ? thnks Title: Re: More Genesis Block Discussion Post by: haggis on June 21, 2014, 09:37:06 PM Can they ping each other? Ports blocked?
Title: Re: More Genesis Block Discussion Post by: Restincoin on June 21, 2014, 09:43:37 PM Can they ping each other? Ports blocked? Yes I can ping each other public ip btw in getinfo ip 0.0.0.0 is normal ? thnks Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 04:32:01 PM Someone ??
Title: Re: More Genesis Block Discussion Post by: YarkoL on June 24, 2014, 06:03:38 PM The all-zero ip just tells that you're not being
seen by your peer. Could be variety of reasons for that, and you aren't very clear about your configuration (two pc's with vm's - are the nodes in vm's?) In any case you don't need to add both nodes to the conf files, just the other one. And your debug.log indicates that your nodes have seen each other 0.9 hours ago, so something has caused them to drop the connection. Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 07:56:07 PM The all-zero ip just tells that you're not being seen by your peer. Could be variety of reasons for that, and you aren't very clear about your configuration (two pc's with vm's - are the nodes in vm's?) In any case you don't need to add both nodes to the conf files, just the other one. And your debug.log indicates that your nodes have seen each other 0.9 hours ago, so something has caused them to drop the connection. Thanks for your answer. My configuration is 2 PC with different public IP PC1 and PC2 are using ubuntu on VM I try to connect those 2 VMs. In config file, those 2 IP in addnode are public IP from PC1 and PC2 The 0.9 hours I think is a default value because in log there is never connection Title: Re: More Genesis Block Discussion Post by: coinsolidation on June 24, 2014, 08:06:32 PM start pc1 daemon, tail -f the debug.log
start pc2 daemon, see if any entry occurs in debug.log above Title: Re: More Genesis Block Discussion Post by: YarkoL on June 24, 2014, 08:22:29 PM . My configuration is 2 PC with different public IP PC1 and PC2 are using ubuntu on VM I try to connect those 2 VMs. In config file, those 2 IP in addnode are public IP from PC1 and PC2 What I always do is to connect pc daemon with VM daemon. Those will have different addresses, so I think the public ip's do not reach down to vm's. Try ifconfig on either of the ubuntus and see what ip you get. Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 08:27:47 PM This is what i get on ubuntu VM wiht ifconfig
Quote pk@pk-VirtualBox:~$ ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:3d:b5:a4 inet addr:192.168.1.56 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe3d:b5a4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:25144 errors:0 dropped:1 overruns:0 frame:0 TX packets:19341 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:29876661 (29.8 MB) TX bytes:3014061 (3.0 MB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:4863 errors:0 dropped:0 overruns:0 frame:0 TX packets:4863 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:543609 (543.6 KB) TX bytes:543609 (543.6 KB) You think I need to forward data ? What I don't understand is that, when I open a daemon of a random coin on either of the VMs they can connect easily to the network of the random coin and start synchronisation. Title: Re: More Genesis Block Discussion Post by: YarkoL on June 24, 2014, 08:31:19 PM Try connecting to 192.168.1.56 either from your pc or the other vm. Just get the other ip from ifconfig or ipconfig (windows) also. Typically they are of the form 192.168.1.x Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 08:44:34 PM Try connecting to 192.168.1.56 either from your pc or the other vm. Just get the other ip from ifconfig or ipconfig (windows) also. Typically they are of the form 192.168.1.x I can ping between host (PC1) local ip (192.168.1.84) and vm (VM1) local ip (192.168.1.54) that is running on host. This is Ok for both PC1/VM1 and PC2/VM2 But of course I can't cross ping local IPs between those 2 pcs because they are on different LAN. :-\ Title: Re: More Genesis Block Discussion Post by: coinsolidation on June 24, 2014, 08:54:15 PM Perhaps an obvious question, but you can ping google.com from both virtual machines yes?
Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 09:00:59 PM Perhaps an obvious question, but you can ping google.com from both virtual machines yes? Yes of course I can browse internet and ping google on VM. I also used a daemon of a working coin and synchronisation working well on VM Title: Re: More Genesis Block Discussion Post by: Restincoin on June 24, 2014, 09:09:39 PM I can get connection in daemon if I try to use local IPs of 2 pc ?
Title: Re: More Genesis Block Discussion Post by: Restincoin on June 25, 2014, 05:27:25 PM my daemon work now, i needed to forward ports in my router and check vm is in bridge mode
thank you guys for help in debugging Title: Re: More Genesis Block Discussion Post by: DonQuijote on July 20, 2014, 12:08:58 AM Thanks for sharing with us.
Its very useful information Title: Re: More Genesis Block Discussion Post by: DELTA9 on August 22, 2014, 09:25:58 AM Working on a new coin (I know, too many already). I have had success mining a genesis block for a scrypt coin, but running into trouble now with X11. Is the process very different? I have changed the merklehash and now my wallet daemon runs without any errors on my local machine, but I am getting an assertion error after compiling on my VPS. Assertion 'hash == hashGenesisBlock' failed. I have been trying to get this working for days but can't seem to figure out what I am doing wrong.
Title: Re: More Genesis Block Discussion Post by: YarkoL on August 23, 2014, 12:02:11 AM Working on a new coin (I know, too many already). I have had success mining a genesis block for a scrypt coin, but running into trouble now with X11. Is the process very different? I have changed the merklehash and now my wallet daemon runs without any errors on my local machine, but I am getting an assertion error after compiling on my VPS. Assertion 'hash == hashGenesisBlock' failed. I have been trying to get this working for days but can't seem to figure out what I am doing wrong. If the code compiles on one machine, it should work on another. Check and compare that you have the same merkleroot, nonce, timestamp, hashGenesisBlock and of course the same algo Title: Re: More Genesis Block Discussion Post by: cisahasa on June 23, 2015, 12:14:26 PM im trying to create peercoin genesis block and got it done quite easily
im using the 0.8.6 based source but sometimes cant find it beacuse nonce reseting back to zero, why this is happening? where is the part of source doing this: 2015-06-22 08:06:15 n=4095M hash=fbf2af49cbd6dfdb2bc61e5ac2a0f2f7847b14d122345b1d7afccfab9ef2d7a5 2015-06-22 08:06:17 n=0M hash=be71678a2a5a4c073f71e87f22816de6e567135cc23c3079118f089dd6c622c5 after 4095M nonces drop back to 0 where is the part of the sourcecode doing this? i tried to find answer related to value 0xffff, but did not get it yet why this is happening Title: Re: More Genesis Block Discussion Post by: l8nit3 on July 30, 2015, 03:08:38 AM Hello all, I'm attempting to compile a cloned version of fastcoin (NOT FOR REALEASE, JUST LEARNING). Ive managed to get as far as obtaining my merkle hash. However, now that im at the part of generating a genesis block by changing if (false && block.GetHash() != hashGenesisBlock) to if (true && block.GetHash() != hashGenesisBlock) Ive run into a roadblock. It seems the dev team who created fastcoin has heavily modified their source, and i am missing that particular line of code in main.cpp lol. Any chance someone knows what they may have changed it too? (or is willing to take a look?) Or is it more likely that it was just removed as a method of stopping people from cloning their source to a new chain?
Title: Re: More Genesis Block Discussion Post by: YarkoL on July 30, 2015, 06:28:54 AM Hello all, I'm attempting to compile a cloned version of fastcoin (NOT FOR REALEASE, JUST LEARNING). Ive managed to get as far as obtaining my merkle hash. However, now that im at the part of generating a genesis block by changing if (false && block.GetHash() != hashGenesisBlock) to if (true && block.GetHash() != hashGenesisBlock) Ive run into a roadblock. It seems the dev team who created fastcoin has heavily modified their source, and i am missing that particular line of code in main.cpp lol. Any chance someone knows what they may have changed it too? (or is willing to take a look?) Or is it more likely that it was just removed as a method of stopping people from cloning their source to a new chain? Take a look at some other coins source to familiarize yourself what the genesis block producing code looks like. It is indeed in the fastcoin source, but the condition under which it runs is different. Title: Re: More Genesis Block Discussion Post by: tearodactyl on May 04, 2017, 06:37:59 PM Updated 2017 Genesis Block information http://practicecoin.com/index.php/2017/04/19/genesis-block/
Title: Re: More Genesis Block Discussion Post by: freemanjackal on June 16, 2017, 05:01:19 PM i was able to compile and make some modifications, but when i execute litecoind, it obviously give me the error genesisblock does not match, everything fine until there,
what i am not being able to find the debug.log file, it supposes it is created a .litecoin folder where the log file should it be, but the .litecoin folder in home it is not being created... so i would like some enlightment in this part, anyone could help me? thanks Title: Re: More Genesis Block Discussion Post by: vlom on July 27, 2017, 03:23:31 PM What I did so far: Change pszTimestamp to a sentence from newspaper change block.nTime to current time compile run compiled source with -testnet -noirc now u see some lines and a crash Code: b115383690ee67ebeef9a7e754342638cd7bbf488561998e6d1bc1ed367484f6 // Block derived from pszTimestamp corresponding to code: Code: //// debug print update main.cpp with the mentioned merkleroot (it crashed because of the last assert) and run again you should have already changed the false to true in Code: // If genesis block hash does not match, then generate new genesis hash. so it will find a genesis block for your string after a long time you get: Code: nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000) Now you have the valid Genesisblock and nNonce: block.nNonce = 3939341 block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33 Update your code with these values and your ready to go! i have to reactivate this topic. i am playing with coin-cloning an now i am stuck at the MerkleRoot-part. The app crashes and in terminal i got this: Code: Assertion failed: (block.hashMerkleRoot == uint256("0x")), function LoadBlockIndex, file main.cpp, line 2031. and according to this how-to (https://gist.github.com/mhsjlw/8130158de01071aa8c87) i should find the hash in a log file. but in the only corresponding log file i found i only have this. Quote c6e32eac75316aa6be562726b219fac84560439fea1c819550fb95abbeb23582 5813d4cfab0eeda94a15d11c5e7d6895e667fbbe67c59ef9a1b3bc232c9a0b7f c12f442c067f5c64e58e294d423c36b42201801a55ed551fa0d4da57b1810651 the how-to says i should have something like this: Quote Thanks to tyrion's amazingly helpful post, we can decipher this debug out put as so: b1753ec3845a48ddc4618bc595af6dc89dac328cd48f9f8db178df5dd3b302fc Block hashed using the non-existent Merkel, based on the pzTimestamp from main.cpp 0000000000000000000000000000000000000000000000000000000000000000 Genesis block, no good because all the nNonces are set to 0 in main.cpp 2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700 Valid Merkel Hash, generated using the epoch time in main.cpp or is one off the three lines above the hash i need? thank you. EDIT: i got it, reformatting the text from the how-to solves the problem.... the third line is the hash i need. Title: Re: More Genesis Block Discussion Post by: maiiyeuchong on November 06, 2017, 01:03:59 AM I need to help. I have created a coin for myself, but when sent, can not receive. Why wallet contacted the system it has multiple ports connected to it
http://fs5.directupload.net/images/171105/uncttku6.png http://fs5.directupload.net/images/171105/i8qqsing.png http://fs1.directupload.net/images/171105/el82all8.png Title: Re: More Genesis Block Discussion Post by: Bobby_Atlas on December 27, 2017, 06:32:13 PM Is there any options or script or maybe somebody know how to midify Genesis H0 to get Genesis block for blake256 algo?
Title: Re: More Genesis Block Discussion Post by: Bobby_Atlas on December 28, 2017, 02:21:25 AM Guys really need your help, i've downloaded linked above script, added blake-256 hashing algo there, but how to tell that script to use extranonce and nversion as options while it generates merkle and hash?
Will be really appriciated for help and give bounty on coin start! Title: Re: More Genesis Block Discussion Post by: Tokenista on August 25, 2018, 07:35:55 AM Ethereum Smart Contract pre-compiled
https://github.com/satansdeer/ethereum-token-tutorial Title: Re: More Genesis Block Discussion Post by: realdantreccia on March 03, 2022, 09:58:08 PM lightenup gave me this advice for generating a genesis block: Awww, that is cheating! You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help. Shots fired @BillyMarkus!!! That's part of the devtome guide. BOOO GAVIN BOOO! https://www.devtome.com/doku.php?id=scrypt_altcoin_cloning_guide&rev=1391981820#genesis_blocks |