mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
Support Chain Config File Loading in Genesis State Tool (#11249)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
9b3a834437
commit
e70fe1c9fd
@ -40,6 +40,7 @@ var (
|
|||||||
yamlOutputFile = flag.String("output-yaml", "", "Output filename of the YAML marshaling of the generated genesis state")
|
yamlOutputFile = flag.String("output-yaml", "", "Output filename of the YAML marshaling of the generated genesis state")
|
||||||
jsonOutputFile = flag.String("output-json", "", "Output filename of the JSON marshaling of the generated genesis state")
|
jsonOutputFile = flag.String("output-json", "", "Output filename of the JSON marshaling of the generated genesis state")
|
||||||
configName = flag.String("config-name", params.MinimalName, "ConfigName for the BeaconChainConfig that will be used for interop, inc GenesisForkVersion of generated genesis state")
|
configName = flag.String("config-name", params.MinimalName, "ConfigName for the BeaconChainConfig that will be used for interop, inc GenesisForkVersion of generated genesis state")
|
||||||
|
configFile = flag.String("chain-config-file", "", "Path to a chain config file for setting global params")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -56,12 +57,18 @@ func main() {
|
|||||||
log.Fatalf("unable to set mainnet config active, err=%s", err.Error())
|
log.Fatalf("unable to set mainnet config active, err=%s", err.Error())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfg, err := params.ByName(*configName)
|
if *configFile != "" {
|
||||||
if err != nil {
|
if err := params.LoadChainConfigFile(*configFile, nil); err != nil {
|
||||||
log.Fatalf("unable to find config using name %s, err=%s", *configName, err.Error())
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if err := params.SetActive(cfg.Copy()); err != nil {
|
} else {
|
||||||
log.Fatalf("unable to set %s config active, err=%s", cfg.ConfigName, err.Error())
|
cfg, err := params.ByName(*configName)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("unable to find config using name %s, err=%s", *configName, err.Error())
|
||||||
|
}
|
||||||
|
if err := params.SetActive(cfg.Copy()); err != nil {
|
||||||
|
log.Fatalf("unable to set %s config active, err=%s", cfg.ConfigName, err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var genesisState *ethpb.BeaconState
|
var genesisState *ethpb.BeaconState
|
||||||
|
Loading…
Reference in New Issue
Block a user