Skip to content

Commit

Permalink
Add bootnodes list to genesis.json (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt authored Sep 18, 2023
1 parent 8baaded commit de12663
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,12 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.RinkebyBootnodes
case ctx.Bool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.IsSet(CustomChainFlag.Name):
jsonGenesis, err := readJSONGenesis(ctx.String(CustomChainFlag.Name))
if err != nil {
Fatalf("Failed to read bootstrap nodes from genesis %s: %v", CustomChainFlag.Name, err)
}
urls = jsonGenesis.Bootnodes
}

// don't apply defaults if BootstrapNodes is already set
Expand Down Expand Up @@ -2269,6 +2275,8 @@ type jsonGenesis struct {
InitialSigners []string `json:"initial_signers"`
} `json:"clique,omitempty"`
} `json:"config"`

Bootnodes []string `json:"bootnodes"`
}

func readJSONGenesis(genesisPath string) (*jsonGenesis, error) {
Expand Down

0 comments on commit de12663

Please sign in to comment.