Lisk Easy Genesis (L.E.G.) is a simple tool that allows you to create a Lisk SDK v5.x.x genesis block and application config in seconds. Use the interactive wizard or add your own base config.
- Node: version >=12.20.0 <=12
- OS: Linux or Mac
git clone https://github.com/Lemii/lisk-easy-genesis
cd lisk-easy-genesis
npm i
There are two ways of running the tool:
If you have little experience, your sidechain is very basic, or if you simply want to fire up a network real quick, this is the option for you.
- Run the tool with
npm run wizard
- Go through all the prompts
- Done! ✔️
The generated genesis block, configuration and credentials will be saved as JSON files in the output
folder.
FYI: Defaults are provided for technical matters, meaning that you can leave certain prompts empty if you don't know what to answer with.
The remainder of the settings are taken from the baseConfig.json
found in the input
folder.
If you have more experience and know what you are doing, you can go ahead and edit the baseConfig.js
file directly. This allows you to customize the genesis block and configuration in a more in depth manner. It will skip the prompts altogether.
- Edit the
baseConfig.js
file to your liking, or replace it with your own (theforging.delegates
field will be overwritten in the output) - Run the tool with
npm start
- Done! ✔️
The generated genesis block, configuration and credentials will be saved as JSON files in the output
folder.
If your sidechain contains custom modules that modify the properties of an account
, these must be included in the genesis block. If you are running a vanilla chain (no extra modules aside from the default ones), you can skip this step.
To do this, simply add the account schema for each module to the schemas.js
file in the input
folder. You can find the schema in the module with the property name accountSchema
. The variable name of the schema must match the module name. Don't forgot to export
it!
Example:
export const myCustomModule = {
type: "object",
properties: {
myCustomField: {
fieldNumber: 1,
type: "array",
items: {
dataType: "string",
},
},
},
default: {
myCustomField: [],
},
};
The tool will then include all schemas defined in the schemas.js
file in the genesis block.
Parts of this tool are based on the excellent Generating a genesis block guide written by Mona Bärenfänger.