Skip to content

Commit

Permalink
Unique bootnode urls
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy committed Sep 27, 2023
1 parent ff257a5 commit ff95b95
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 27 deletions.
21 changes: 4 additions & 17 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,24 +751,11 @@ func setNodeUserIdent(ctx *cli.Context, cfg *node.Config) {
}
}

// setBootstrapNodes creates a list of bootstrap nodes from the command line
// flags, reverting to pre-configured ones if none have been specified.
// setBootstrapNodes creates a list of bootstrap nodes from the pre-configured
// ones if none have been specified.
func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls := params.ColosseumBootnodes
switch {
case ctx.GlobalIsSet(BootnodesFlag.Name):
urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
case ctx.GlobalBool(GardenFlag.Name):
urls = params.GardenBootnodes
case ctx.GlobalBool(OrchardFlag.Name):
urls = params.OrchardBootnodes
case ctx.GlobalBool(LighthouseFlag.Name):
urls = params.LighthouseBootnodes
case ctx.GlobalBool(LocalFlag.Name):
urls = []string{}
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
urls := params.ColosseumBootnodes[common.NodeLocation.Name()]
//TODO: fix bootnode parsing for other networks

cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls))
for _, url := range urls {
Expand Down
Loading

0 comments on commit ff95b95

Please sign in to comment.