Pages:
Author

Topic: More Genesis Block Discussion - page 4. (Read 33875 times)

sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
April 07, 2014, 11:13:45 AM
#47
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
    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.
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
April 06, 2014, 07:24:45 PM
#46
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.
legendary
Activity: 996
Merit: 1013
April 06, 2014, 04:39:08 PM
#45
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?
member
Activity: 116
Merit: 10
April 06, 2014, 04:30:35 PM
#44
Here is a python script for generating the parameters needed for sha256/scrypt genesis block

https://github.com/lhartikk/GenesisH0
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
April 06, 2014, 02:50:29 PM
#43
Using following code in main.cpp if using n-Scrypt (X11), it gives error when compiling. Any suggestion?

Code:
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());


               }



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);
                                                                                                     ^

full member
Activity: 140
Merit: 100
March 19, 2014, 10:06:05 AM
#42
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.

Did anyone reinvent the WHEEL lately? 
sr. member
Activity: 308
Merit: 250
March 05, 2014, 01:44:19 PM
#41
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 Smiley need 2 PCs

didnt work for me   Undecided but have fun  Smiley
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
March 05, 2014, 11:13:53 AM
#40
What is public ECDSA key ?

https://bitcointalksearch.org/topic/m.5447917

Thanks
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
March 05, 2014, 11:11:16 AM
#39
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 Smiley need 2 PCs
sr. member
Activity: 308
Merit: 250
March 03, 2014, 12:52:45 PM
#38
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.
Are you sure you have set the ports right?

yeah i cloned doge. which has port 22555 by default
hero member
Activity: 616
Merit: 500
March 03, 2014, 07:09:10 AM
#37
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.
Are you sure you have set the ports right?
sr. member
Activity: 308
Merit: 250
March 03, 2014, 05:41:53 AM
#36
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.
legendary
Activity: 2184
Merit: 1011
Franko is Freedom
March 02, 2014, 06:57:56 PM
#35
someone cast res on this thread.
hero member
Activity: 616
Merit: 500
March 02, 2014, 06:08:52 PM
#34
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.
sr. member
Activity: 308
Merit: 250
March 02, 2014, 05:08:06 AM
#33
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.
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
March 01, 2014, 01:53:02 PM
#32
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.
hero member
Activity: 616
Merit: 500
March 01, 2014, 02:20:31 AM
#31
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)
sr. member
Activity: 473
Merit: 250
"Proof-of-Asset Protocol"
February 25, 2014, 06:49:40 PM
#30
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
b8fa883689f099d3942ff73439d9f55d60a5e257b0d69a8f0f6ab4572ecff415 // Genesisblock (invalid cuz its already coded wrong)
bd58bf217abb76059de07dc519f6c3dcdf5b1a7bb9219a66d24205e08f3716f9 // MerkleRoot (Valid because its newly calculated

corresponding to code:
Code:
        //// debug print
        printf("%s\n", block.GetHash().ToString().c_str());
        printf("%s\n", hashGenesisBlock.ToString().c_str());
        printf("%s\n", block.hashMerkleRoot.ToString().c_str());
        assert(block.hashMerkleRoot == uint256("0xbd58bf217abb76059de07dc519f6c3dcdf5b1a7bb9219a66d24205e08f3716f9"));

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.
        if (true && block.GetHash() != hashGenesisBlock)

so it will find a genesis block for your string

after a long time you get:
Code:
nonce 003C1000: hash = e8525d8ae8a74a33dbc4b06a64c97ced84dfd29628b3e9e4197c7030cc4a09d3 (target = 00000ffff0000000000000000000000000000000000000000000000000000000)
block.nTime = 1367704866
block.nNonce = 3939341
block.GetHash = fafdbfc957ea6867a0743ff80c4ae126c7dd9fa82057255228a4d58f6ccfdf33
CBlock(hash=fafdbfc957ea6867a074, PoW=000000b1398554a520b5, ver=1, hashPrevBlock=00000000000000000000, hashMerkleRoot=bd58bf217a, nTime=1367704866, nBits=1e0ffff0, nNonce=3939341, vtx=1)
  CTransaction(hash=bd58bf217a, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d01043741442e6e6c20342f352042657672696a64696e6773646167207a6f6e6e69672c20646161726e61206f6f6b207a6f6d657273207761726d)
    CTxOut(error)
  vMerkleTree: bd58bf217a
xx: main.cpp:2070: bool LoadBlockIndex(bool): Assertion `block.GetHash() == hashGenesisBlock' failed.
Aborted (core dumped)

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?
sr. member
Activity: 308
Merit: 250
February 24, 2014, 03:07:22 AM
#29
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?
hero member
Activity: 616
Merit: 500
August 12, 2013, 07:21:07 PM
#28
The key used in the source at
Code:
[s]txNew.vout[0].scriptPubKey [/s]
Is the public ECDSA key for that address right?
I generated an ecdsa key pair, placed the public key in there like litecoin:
Quote
txNew.vout[0].scriptPubKey = CScript() << ParseHex("04f93d54b7873cad866b9d9670717ce5c2d11715e27e35ae55d0b4ee2eb106c9e49d5e8e874b536 04f9c8ae6620b65f685ef9ca90af4686b7f5e0257ae26fd4ce0") << OP_CHECKSIG;
Private key from the pair I changed to WIF and imported to satoshi client with importprivkey call. No coins are showing up. This is the genesis block from debug.log:
Quote
block.nTime = 877077343
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
What am I missing? Undecided

EDIT: Nevermind! I just had to mine another block and it showed up.
Pages:
Jump to: