quorum icon indicating copy to clipboard operation
quorum copied to clipboard

Simple command line tool to help create genesis file

Open davebryson opened this issue 9 years ago • 7 comments

I created a very simple command line tool to make it a little easier to create a genesis file with voters and block makers. You can find it here: https://github.com/davebryson/quorum-genesis. Given a configuration file of voters and makers it will create the proper storage keys and pre-fund the addresses.

davebryson avatar Jan 11 '17 18:01 davebryson

Great job @davebryson. I was just struggling to understand how the genesis file was created. It seems like the Running.md has some mistakes. Am I correct?

According to the genesis.json file the following is correct:

key1    vote key 1, block maker 1
key2    block maker 2
key3    vote key 2
key4    vote key 3
key5    vote key 4

ali92hm avatar Jan 12 '17 01:01 ali92hm

@davebryson That is a useful tool. Thank you!

@A92hm Good catch. The roles are actually different (see https://github.com/jpmorganchase/quorum-examples/blob/master/examples/7nodes/start.sh.) We will update the documentation.

patrickmn avatar Jan 12 '17 01:01 patrickmn

@patrickmn Yes according to start.sh

key1    observer
key2    maker
key3    voter
key4    voter
key5    voter

but then why is the key 1 (i.e 0xed9d02e382b34818e88b88a309c7fe71e65f419d) is included in the genesis.json block as a voter 0x29ecdbdf95c7f6ceec92d6150c697aa14abeb0f8595dd58d808842ea237d8494 and as a block maker 0xaca3b76ed4968740c3180dd7fa37f4aa229a2c758a848f53920e9ccb4c4bb74e

ali92hm avatar Jan 12 '17 02:01 ali92hm

Also it seems like you're allocating ether for key1: 0xed9d02e382b34818e88b88a309c7fe71e65f419d twice on lines 20 and 32 These were the only things that threw me off a bit, otherwise great job with the software and documentation. Simply AMAZING. I don't mind making a PR with fixes, let me know.

ali92hm avatar Jan 12 '17 02:01 ali92hm

@A92hm note that the genesis.json file is used to specify which keys are allowed to vote/make blocks, but actually when you start up your node you don't have to set your node to have any role. Equally you don't have to set your node to have the role that is defined in the genesis file, but of course if you start your node as a voter but have not configured your key to be a voter in the genesis file then it will not be able to vote. This is why you see key1 being configured as a voter&maker but not actually run as those. Thanks for the catch on the duplicate ether balance, that has now been fixed in the quorum-examples repo and we'll update the running.md documentation accordingly too. We're also going to better document the genesis file within the wiki.

@davebryson thanks very much for the tool! We would like to link to it from the Quorum repo if you don't have any objections?

tylobban avatar Jan 20 '17 17:01 tylobban

@tylobban No objections at all.

davebryson avatar Jan 20 '17 20:01 davebryson

Hi all, is that possible we can add a new node to the network which is not defined initially in the genesis json ?

alexpee avatar Oct 19 '17 07:10 alexpee