Code Monkey home page Code Monkey logo

node-genesis-block's Introduction

Create Genesis Block Proof of Work with Node.js

Tested with Node.js version 12.x.x

setup

git clone https://github.com/nasa8x/node-genesis-block.git genesis-block
cd genesis-block
npm install

help

    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

algorithms


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

x11

node genesis -a x11 -z "Don't work for weekends, work for our goals - 18/Jan/2018." -p "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"
---------------
// result:
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

quark

node genesis -a quark
---------------
// result:
algorithm: quark
pzTimestamp: Don't work for weekends, work for our goals.
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 504365040
time: 1521539113
merkle root hash: f5239467dd2a9dd0fce7a3babc03c7985eab2229c62e3d5670375f305753c9cc
Searching for genesis hash...
nonce: 516895
genesis hash: 00000a560e5488e24c7b2d83a7fd1d707321d57d0b8aa8164f35c5e67ed3a0f0

keccak

nasa8x$ node genesis -a keccak -t 1521538330
---------------
algorithm: keccak
pzTimestamp: Don't work for weekends, work for our goals.
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 504365040
time: 1521538330
merkle root hash: f5239467dd2a9dd0fce7a3babc03c7985eab2229c62e3d5670375f305753c9cc
Searching for genesis hash...
nonce: 1509118
genesis hash: 0000040fceaa8f6eda22f0caecc8c59a6ed82012e640d1c77348e3bf6c8d706f

donate

node-genesis-block's People

Contributors

nasa8x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-genesis-block's Issues

Failed to add genesis block to blockchain

node genesis -a cryptonight -t "Born.............!"
It print waiting and:

2019-01-15 20:49:03.589 7f02d8923780 ERROR cn src/cryptonote_basic/cryptonote_format_utils.cpp:184 Failed to parse transaction from blob
2019-01-15 20:49:03.589 7f02d8923780 ERROR default src/cryptonote_core/cryptonote_tx_utils.cpp:659 failed to parse coinbase tx from hard coded blob
2019-01-15 20:49:03.590 7f02d8923780 ERROR blockchain src/cryptonote_core/blockchain.cpp:430 Failed to add genesis block to blockchain

 
Thanks!

i have got this error when run genesis

root@vmi167433:~/genesis-block-node# node genesis -a quark
/root/genesis-block-node/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-block-node/genesis.js:61:64)
at createTx (/root/genesis-block-node/genesis.js:72:17)
at Object.handler (/root/genesis-block-node/genesis.js:40:37)
at Object.runCommand (/root/genesis-block-node/node_modules/yargs/lib/comman d.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-block-node/node_modules/y args/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEac h.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.f orEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.sel f.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv ] (/root/genesis-block-node/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-block-node/genesis.js:55:5)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

Please help me and hope reply to me. what is the reason of this error?

x16r Incorrect Outputs

Hello,

I'm trying to recreate the Raven Coin and Proton Coin genesis blocks which both use x16r however neither appear to work for slightly different reasons.

  • In Raven neither the Merkle Root nor the Genesis Hash match when using the inputs from chainparams.cpp. I noticed that RVN have changed their nVersion to 4 rather than the standard 1, I've amended it in the .js file (tx.writeIntLE(1, position, true);) however it doesn't seem to resolve the issue.
  • In Proton, the Merkle Root matches however the Genesis Hash does not.

RVN
Command:

-a x16r -t 1514999494 -z "The Times 03/Jan/2018 Bitcoin is name of the game for new generation of firms" -n 25023712 -v 500000000000 -b 503382015 -p 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
Output:

pzTimestamp: The Times 03/Jan/2018 Bitcoin is name of the game for new generation of firms
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 503382015
time: 1514999494
merkle root hash: fe91bee0581c7c4aa11c79545c253446054426c25f9298263180623aa187ddc5
Searching for genesis hash...
nonce: 25467455
genesis hash: 00000fd2d915ca2cd0d142784cf42d89a65b2b7e2eef60e83067b585e1bcac34

Expected Output
hashMerkleRoot=28ff00a867739a352523808d301f504bc4547699398d70faf2266a8bae5f3516
hashGenesisBlock=0x0000006b444bc2f2ffe627be9d9e7e7a0730000870ef6eb6da46c8eae389df90

Proton
Command

-t 1514160000 -z "Proton coin will start 25 Dec 2017" -n 1648566 -a x16r -v 5000000000 -b 504365040 -p 040a3ada5ba6280b99f49a92ba47221e6a72af844ec49d0c8bbdae1ec09a4c79b22e42eefe670ae04490556f91780eb57de76493d020c91d0c421c2fa052b28a2b
Output

algorithm: x16r
pzTimestamp: Proton coin will start 25 Dec 2017
pubkey: 040a3ada5ba6280b99f49a92ba47221e6a72af844ec49d0c8bbdae1ec09a4c79b22e42eefe670ae04490556f91780eb57de76493d020c91d0c421c2fa052b28a2b
bits: 504365040
time: 1514160000
merkle root hash: 33a98e8f8089165dc24358b01d52dd740011bdbffad052d51d3ac3588af2f487
Searching for genesis hash...
nonce: 1785462
genesis hash: 000002c591373a53a2e0a33eced290b0fecfb4cd96beac05d2fb42f85488bdca

Expected Output
hashMerkleRoot=0x33a98e8f8089165dc24358b01d52dd740011bdbffad052d51d3ac3588af2f487
hashGenesisBlock=0x00000e1728b630fd83aecbc51546c7915fffb7d3c897b5fd8c4b14043070b7f0

Cheers,
Ross.

Cannot Run for Neoscrypt test coin

When i run
node genesis -a neoscrypt -z "The Coin will be brutal, be prepared"

the terminal returns

module.js:550
    throw err;
    ^

Error: Cannot find module 'multi-hashing'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/Desktop/node-genesis-block-master/genesis.js:4:12)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

I read somewhere this is solved if I use Node.js v0.1 but i read in another neoscrypt related issue that you said to use 8.x.x

What have i done wrong?

(Edited -z to actual one, had a typo in initial post)

It does not correspond to yescrypt.

Hi,
Thank you for publishing wonderful software.
I prepared the environment and made it possible to generate Genesis block

However, it did not seem to correspond to the following algorithm.
scrypt: error
yescrypt: There is no Symbol
*It corresponded to neoscrypt.

Do you deal with yescrypt in the future?

Thanks in advance.

Different results with the same input

Im trying to run this script and getting different merkle and genesis blocks each time, using the same inputs. This is causing assertion errors in the C++ codebase. I am using Ubuntu 16.04 and Node version 6.1.0.

In the snippets below, the pubkey has been swapped out with "myPubkey" for readability. Any ideas? I get the same result when leaving out the nonce and pubkey flags, too.

I know the current version is recommended to be used with Node 12, but I have reverted back a few commits to when this still worked with older versions of Node.

Run 1

node genesis -a quark -z TestTimestamp -n 21561600 -t 1580928267 -v 0 -p myPubkey
---------------
algorithm: quark
pzTimestamp: TestTimestamp
pubkey: myPubkey
bits: 504365040
time: 1580928267
merkle root hash: e352d2d43e0972d3152b619919e84a1909160959cdabd2ce22bceb5e9be5c49a
nonce: 23763932
genesis hash: 00000164a6cc3631e927a5a4d6f7af699b391d1e284038c5797194452322e096

Run 2

node genesis -a quark -z TestTimestamp -n 21561600 -t 1580928267 -v 0 -p myPubkey
---------------
algorithm: quark
pzTimestamp: TestTimestamp
pubkey: myPubkey
bits: 504365040
time: 1580928267
merkle root hash: 19c9b4e29df146b59742324ef5ab1a040042de384c4a6b7a532e2c87673199f0
nonce: 21901961
genesis hash: 00000d4b3e68c0e3c58e4245120e92669c20e33c42351f0f9f5be71836d7ff02

scrypt

not working with scrypt, get this error
/home/ubuntu/node-genesis-block/node_modules/yargs/yargs.js:1109
else throw err
^

Error: You must provide buffer to hash, N value, and R value
at PoW (/home/ubuntu/node-genesis-block/genesis.js:158:59)
at Object.require.alias.alias.alias.alias.alias.alias.alias.alias.alias.help.command [as handler] (/home/ubuntu/node-genesis-block/genesis.js:51:9)
at Object.runCommand (/home/ubuntu/node-genesis-block/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/home/ubuntu/node-genesis-block/node_modules/yargs/yargs.js:1050:24)
at Object.get [as argv] (/home/ubuntu/node-genesis-block/node_modules/yargs/yargs.js:965:21)
at Object. (/home/ubuntu/node-genesis-block/genesis.js:57:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
working with other algos

I have a question.

Hello,nasa8x.
How are you?
i am going to generate x11 genesis hash by using your node-genesis-block.
i can generate genesis hash successfully.
But can i use this genesis hash in pow/pos masternode coin fork?
or can i use this genesis hash only in pow coin fork?
please reply to me.
Thanks

something is wrog but...?

npm install

[email protected] install /home/cryptosnail/genesis-block/node_modules/multi-hashing
node-gyp rebuild -masm=intel

make: Entering directory '/home/cryptosnail/genesis-block/node_modules/multi-hashing/build'
CXX(target) Release/obj.target/multihashing/multihashing.o
../multihashing.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE lyra2rev2(Nan::NAN_METHOD_ARGS_TYPE)’:
../multihashing.cc:70:14: warning: unused variable ‘input_len’ [-Wunused-variable]
uint32_t input_len = Buffer::Length(target);
^
../multihashing.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE lyra2z(Nan::NAN_METHOD_ARGS_TYPE)’:
../multihashing.cc:91:14: warning: unused variable ‘input_len’ [-Wunused-variable]
uint32_t input_len = Buffer::Length(target);
^
../multihashing.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE boolberry(Nan::NAN_METHOD_ARGS_TYPE)’:
../multihashing.cc:172:40: warning: ‘v8::Localv8::Uint32 v8::Value::ToUint32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
height = info[2]->ToUint32()->Uint32Value(); // TODO: This does not
^
In file included from /home/cryptosnail/.node-gyp/9.11.1/include/node/node.h:63:0,
from ../multihashing.cc:1:
/home/cryptosnail/.node-gyp/9.11.1/include/node/v8.h:9883:15: note: declared here
Local Value::ToUint32() const {
^
CC(target) Release/obj.target/multihashing/bcrypt.o
CC(target) Release/obj.target/multihashing/blake.o
CXX(target) Release/obj.target/multihashing/boolberry.o
In file included from ../crypto/cryptonote_core/cryptonote_format_utils.h:7:0,
from ../boolberry.cc:2:
../crypto/cryptonote_core/../wild_keccak.h: In function ‘int crypto::keccak_generic(const uint8_t*, size_t, uint8_t*, size_t)’:
../crypto/cryptonote_core/../wild_keccak.h:63:39: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
^
../crypto/cryptonote_core/../wild_keccak.h: In function ‘int crypto::wild_keccak(const uint8_t*, size_t, uint8_t*, size_t, callback_t)’:
../crypto/cryptonote_core/../wild_keccak.h:98:39: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
^
../crypto/cryptonote_core/../wild_keccak.h: In instantiation of ‘int crypto::wild_keccak(const uint8_t*, size_t, uint8_t*, size_t, callback_t) [with f_traits = crypto::mul_f; callback_t = cryptonote::get_blob_longhash_bb(const blobdata&, crypto::hash&, uint64_t, callback_t) [with callback_t = boolberry_hash(const char*, uint32_t, const char*, uint64_t, char*, uint64_t)::<lambda(uint64_t)>; blobdata = std::__cxx11::basic_string; uint64_t = long unsigned int]::<lambda(uint64_t (&)[25], uint64_t (&)[24])>; uint8_t = unsigned char; size_t = long unsigned int]’:
../crypto/cryptonote_core/../wild_keccak.h:151:26: required from ‘int crypto::wild_keccak_dbl(const uint8_t*, size_t, uint8_t*, size_t, callback_t) [with f_traits = crypto::mul_f; callback_t = cryptonote::get_blob_longhash_bb(const blobdata&, crypto::hash&, uint64_t, callback_t) [with callback_t = boolberry_hash(const char*, uint32_t, const char*, uint64_t, char*, uint64_t)::<lambda(uint64_t)>; blobdata = std::__cxx11::basic_string; uint64_t = long unsigned int]::<lambda(uint64_t (&)[25], uint64_t (&)[24])>; uint8_t = unsigned char; size_t = long unsigned int]’
../crypto/cryptonote_core/cryptonote_format_utils.h:15:43: required from ‘bool cryptonote::get_blob_longhash_bb(const blobdata&, crypto::hash&, uint64_t, callback_t) [with callback_t = boolberry_hash(const char*, uint32_t, const char*, uint64_t, char*, uint64_t)::<lambda(uint64_t)>; blobdata = std::__cxx11::basic_string; uint64_t = long unsigned int]’
../boolberry.cc:10:6: required from here
cc1plus: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
CC(target) Release/obj.target/multihashing/c11.o
CC(target) Release/obj.target/multihashing/cryptonight.o
../cryptonight.c:60:13: warning: ‘mul’ defined but not used [-Wunused-function]
static void mul(const uint8_t* a, const uint8_t* b, uint8_t* res) {
^
../cryptonight.c:74:13: warning: ‘sum_half_blocks’ defined but not used [-Wunused-function]
static void sum_half_blocks(uint8_t* a, const uint8_t* b) {
^
../cryptonight.c:92:13: warning: ‘swap_blocks’ defined but not used [-Wunused-function]
static void swap_blocks(uint8_t* a, uint8_t* b) {
^
CC(target) Release/obj.target/multihashing/dcrypt.o
../dcrypt.c: In function ‘dcrypt_hash’:
../dcrypt.c:144:25: warning: pointer targets in passing argument 2 of ‘sha256’ differ in signedness [-Wpointer-sign]
sha256(finalToHash, hash, len + lenMixedHash);
^
../dcrypt.c:37:6: note: expected ‘unsigned char *’ but argument is of type ‘char *’
void sha256(unsigned char * instr, unsigned char * hash, unsigned int len)
^
CC(target) Release/obj.target/multihashing/fresh.o
CC(target) Release/obj.target/multihashing/fugue.o
CC(target) Release/obj.target/multihashing/groestl.o
In file included from ../groestl.c:8:0:
../sha256.h:390:1: warning: ‘PBKDF2_SHA256’ defined but not used [-Wunused-function]
PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,
^
CC(target) Release/obj.target/multihashing/hefty1.o
In file included from ../hefty1.c:7:0:
../sha256.h:390:1: warning: ‘PBKDF2_SHA256’ defined but not used [-Wunused-function]
PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,
^
CC(target) Release/obj.target/multihashing/keccak.o
CC(target) Release/obj.target/multihashing/lyra2.o
../lyra2.c:24:19: fatal error: Lyra2.h: No such file or directory
compilation terminated.
multihashing.target.mk:167: recipe for target 'Release/obj.target/multihashing/lyra2.o' failed
make: *** [Release/obj.target/multihashing/lyra2.o] Error 1
make: Leaving directory '/home/cryptosnail/genesis-block/node_modules/multi-hashing/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.13.0-38-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "-masm=intel"
gyp ERR! cwd /home/cryptosnail/genesis-block/node_modules/multi-hashing
gyp ERR! node -v v9.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild -masm=intel
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/cryptosnail/.npm/_logs/2018-04-06T02_00_33_341Z-debug.log

Error with "byteLength"

No matter which algo I try i get the same error.

node genesis -a scrypt
/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/node_modules/yargs/yargs.js:1133
      else throw err
           ^

TypeError [ERR_INVALID_ARG_TYPE]: The "byteLength" argument must be of type number. Received type boolean
    at validateNumber (internal/validators.js:130:11)
    at boundsError (internal/buffer.js:42:5)
    at Buffer.writeIntLE (internal/buffer.js:674:3)
    at createTx (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/genesis.js:91:8)
    at Object.require.alias.alias.alias.alias.alias.alias.alias.alias.alias.help.command [as handler] (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/genesis.js:40:37)
    at Object.runCommand (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/node_modules/yargs/yargs.js:1074:24)
    at Object.get [as argv] (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/node_modules/yargs/yargs.js:989:21)
    at Object.<anonymous> (/mnt/c/Users/tvle8/WebstormProjects/node-genesis-block/genesis.js:55:5)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
node -v
v10.16.3

SyntaxError: Unexpected token )

Hi, I'm trying to generate a genesis block for bitcoin: node genesis -a sha256d -z "Vecernji list 22/June/2023
Tvrtka OceanGate objavila: Vjerujemo da su svi putnici poginuli" -n 2832037265 -t 1529098663

But I get the following error:
/usr/src/diplomski/genesis-block/genesis.js:35
.command('*', 'create genesis block', () => { }, (argv) => {
^
SyntaxError: Unexpected token )
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:945:3

I have yarn installed

Nodejs/nom versions

Hi,

Could you advise what version of nodejs and npm is recommended when compiling?

Thanks,
Ross

Getting error when attempting to run

/root/genesis-block/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-block/genesis.js:61:64)
at createTx (/root/genesis-block/genesis.js:72:17)
at Object.handler (/root/genesis-block/genesis.js:40:37)
at Object.runCommand (/root/genesis-block/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-block/node_modules/yargs/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEach.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.forEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.self.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv] (/root/genesis-block/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-block/genesis.js:55:5)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

Any advice? Seems to be happening with all algos

how to fix this error?

i am going to run genesis using node-genesis-block.
but when i run "node genesis -a quark", error happens.
the errors are as follows.
root@vmi167433:~/genesis-block-node# node genesis -a quark
/root/genesis-block-node/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-block-node/genesis.js:61:64)
at createTx (/root/genesis-block-node/genesis.js:72:17)
at Object.handler (/root/genesis-block-node/genesis.js:40:37)
at Object.runCommand (/root/genesis-block-node/node_modules/yargs/lib/comman d.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-block-node/node_modules/y args/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEac h.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.f orEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.sel f.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv ] (/root/genesis-block-node/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-block-node/genesis.js:55:5)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
root@vmi167433:/genesis-block-node# npm i yargs
root@vmi167433:
/genesis-block-node# node genesis -a quark
/root/genesis-block-node/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-block-node/genesis.js:61:64)
at createTx (/root/genesis-block-node/genesis.js:72:17)
at Object.handler (/root/genesis-block-node/genesis.js:40:37)
at Object.runCommand (/root/genesis-block-node/node_modules/yargs/lib/comman d.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-block-node/node_modules/y args/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEac h.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.f orEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.sel f.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv ] (/root/genesis-block-node/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-block-node/genesis.js:55:5)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

i have installed yargs. npm i yargs as nasa8x said. but still same error.
i hope to help me plz!!!

bugged

root@vps-e54d80:~/genesis-block0# node genesis -a cryptonight -z 1526726543
/root/genesis-block0/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-block0/genesis.js:61:64)
at createTx (/root/genesis-block0/genesis.js:72:17)
at Object.handler (/root/genesis-block0/genesis.js:40:37)
at Object.runCommand (/root/genesis-block0/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-block0/node_modules/yargs/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEach.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.forEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.self.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv] (/root/genesis-block0/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-block0/genesis.js:55:5)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

Scrypt generate

How does one specify the N and R value?

x@x-virtual-machine:~/Desktop/crypto/genesis-block$ node genesis.js -a scrypt
---------------
algorithm: scrypt
pzTimestamp: Don't work for weekends, work for our goals.
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 504365040
time: 1522705710
merkle root hash: f5239467dd2a9dd0fce7a3babc03c7985eab2229c62e3d5670375f305753c9cc
Searching for genesis hash...
/home/x/Desktop/crypto/genesis-block/node_modules/yargs/yargs.js:1101
      else throw err
           ^

Error: You must provide buffer to hash, N value, and R value
    at PoW (/home/x/Desktop/crypto/genesis-block/genesis.js:143:59)
    at Object.require.alias.alias.alias.alias.alias.alias.alias.alias.alias.help.command [as handler] (/home/x/Desktop/crypto/genesis-block/genesis.js:50:9)
    at Object.runCommand (/home/x/Desktop/crypto/genesis-block/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/home/x/Desktop/crypto/genesis-block/node_modules/yargs/yargs.js:1042:24)
    at Object.get [as argv] (/home/x/Desktop/crypto/genesis-block/node_modules/yargs/yargs.js:957:21)
    at Object.<anonymous> (/home/x/Desktop/crypto/genesis-block/genesis.js:55:5)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)

nodejs 10 support

nasa8x tools are fantastic to use for weird and wonderful genesis blocks, but old and outdated code.

nodejs 10 or better. Fix python code for the other version for the implicit 'self' or whatever that issue is.

I wish I could help but unreadable code problems too. If I could "get" the gist of it I would write a C++ version that can work with just about anything. A little help to get a C++ version happening, like what the js and python code is actually doing? :)

chainparams.cpp:130: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x00000a0ba726ce40299f8e52654b53a771e17329fa60d08745f8e8e54ff65b51")' failed. Aborted (core dumped)

Hello, when I run the daemon after its configuration I get this error:

chainparams.cpp:130: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x00000a0ba726ce40299f8e52654b53a771e17329fa60d08745f8e8e54ff65b51")' failed.
Aborted (core dumped)

Can you please help me.

Information:

chainparams.cpp : https://pastebin.com/eLaFidda
genesis generation:


algorithm: yescrypt
pzTimestamp: ONYX - 10/08/2022
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc 3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
bits: 504365040
time: 1660435653
merkle root hash: 36e738d3e034b5ada75c4c572f1efbcddde8d1d93894f616c9257333c7210c 55
Searching for genesis hash...
nonce: 1257
genesis hash: 00000a0ba726ce40299f8e52654b53a771e17329fa60d08745f8e8e54ff65b51

Please add X16RV2

Id like to fork ravencoin and i cannot generate a genesis block for it

Allium Algo

I'm mkaing a coin that uses allium algo. Are you able to add that to this so I can get genesis block? I've been trying for ever to get the genesis block but can't get a proper one. Code is on my github.

Cannot get the script to work

Hi Nasa, thanks for your wonderful script. Can you help to get the script to work? I keep getting erros:

root@orien-2:~/genesis-maker/genesis-block/genesis-block/genesis-block# node genesis -a quark
/root/genesis-maker/genesis-block/genesis-block/genesis-block/node_modules/yargs/yargs.js:1101
else throw err
^

TypeError: this is not a typed array.
at Function.from (native)
at createInputScript (/root/genesis-maker/genesis-block/genesis-block/genesis-block/genesis.js:61:64)
at createTx (/root/genesis-maker/genesis-block/genesis-block/genesis-block/genesis.js:72:17)
at Object.handler (/root/genesis-maker/genesis-block/genesis-block/genesis-block/genesis.js:40:37)
at Object.runCommand (/root/genesis-maker/genesis-block/genesis-block/genesis-block/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/root/genesis-maker/genesis-block/genesis-block/genesis-block/node_modules/yargs/yargs.js:1042:24)
at Object.Yargs.self.$0.self.resetOptions.self.reset.tmpOptions.local.forEach.Object.keys.reduce.arrayOptions.forEach.keys.forEach.key.forEach.Object.keys.forEach.Object.keys.forEach.self.config.self.demand.self.required.self.global.self.option.self.positional.self.group.self.exit.Object.defineProperty.get [as argv] (/root/genesis-maker/genesis-block/genesis-block/genesis-block/node_modules/yargs/yargs.js:957:21)
at Object. (/root/genesis-maker/genesis-block/genesis-block/genesis-block/genesis.js:55:5)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.