Author

Topic: Need help creating Genesis Block (linux, Debian) (Read 1535 times)

newbie
Activity: 14
Merit: 0
Jesus fck, I'm only 14. I never even said I was going to release this coin, take it easy. Seriously though, you have to start somewhere, right?

starting with something as "big" as bitcoin in terms of understandings it requires may be a bit overwhelming, anyway, here are a few things:

i just had a look at your 'create an altcoin howto' page, i don't really like the way they 'explain' how to create the genesis block.

Personally, i generate mine using the following procedure :

this is, supposing you already understood and set the network parameters.

1. choose the proofofworklimit i want for my network (>> 24 for tests for example) chainparams.cpp : bnProofOfWorkLimit per network

2. set those accordiningly:
genesis.nTime = something close to current time, just for information purpose
genesis.nBits = accordiningly to your bnProofOfWorkLimit
genesis.nNonce = 0; // start with zero onfirst run (or whatever)

eventually properly set the coinbase output (you'll have to know how to generate public keys)

3. right before assertion on hash & merkle, add something like this:
Code:
uint256 hashTarget = uint256().SetCompact(genesis.nBits);
while (genesis.GetHash() > hashTarget) {
    ++genesis.nNonce;
    if (genesis.nNonce == 0) { ++genesis.nTime; }
}

// log your full genesis block (ntime, nonce, hash & tx merkle root)

hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256(.....
assert(genes.....

4. build and run for the first time. this will take some time, according to your proofofwork limit & nbits (you're actually 'mining' the genesis block right now), then have a look at the logs _you_ generated ; copy genesis block data (ntime, nNonce, merkle & hash) to your sourcecode.

5. disable code added in step 3, rebuild, voila ....

This way, you really have valid data starting with your genesis block. Many altcoins have genesis blocks that already violates their own rules ...

Note that you'll have to log your genesis block data by yourself, as no logging is initialized at that point.




Last thing (yeah, i know this gets boring, but it's the only way you'll end up _really_ learning anything) : try things, LOG things, do not ask for copy/paste answers as soon as a problem comes in, logging is the key, when facing serious problems that you couldn't solve by intense logging/debugging i bet you'll get quite some serious answers to .. your serious questions Smiley


you just saved my life, thanks man
member
Activity: 112
Merit: 10
Jesus fck, I'm only 14. I never even said I was going to release this coin, take it easy. Seriously though, you have to start somewhere, right?

starting with something as "big" as bitcoin in terms of understandings it requires may be a bit overwhelming, anyway, here are a few things:

i just had a look at your 'create an altcoin howto' page, i don't really like the way they 'explain' how to create the genesis block.

Personally, i generate mine using the following procedure :

this is, supposing you already understood and set the network parameters.

1. choose the proofofworklimit i want for my network (>> 24 for tests for example) chainparams.cpp : bnProofOfWorkLimit per network

2. set those accordiningly:
genesis.nTime = something close to current time, just for information purpose
genesis.nBits = accordiningly to your bnProofOfWorkLimit
genesis.nNonce = 0; // start with zero onfirst run (or whatever)

eventually properly set the coinbase output (you'll have to know how to generate public keys)

3. right before assertion on hash & merkle, add something like this:
Code:
uint256 hashTarget = uint256().SetCompact(genesis.nBits);
while (genesis.GetHash() > hashTarget) {
    ++genesis.nNonce;
    if (genesis.nNonce == 0) { ++genesis.nTime; }
}

// log your full genesis block (ntime, nonce, hash & tx merkle root)

hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256(.....
assert(genes.....

4. build and run for the first time. this will take some time, according to your proofofwork limit & nbits (you're actually 'mining' the genesis block right now), then have a look at the logs _you_ generated ; copy genesis block data (ntime, nNonce, merkle & hash) to your sourcecode.

5. disable code added in step 3, rebuild, voila ....

This way, you really have valid data starting with your genesis block. Many altcoins have genesis blocks that already violates their own rules ...

Note that you'll have to log your genesis block data by yourself, as no logging is initialized at that point.




Last thing (yeah, i know this gets boring, but it's the only way you'll end up _really_ learning anything) : try things, LOG things, do not ask for copy/paste answers as soon as a problem comes in, logging is the key, when facing serious problems that you couldn't solve by intense logging/debugging i bet you'll get quite some serious answers to .. your serious questions Smiley
full member
Activity: 141
Merit: 100
I guess people are afraid you could steal their business. Releasing a 1-5% pos coin every 4 hours Cheesy. I'm sorry I cant help you there kyle but good luck figuring out cryptos.
legendary
Activity: 1540
Merit: 1001
Crypto since 2014
Jesus fck, I'm only 14. I never even said I was going to release this coin, take it easy. Seriously though, you have to start somewhere, right?
member
Activity: 112
Merit: 10
kyle, this is really embarassing. if u cant figure this out u should really really not be making another mindless blackcoin clone. plz man think about it.

ouch.

i second this ... every day you get that kind of request ...

if you just can't figure out how to generate the fcking genesis block ... for god's sake .. wipe out your repository right now !
hero member
Activity: 700
Merit: 520
kyle, this is really embarassing. if u cant figure this out u should really really not be making another mindless blackcoin clone. plz man think about it.

ouch.
legendary
Activity: 1540
Merit: 1001
Crypto since 2014
I need help creating a Genesis block for a BlackCoin fork called VirtueCoin. I'm following this tutorial: http://dogecoin.ga/how_to_create_scrypt_based_altcoins.html
I am trying to get the Merkel hash that is supposed to come up in the testnet debug.log file after you launch the application for the first time but it isn't appearing. Here is what is in the debug.log:

Code:
VirtueCoin version v1.0.7.0-g32a928e (2014-06-14 12:28:10 +1000)
Using OpenSSL version OpenSSL 1.0.1e 11 Feb 2013
Startup time: 06/14/14 07:27:13
Default data directory /home/kyle/.virtuecoin
Used data directory /home/kyle/.virtuecoin/testnet
dbenv.open LogDir=/home/kyle/.virtuecoin/testnet/database ErrorFile=/home/kyle/.virtuecoin/testnet/db.log
Bound to [::]:45883
Bound to 0.0.0.0:45883
Loading block index...
Opening LevelDB in /home/kyle/.virtuecoin/testnet/txleveldb
Opened LevelDB successfully
can someone help me figure this out please?

Its supposed to look something like this:
Code:
b1753ec3845a48ddc4618bc595af6dc89dac328cd48f9f8db178df5dd3b302fc
0000000000000000000000000000000000000000000000000000000000000000
2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700

Maybe I need to change the false to true (what this guy says):
https://bitcointalksearch.org/topic/m.2035449
Is this what I do?

I'm a Linux noob (installed it this morning)
Jump to: