incubator-tuweni icon indicating copy to clipboard operation
incubator-tuweni copied to clipboard

Genesis file creation tool

Open atoulme opened this issue 5 years ago • 5 comments
trafficstars

Genesis ceremonies involve having all participants take a JSON file which defines how the network will behave.

Motivation

Genesis files are easy to get wrong. They don't have a proper spec (question) and are written in JSON.

Scope of work

  • Allow creation of Genesis files using a tool.
  • Allow formatting of Genesis JSON contents using a specific formatter so it can be hashed and verified across peers.

atoulme avatar Mar 02 '20 06:03 atoulme

Parity and Geth clients have different acceptable genesis files,

Parity: https://github.com/5chdn/crossclient-chainspec/blob/master/parity.json

Geth: https://github.com/5chdn/crossclient-chainspec/blob/master/geth.json

yes, the spec. isn't even agreed to as a standard in ethereum foundation, which chain_id and network_id having different meanings, but let's just ignore that for this argument.

I think a good place to start would be with something like this: https://github.com/ethereum-lists/chains where a network's metadata is at least indexed and agreed upon. Defining those terms first then worrying about specific parts such as alloc for example would be easier, as the amount of configuration is rather large when you start getting into IBFT2, etc.

Another good reference point would be the Parity config generator: https://paritytech.github.io/parity-config-generator/#config=e30=

sambacha avatar May 30 '20 22:05 sambacha

I just committed a genesis file reader.

atoulme avatar May 30 '20 22:05 atoulme

It definitely doesn't use as much flexibility as required, and some of the alloc keys are missing. Contribs to make that easier are welcome. We can easily make a genesis file writer as well.

atoulme avatar May 30 '20 22:05 atoulme

Will check it out, I have a script I made to create a genesis file but it is for Hyperledger Besu, will have to dig it out. In the meantime will look at collecting a reference list I suppose of different chains? Should this only concern itself with EVM compatible, or would we want to include other types e.g. UTXO model?

sambacha avatar May 31 '20 00:05 sambacha

The reader I made is meant for ethereum. It is too specific to ethereum to be reused for another chain, but you could get inspired by it pretty easily.

On May 30, 2020, at 17:23, sam bacha [email protected] wrote:

 Will check it out, I have a script I made to create a genesis file but it is for Hyperledger Besu, will have to dig it out. In the meantime will look at collecting a reference list I suppose of different chains? Should this only concern itself with EVM compatible, or would we want to include other types e.g. UTXO model?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

atoulme avatar May 31 '20 00:05 atoulme

We have a genesis tool now: https://github.com/apache/incubator-tuweni/tree/main/genesis

Closing as complete!

atoulme avatar Jan 11 '23 02:01 atoulme