EWF chain genesis JSON generator script. Used for Volta and EWC.
The JSON file can be eventually manually pushed to https://github.com/energywebfoundation/ewf-chainspec.
Primary: Mani Hagh Sefat (@manihagh)
Pietro Danzi (@danzipie), Adam Nagy (@ngyam)
- node 8
- npm
The build script will download MultiSigWallet and system contracts in a local directory named .cloned_repos/
then compile them.
To run the install and build in one step:
# for ewc
npm run build:install
# for volta
npm run build:install:volta
If you just want to build the contracts again:
# for ewc
npm run build
# for volta
npm run build:volta
To generate the chainspec:
# for ewc
npm run gen
# for volta
npm run gen:volta
This will put the generated chainspec into the build/
folder.
Using the generator script
- Make sure that the contracts are pulled and compiled, if not, run
npm run build:install
ornpm run build:install:volta
- Make sure that the necessary input files are put to the ./chainspec_skeletons folder:
[SPEC_NAME].json
: chainspec skeleton which needs to be filled with genesis contracts and accounts. SPEC_NAME should be lowercase, e.g for Volta chain is:volta
->volta.json
.hardcoded_values_[SPEC_NAME].json
: all the necessary hardcoded addresses to be used in the chainspec. Forvolta
->hardcoded_values_volta.json
.
- Do
npm run gen
ornpm run gen:volta
, or./index.js
with params manually.
Params: The script accepts 3 params:
-m
: multisig wallet build folder-p
: system contracts build folder-b
: output build folder where the chainspec will be generated.-s
: spec name/config
node . --p [COMPILED-CONTRACTS-PATH] -m [COMPILED-MULTISIG-PATH] -b [OUTPUT_BUILD_PATH] -s [SPEC_NAME]
e.g. the default params are:
node . -p "./.cloned_repos/ewc-system-contracts/build/contracts/" -m "./.cloned_repos/MultiSigWallet/build/contracts/" -b "./build" -s volta
Please read our CONTRIBUTING guide for our code of conduct and for the process of submitting pull requests to us.
We use SemVer for versioning.
This project is licensed under the GPLv3 License - see the LICENSE file for details.
- How do I get the SHA3 value of the spec file?
A command is:
openssl dgst -sha256 build/$(chainspec_name_here)