Skip to content

Commit

Permalink
Add OP specific bootnodes (ethereum-optimism#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
trianglesphere authored Feb 21, 2024
1 parent 2f105f7 commit 78436b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,13 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.SepoliaBootnodes
case ctx.Bool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.IsSet(OPNetworkFlag.Name):
network := ctx.String(OPNetworkFlag.Name)
if strings.Contains(strings.ToLower(network), "mainnet") {
urls = params.OPMainnetBootnodes
} else {
urls = params.OPSepoliaBootnodes
}
}
}
cfg.BootstrapNodes = mustParseBootnodes(urls)
Expand Down Expand Up @@ -1123,6 +1130,13 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
urls = SplitAndTrim(ctx.String(BootnodesFlag.Name))
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
case ctx.IsSet(OPNetworkFlag.Name):
network := ctx.String(OPNetworkFlag.Name)
if strings.Contains(strings.ToLower(network), "mainnet") {
urls = append(urls, params.OPMainnetBootnodes...)
} else {
urls = append(urls, params.OPSepoliaBootnodes...)
}
}

cfg.BootstrapNodesV5 = make([]*enode.Node, 0, len(urls))
Expand Down
12 changes: 12 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ var MainnetBootnodes = []string{
"enode://4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052@157.90.35.166:30303", // bootnode-hetzner-fsn
}

var OPMainnetBootnodes = []string{
"enode://ca2774c3c401325850b2477fd7d0f27911efbf79b1e8b335066516e2bd8c4c9e0ba9696a94b1cb030a88eac582305ff55e905e64fb77fe0edcd70a4e5296d3ec@34.65.175.185?discport=30305",
"enode://dd751a9ef8912be1bfa7a5e34e2c3785cc5253110bd929f385e07ba7ac19929fb0e0c5d93f77827291f4da02b2232240fbc47ea7ce04c46e333e452f8656b667@34.65.107.0?discport=30305",
"enode://c5d289b56a77b6a2342ca29956dfd07aadf45364dde8ab20d1dc4efd4d1bc6b4655d902501daea308f4d8950737a4e93a4dfedd17b49cd5760ffd127837ca965@34.65.202.239?discport=30305",
}

// HoleskyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Holesky test network.
var HoleskyBootnodes = []string{
Expand All @@ -47,6 +53,12 @@ var SepoliaBootnodes = []string{
"enode://9e9492e2e8836114cc75f5b929784f4f46c324ad01daf87d956f98b3b6c5fcba95524d6e5cf9861dc96a2c8a171ea7105bb554a197455058de185fa870970c7c@138.68.123.152:30303", // sepolia-bootnode-1-ams3
}

var OPSepoliaBootnodes = []string{
"enode://2bd2e657bb3c8efffb8ff6db9071d9eb7be70d7c6d7d980ff80fc93b2629675c5f750bc0a5ef27cd788c2e491b8795a7e9a4a6e72178c14acc6753c0e5d77ae4@34.65.205.244?discport=30305",
"enode://db8e1cab24624cc62fc35dbb9e481b88a9ef0116114cd6e41034c55b5b4f18755983819252333509bd8e25f6b12aadd6465710cd2e956558faf17672cce7551f@34.65.173.88?discport=30305",
"enode://bfda2e0110cfd0f4c9f7aa5bf5ec66e6bd18f71a2db028d36b8bf8b0d6fdb03125c1606a6017b31311d96a36f5ef7e1ad11604d7a166745e6075a715dfa67f8a@34.65.229.245?discport=30305",
}

// GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Görli test network.
var GoerliBootnodes = []string{
Expand Down

0 comments on commit 78436b6

Please sign in to comment.