Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: CrimsonGT on December 29, 2013, 09:53:28 AM



Title: Creating a Genesis Block (Linux)
Post by: CrimsonGT on December 29, 2013, 09:53:28 AM
I have been messing around with the source code for Litecoin and trying to build it as an alternative coin. I am looking to possibly create a fake alt-coin for a project in my programming class, but need to actually have a pretty solid understanding of how it works. I have been following the guide at http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guide which has been pretty smooth thus far, however I am running into a problem now when generating the genesis block.

I get to the point where I run it with "-testnet" and it fails as expected, but it is supposed to generate a file that contains the Merkel Hash. I am not too familiar with Linux for programming, but everything states that this should generate a ".testcoin" file in the Home directory, but nothing is being created there.

crimsongt@wheezy:~/testcoin/src$ ./testcoind -testnet
testcoind: main.cpp:2113: bool LoadBlockIndex(bool): Assertion `block.hashMerkleRoot == uint256("0x97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9")' failed.
Aborted

Is there any way to figure out whats going wrong and why this file is not being generated?


Title: Re: Creating a Genesis Block (Linux)
Post by: simbo on December 29, 2013, 10:25:59 AM
The debug logfile is <homedirectory>/.testcoin/debug.log

Hope it helps. Use a OS you are good at.


Title: Re: Creating a Genesis Block (Linux)
Post by: CrimsonGT on December 29, 2013, 10:59:00 AM
Thank you for the information, however my issue is that ".testcoin" is not being created during make, why I am rather confused.

I am proficient with Windows, but the build process seems so incredibly difficult in comparison to Nix/OSX that I opted to just try building from a Debian VM instead.


Title: Re: Creating a Genesis Block (Linux)
Post by: simbo on December 29, 2013, 11:07:42 AM
.testcoin is a directory, not log file. The text log file you are looking for is debug.log.

Btw, windows is not that bad. I develop my coin on a win 7 system & yes, I tried the devtome guide before.


Title: Re: Creating a Genesis Block (Linux)
Post by: KriszDev on December 29, 2013, 11:22:40 AM
What you doing is creating a merkel hash for testnet ,but your can run whitout testnet (generate merkel for the real net). And if you not find the .CONNAME folder create a folder named "data" where is your COINNNAMERUNNABLE then launch COINNAMERUNNABLE with "-datadir=data" then open the data folder and you will se the debug.log but you have to wait 'till it complete the generation.


Title: Re: Creating a Genesis Block (Linux)
Post by: Sharrow on December 30, 2013, 01:01:30 PM
I'm having the same problem on a Linux box and it's extremely frustrating! The debug.log file can be found but there's no mention of a merkel hash or nonce in it.

Apologies if this seems too basic but if you're a Linux noob (like me), it may be useful.

To make a folder for the log files to go to, you need to go to your $HOME folder and you need to run
Code:
mkdir ~/.testcoin

Then to run the -testnet, run this code:
Code:
testcoind -noirc -testnet -datadir=/$HOME/.testcoin/

Go into you home folder and type in ls -a to see folders that aren't visible with the ls command. Inside the $HOME/.testcoin/ folder there should be a testnet folder with a list of files that can be viewed with the ls command. The debug.log should be one of them and it can be opened with  pico debug.log   . Hopefully yours will have more info than mine.

All that mine contains is:

TestCoin version v1.0.0.0-ga9113b5-tst (2013-12-30 11:33:50 +0000)
Startup time: 12/30/13 13:02:48
Default data directory /root/.testcoin
Used data directory //root/.testcoin/proto/testnet3
Bound to [::]:45883
Bound to 0.0.0.0:45883
Loading block index...
dbenv.open LogDir=//root/.testcoin/proto/testnet3/database ErrorFile=//root/.testcoin/proto/testnet3/db.log
223ac289612d6cdd0aae9a96c012e82ee0360d9afb7b4bae18a09552208219a1
0000000000000000000000000000000000000000000000000000000000000000
c4dc961b5224ce2a49a927a56f5723b9cd00f23b366a2aad90dae7720a4df44d



Title: Re: Creating a Genesis Block (Linux)
Post by: Sharrow on December 30, 2013, 07:15:51 PM
In answer to my previous post, the merkel hash was the last line of the log file. The testnet genesis block is working a treat now.