Skip to content

Commit

Permalink
fix generating genesis config for chiado (#12699)
Browse files Browse the repository at this point in the history
We couldn't start chiado without passing genesis state file and custom
config.

```
open /Users/shota/Desktop/work.nosync/datadir/caplin-chiado3/caplin/genesis/genesis_state.ssz_snappy: no such file or directory
```

Now

```
./build/bin/caplin --datadir ../datadir/caplin-chiado --chain=chiado
```

works.

Co-authored-by: shota.silagadze <[email protected]>
  • Loading branch information
shotasilagadze and shotasilagadzetaal authored Nov 11, 2024
1 parent 2a4f612 commit 3e36aa8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cl/clparams/initial_state/initial_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func GetGenesisState(network clparams.NetworkType) (*state.CachingBeaconState, e
if err := returnState.DecodeSSZ(gnosisStateSSZ, int(clparams.Phase0Version)); err != nil {
return nil, err
}
case clparams.ChiadoNetwork:
if err := returnState.DecodeSSZ(gnosisStateSSZ, int(clparams.Phase0Version)); err != nil {
return nil, err
}
case clparams.HoleskyNetwork:
// Download genesis state by wget the url
encodedState, err := downloadGenesisState("https://github.com/eth-clients/holesky/raw/main/metadata/genesis.ssz")
Expand All @@ -84,5 +88,5 @@ func GetGenesisState(network clparams.NetworkType) (*state.CachingBeaconState, e
}

func IsGenesisStateSupported(network clparams.NetworkType) bool {
return network == clparams.MainnetNetwork || network == clparams.SepoliaNetwork || network == clparams.GnosisNetwork || network == clparams.HoleskyNetwork
return network == clparams.MainnetNetwork || network == clparams.SepoliaNetwork || network == clparams.GnosisNetwork || network == clparams.ChiadoNetwork || network == clparams.HoleskyNetwork
}

0 comments on commit 3e36aa8

Please sign in to comment.