protolambda / eth2-testnet-genesis

Create a genesis state for an Eth2 testnet
MIT License
46 stars 25 forks source link

Wrong chain id generated from config files #22

Open jvbriones opened 1 year ago

jvbriones commented 1 year ago

Very useful tool, thank you.

We are trying to set up a custom local network with capella support with some allocated accounts and contracts on the execution genesis file.

We generate the genesis.ssz file but when trying to use it, the generated network id is 1 instead of the one provided by the config files:

1) config inputs:

engine_genesis.json
{
  "config": {
    "chainId": 2018,
    ...
}
eth2_config.yaml
{
...
DEPOSIT_CHAIN_ID: 2018
DEPOSIT_NETWORK_ID: 2018
...
}

> ./eth2-testnet-genesis capella --config=eth2_config.yaml --> output: genesis.ssz

2) starting up both execution and consensus clients

eth1_node:
 - --genesis-file=engine_genesis.json
 ...
eth2_node:
- --genesis-state=genesis.ssz

3) the eth2 node complains:

ERROR - PLEASE CHECK YOUR ETH1 NODE (endpoint http://eth1:8545)| Wrong Eth1 chain id (expected=1, actual=2018)

are we missing something? thanks,

parithosh commented 1 year ago

The full command you'd need is: ./eth2-testnet-genesis capella --config=config.yaml --mnemonics=mnemonics.yaml --eth1-config=genesis.json. So the chainID is obtained from the file specified in --eth1-config and that is currently missing in your command.

jvbriones commented 1 year ago

you would need to specify in the command the config file names if you are not using the default values right? is long time ago now, but we remember trying it with different ways without success - anyway, thank you.

parithosh commented 1 year ago

Ah, that file doesn't exist in the repo and should be corrected to default to ""... That was probably the source of your issue and I'll make a PR to change the default to null