Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom genesis data #157

Open
bluecat-xl opened this issue Mar 19, 2024 · 3 comments
Open

Support custom genesis data #157

bluecat-xl opened this issue Mar 19, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@bluecat-xl
Copy link

bluecat-xl commented Mar 19, 2024

As i mentioned, we need run a custom eth network

we have a custom genesis data, need import first before run nodes

such as geth init etc

@karolpivo karolpivo self-assigned this Mar 19, 2024
@karolpivo karolpivo added the enhancement New feature or request label Mar 19, 2024
@karolpivo
Copy link
Contributor

Hi @bluecat-xl

this one is more complicated. From what I can see Geth and Erigon first import the genesis file to mint the first block and exit, then have to started again. This needs and ephemeral container that will run the command and exit. We handle tasks like this (such as key imports) in the separate management role (which is a clunky way of doing things) -> https://github.com/SlingNode/slingnode-ansible-ethereum-node-mgmt

It appears that Besu can simply be started with --genesis-file flag.

Nethermind is not clear how to do it.

Please outline the commands / flags required to use custom genesis data for each client - or at least the clients you are interested in. It will help us figure this out and implement in the role.

@bluecat-xl bluecat-xl changed the title Support custom genisis data Support custom genesis data Mar 20, 2024
@bluecat-xl
Copy link
Author

Hi @bluecat-xl

this one is more complicated. From what I can see Geth and Erigon first import the genesis file to mint the first block and exit, then have to started again. This needs and ephemeral container that will run the command and exit. We handle tasks like this (such as key imports) in the separate management role (which is a clunky way of doing things) -> https://github.com/SlingNode/slingnode-ansible-ethereum-node-mgmt

It appears that Besu can simply be started with --genesis-file flag.

Nethermind is not clear how to do it.

Please outline the commands / flags required to use custom genesis data for each client - or at least the clients you are interested in. It will help us figure this out and implement in the role.

@karolpivo
yeap, geth and erigon should init alone first,

besu shoud set --genesis-file flag

Nethermind shoud set --Init.ChainSpecPath flag

@karolpivo
Copy link
Contributor

Hi @bluecat-xl

I've added support for custom geneis / chain spec for Besu and Nethermind in version >= 0.37.0.

You need to set "genesis_file" variable to the local path on the controller. The role will copy the file to the server and start the container with the appropriate flag.

ansible-galaxy role install -f slingnode.ethereum
# verify slingnode.ethereum >= 0.37.0
ansible-galaxy role list  

Please test and let us know if this works for you.

We would be happy to get a contribution in the https://github.com/SlingNode/slingnode-ansible-ethereum-node-mgmt role for geth and erigon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants