-
Notifications
You must be signed in to change notification settings - Fork 244
/
cluster.go
89 lines (79 loc) · 4.66 KB
/
cluster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package params
// Define available fleets.
const (
FleetUndefined = ""
FleetProd = "eth.prod"
FleetShardsStaging = "shards.staging"
FleetShardsTest = "shards.test"
FleetStatusProd = "status.prod"
FleetStatusTest = "status.test"
FleetWakuSandbox = "waku.sandbox"
FleetWakuTest = "waku.test"
)
// Cluster defines a list of Ethereum nodes.
type Cluster struct {
StaticNodes []string `json:"staticnodes"`
BootNodes []string `json:"bootnodes"`
MailServers []string `json:"mailservers"` // list of trusted mail servers
RendezvousNodes []string `json:"rendezvousnodes"`
}
type FleetName = string
type NodeType = string
const (
WakuNodes NodeType = "WakuNodes"
DiscV5BootstrapNodes NodeType = "DiscV5BootstrapNodes"
)
// DefaultWakuNodes is a list of "supported" fleets. This list is populated to clients UI settings.
var supportedFleets = map[FleetName]map[NodeType][]string{
FleetShardsStaging: {
WakuNodes: {
"enrtree://AI4W5N5IFEUIHF5LESUAOSMV6TKWF2MB6GU2YK7PU4TYUGUNOCEPW@boot.staging.shards.nodes.status.im",
},
DiscV5BootstrapNodes: {
"enrtree://AI4W5N5IFEUIHF5LESUAOSMV6TKWF2MB6GU2YK7PU4TYUGUNOCEPW@boot.staging.shards.nodes.status.im",
"enr:-QEQuEDsh6FgAb_36cReaX7W4gWx_7_GNpsUki7bXMoMrrrWij5pDEyV3guR-urDW_6GJTAzpQiJV61F-CfNn_NxPbY-AYJpZIJ2NIJpcISPxvrpim11bHRpYWRkcnO4YAAtNihib290LTAxLmRvLWFtczMuc2hhcmRzLnN0YWdpbmcuc3RhdHVzLmltBnZfAC82KGJv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3QtMDEuYWMtY24taG9uZ2tvbmctYy5zaGFyZHMudGVzdC5zdGF0dXMuaW0GAbveA4Jyc40AEAUAAQAgAEAAgAEAiXNlY3AyNTZrMaEDP7CbRk-YKJwOFFM4Z9ney0GPc7WPJaCwGkpNRyla7mCDdGNwgnZfg3VkcIIjKIV3YWt1Mg0",
},
},
FleetWakuSandbox: {
WakuNodes: {
"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",
},
DiscV5BootstrapNodes: {
"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",
},
},
FleetWakuTest: {
WakuNodes: {
"enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im",
},
DiscV5BootstrapNodes: {
"enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im",
},
},
}
func DefaultWakuNodes(fleet string) []string {
return supportedFleets[fleet][WakuNodes]
}
func DefaultDiscV5Nodes(fleet string) []string {
return supportedFleets[fleet][DiscV5BootstrapNodes]
}
func IsFleetSupported(fleet string) bool {
_, ok := supportedFleets[fleet]
return ok
}
func GetSupportedFleets() map[FleetName]map[NodeType][]string {
return supportedFleets
}