How to create a Genesis Block for a new Blockchain with Node.js

To start creating a new coin with the Proof of Work consensus algorithm. You need to create a Genesis Block. This’s Lib support create Genesis Block for Bitcoin, Litcoin, Dash, X11, X13, X15, X17, Geek, Quark, Keccak, Qubit, NeoScrypt, Scrypt…

Options:

-t TIME, --time=TIME  the (unix) time when the genesisblock is created
-z TIMESTAMP, --timestamp=TIMESTAMP the pszTimestamp found in the coinbase of the genesisblock
-n NONCE, --nonce=NONCE the first value of the nonce that will be incremented when searching the genesis hash
-a ALGORITHM, --algorithm=ALGORITHM the PoW algorithm: [x11|neoscrypt|quark|qubit|keccak|lyra2re]
-p PUBKEY, --pubkey=PUBKEY the pubkey found in the output script
-v VALUE, --value=VALUE the value in coins for the output, full value (exp. in bitcoin 5000000000 - To get other coins value: Block Value * 100000000)
-b BITS, --bits=BITS the target in compact representation, associated to a difficulty of 1
git clone https://github.com/nasa8x/node-genesis-block.git genesis-block
cd genesis-block
npm install
node genesis -a x11 -z "Don't work for weekends, work for our goals - 18/Jan/2018." -p "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"
algorithm: x11
pzTimestamp: Don't work for weekends, work for our goals - 18/Jan/2018.
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 504365040
time: 1521537891
merkle root hash: 77fc7d6cfbc4ec91703444a515955092d4b7c04dbb8f23be59deb42a39ec0057
Searching for genesis hash...
nonce: 1827816
genesis hash: 0000084e98003628c45719136940cf7068805f4024419a51d6259fb676c299da

After creating the Genesis Block, change chainparams.cpp.

algorithms
x11
x13
x15
x16r
nist5
neoscrypt
scrypt
keccak
quark
bcrypt
skein
groestl
groestlmyriad
blake
fugue
qubit
hefty1
shavite3
cryptonight
boolberry
yescrypt
fresh

Source code: https://github.com/nasa8x/node-genesis-block

#bitcoin #nodejs

How to create a Genesis Block for a new Blockchain with Node.js
40 Likes87.65 GEEK