Creating a genesis block

I successfully cloned Peershares protocal. But while i was clong peercoin I am unable to create genesis block , many times I also added the code

while (block.GetHash() > bnTarget.getuint256())
{
if (fRequestShutdown)
return false;
if (block.nNonce % 1048576 == 0)
printf(“n=%dM hash=%s\n”, block.nNonce / 1048576,
block.GetHash().ToString().c_str());
block.nNonce++;
}

I did not found genesis block. I unable to clone peercoin, I don’t know where I am going wrong. If anyone have an step by step guide for cloning Peercoin.

Have you read this?

Yes I have cloned peershares but was not able to clone peercoin. If there is any guide which helps me to clone peercoin woud be great.

Perhaps if you explained why you want to clone Peercoin and why it would be great, you might get some more help.

Are you planning on creating another alt coin to release it?

Many developers have tried, and proof-of-stake coins without checkpointing in the early stages always become pump and dumps and die.

Peercoin is not a pump and dump alt coin and never was…

1 Like

@ppcman I am not trying to clone it to make a new altcoin. I am cloning it just for my personal use and to understand the cloning process.

Currently the pow blocks stop at 400 and I can’t figure out where the money supply is going! there is a supply of 10 mil but i have only 0.3mil in my wallet.

  • why are the blocks stopping at 400?
  • where is the coin going if I have the only 2 nodes running the system?
  • how do i write the genesis block in case I want to premine some coins?

So it seems you are running a Peershares chain (just to avoid confusion)

That’s called the pre-mine. All peershare tokens are mined in the first 400 blocks.

They should be going to the wallets of the nodes that have been mining.

The pre-mine ends after 400 blocks.

Yes. But once pre-mine is completed then it stop’s generating new blocks. My proof-of stake blockchain does not starts after 400th block. Are there any steps to start proof of stake blockchain.

Nope, it should start automatically as long as you didn’t lock your wallet.
If that doesn’t help, just debug it.

thanks hrobeers for all comments really helpfull, thanks a lot.

I have few more questions and I hope you could help me understand.

here is my wallet info after the 400 blocks mined.
{
“version” : “v0.1.0.0-unk-beta”,
“protocolversion” : 60003,
“walletversion” : 60000,
“balance” : 802500.00000000,
“newmint” : 197500.00000000,
“stake” : 0.00000000,
“blocks” : 400,
“moneysupply” : 1000000.00000000,
“connections” : 1,
“proxy” : “”,
“ip” : “0.0.0.0”,
“difficulty” : 0.00260906,
“testnet” : true,
“keypoololdest” : 1523224799,
“keypoolsize” : 101,
“paytxfee” : 0.00000000,
“errors” : “”
}

“balance” : 802500.00000000,

what newmint means ?
"newmint" : 197500.00000000,

why stake it is 0? my wallet it is open and not unlock
"stake" : 0.00000000,

why money supply it is 1 million? I set it for 2 billion in main.h
static const int64 MAX_MONEY = 2000000000 * COIN;

"moneysupply" : 1000000.00000000,

I could see the blocks mined was of value of 2500, where I can set it? in bitcoin i used to do in:

main.cpp
txNew.vout[0].nValue = 200 * COIN;
int64 nSubsidy = 200 * COIN; //coin per block mined

last question: i sent some coins to another wallet in my VM and the transaction it is not confirmed, I know to this be confirmed needs to be mined new blocks right? or with POS? both wallets are on and the transcation it is not valid.

thanks for the help and your time.