cmichi / chainspec-generator

CLI for generating the Polkadot and Kusama chain specification from Ethereum state.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Genesis Chainspec Generator

CLI for generating the Polkadot and Kusama chain specification from the state of the DOT Allocation and Claims contracts.

Running

Clone this repository to your desired environment and install the dependencies using yarn. You will also need Python3.

$ git clone https://github.com/w3f/chainspec-generator.git
$ cd chainspec-generator
$ yarn

Generating the Genesis Chain Specification

In order to generate the polkadot.json chain specification from Ethereum state, run the command like so (this will use the default values for the environmental variables):

$ chmod +x scripts/polkadot-genesis.sh
$ ./scripts/polkadot-genesis.sh

In order to generate using the Ethereum state from a specific block, run the command with the AT_BLOCK environmental variable. In order to use an archive node at a given HTTP endpoint, use the HTTP_ENDPOINT variable.

$ HTTP_ENDPOINT=<URL> AT_BLOCK=<ETH_BLOCK_NUM> ./scripts/polkadot-genesis.sh

Verifying the Initial State of a Chain

Once you have started a chain using the polkadot.json chain specification, you can also use this tool to verify that the state initialized properly. Make sure to have the WebSockets RPC port open on your node.

$ yarn verify

About

CLI for generating the Polkadot and Kusama chain specification from Ethereum state.


Languages

Language:TypeScript 89.6%Language:Python 5.2%Language:Shell 2.9%Language:JavaScript 2.3%