Skip to content

Commit 78436b6

Browse files
Add OP specific bootnodes (ethereum-optimism#247)
1 parent 2f105f7 commit 78436b6

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

cmd/utils/flags.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,13 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
10941094
urls = params.SepoliaBootnodes
10951095
case ctx.Bool(GoerliFlag.Name):
10961096
urls = params.GoerliBootnodes
1097+
case ctx.IsSet(OPNetworkFlag.Name):
1098+
network := ctx.String(OPNetworkFlag.Name)
1099+
if strings.Contains(strings.ToLower(network), "mainnet") {
1100+
urls = params.OPMainnetBootnodes
1101+
} else {
1102+
urls = params.OPSepoliaBootnodes
1103+
}
10971104
}
10981105
}
10991106
cfg.BootstrapNodes = mustParseBootnodes(urls)
@@ -1123,6 +1130,13 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
11231130
urls = SplitAndTrim(ctx.String(BootnodesFlag.Name))
11241131
case cfg.BootstrapNodesV5 != nil:
11251132
return // already set, don't apply defaults.
1133+
case ctx.IsSet(OPNetworkFlag.Name):
1134+
network := ctx.String(OPNetworkFlag.Name)
1135+
if strings.Contains(strings.ToLower(network), "mainnet") {
1136+
urls = append(urls, params.OPMainnetBootnodes...)
1137+
} else {
1138+
urls = append(urls, params.OPSepoliaBootnodes...)
1139+
}
11261140
}
11271141

11281142
cfg.BootstrapNodesV5 = make([]*enode.Node, 0, len(urls))

params/bootnodes.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ var MainnetBootnodes = []string{
2828
"enode://4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052@157.90.35.166:30303", // bootnode-hetzner-fsn
2929
}
3030

31+
var OPMainnetBootnodes = []string{
32+
"enode://ca2774c3c401325850b2477fd7d0f27911efbf79b1e8b335066516e2bd8c4c9e0ba9696a94b1cb030a88eac582305ff55e905e64fb77fe0edcd70a4e5296d3ec@34.65.175.185?discport=30305",
33+
"enode://dd751a9ef8912be1bfa7a5e34e2c3785cc5253110bd929f385e07ba7ac19929fb0e0c5d93f77827291f4da02b2232240fbc47ea7ce04c46e333e452f8656b667@34.65.107.0?discport=30305",
34+
"enode://c5d289b56a77b6a2342ca29956dfd07aadf45364dde8ab20d1dc4efd4d1bc6b4655d902501daea308f4d8950737a4e93a4dfedd17b49cd5760ffd127837ca965@34.65.202.239?discport=30305",
35+
}
36+
3137
// HoleskyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
3238
// Holesky test network.
3339
var HoleskyBootnodes = []string{
@@ -47,6 +53,12 @@ var SepoliaBootnodes = []string{
4753
"enode://9e9492e2e8836114cc75f5b929784f4f46c324ad01daf87d956f98b3b6c5fcba95524d6e5cf9861dc96a2c8a171ea7105bb554a197455058de185fa870970c7c@138.68.123.152:30303", // sepolia-bootnode-1-ams3
4854
}
4955

56+
var OPSepoliaBootnodes = []string{
57+
"enode://2bd2e657bb3c8efffb8ff6db9071d9eb7be70d7c6d7d980ff80fc93b2629675c5f750bc0a5ef27cd788c2e491b8795a7e9a4a6e72178c14acc6753c0e5d77ae4@34.65.205.244?discport=30305",
58+
"enode://db8e1cab24624cc62fc35dbb9e481b88a9ef0116114cd6e41034c55b5b4f18755983819252333509bd8e25f6b12aadd6465710cd2e956558faf17672cce7551f@34.65.173.88?discport=30305",
59+
"enode://bfda2e0110cfd0f4c9f7aa5bf5ec66e6bd18f71a2db028d36b8bf8b0d6fdb03125c1606a6017b31311d96a36f5ef7e1ad11604d7a166745e6075a715dfa67f8a@34.65.229.245?discport=30305",
60+
}
61+
5062
// GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the
5163
// Görli test network.
5264
var GoerliBootnodes = []string{

0 commit comments

Comments
 (0)