How to create altcoin - Mining genesis block guide for POW POS or Masternode

in #altcoin6 years ago (edited)

Hello guys! In this video I will show you how to create genesis block for PoS coin

This guide only show you how to mine a genesis block and few other changes, so this is not a complete guide.

we'll use blackcoin for this guide
Since Blackcoin is PoS
Download and extract Blackcoin source from https://github.com/CoinBlack/blackcoin
I will extract Blackcoin on mnt folder and rename it to supercoin

We'll start with rename the coin

cd mnt/supercoin

Replace Blackcoin to supercoin

Rename BLC to SPC

Then we change port

Replace The RPCport too

Create a new folder for pubkey
For me, I create Pubkey folder on mnt so i was easier for me to find them

Mainnet pubkey

Testnet pubkey

Now we get the pub key for mainnet
cat genesiscoinbase.hex
pubkey:

and for the testnet
cat testnetalert.hex
pubkey:

Now we change pchMessageStart from line 51 until line 54
testnet pchMessageStart from line 124 until 127
CRegTestParams pchMessageStart from line 164 until line 167

Change the start address letter form B to S
https://en.bitcoin.it/wiki/List_of_address_prefixes

change the testnet Starting letter from d to s

Now we change last POW from 10000 to 5000
chainparams.ccp
Line 98

Change the min confirmation from 500 to 50
Main.ccp
Line 45

Change stake minimun age from 8 hour to 3 hour
Line 46

Before mine a genesis block we need to change this few line

mainnet vAlertPubKey
Testnet vAlertPubKey
Change the psztimestamp
change the unixtimestamp: line 75 and 80 for mainnet
change genesis.nNonce to 0: line 82
assert hashGenesisBlock to 0x01

put the mining genesis code
recompile

Alright! compile is done we move to the next step

Now we can mine the genesis block!
Run supercoind wait for it until you get error like this one

This will take a while.. we'll skip the video.

supercoind: chainparams.cpp:115: CMainParams::CMainParams(): Assertion `hashGenesisBlock == uint256("0x01")' failed.
Aborted (core dumped)

Now we got the genesis!

copy the log on your terminal and paste it on chainparams.ccp
genesis.nNonce
genesis.GetHash
genesis.hashMerkleRoot

do the same for testnet and regtest

Congratulations!! Now you have the genesis block!

You need to add seednode on chaiparams.ccp for connection. I will show you how to do that in the next video!

In the next video I will show you how to create genesis for Masternode coin changing the block reward, seednode, checkpoint and premine.
Don't forget to subscribe
Thanks!

If you think this video helpful you wanna buy me a cup of coffee or beer
Donate here:
BTC: 34FcLcxb26HKSLgJ7EimFbdp11jPnPbSTR
ETH: 0x748672E8b61532876377589cd3C472ED159d1d89
Thanks!

Sort:  

Hello @theflank! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @theflank! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 61812.63
ETH 2432.97
USDT 1.00
SBD 2.63