-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtypes.go
172 lines (151 loc) · 5.38 KB
/
types.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
This work is licensed and released under GNU GPL v3 or any other later versions.
The full text of the license is below/ found at <http://www.gnu.org/licenses/>
(c) 2023 Rocket Pool Pty Ltd. Modified under GNU GPL v3. [1.5.0]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package config
type ContainerID string
type Network string
type Mode string
type ParameterType string
type ExecutionClient string
type ConsensusClient string
type RewardsMode string
type MevRelayID string
type MevSelectionMode string
type NimbusPruningMode string
// Enum to describe which container(s) a parameter impacts, so the Stadernode knows which
// ones to restart upon a settings change
//
//revive:disable
const (
ContainerID_Unknown ContainerID = ""
ContainerID_Api ContainerID = "api"
ContainerID_Node ContainerID = "node"
ContainerID_Guardian ContainerID = "guardian"
ContainerID_Eth1 ContainerID = "eth1"
ContainerID_Eth2 ContainerID = "eth2"
ContainerID_Validator ContainerID = "validator"
ContainerID_Grafana ContainerID = "grafana"
ContainerID_Prometheus ContainerID = "prometheus"
ContainerID_Exporter ContainerID = "exporter"
ContainerID_MevBoost ContainerID = "mev-boost"
)
// Enum to describe which network the system is on
const (
Network_Unknown Network = ""
Network_All Network = "all"
Network_Mainnet Network = "mainnet"
Network_Holesky Network = "holesky"
)
// Enum to describe the mode for a client - local (Docker Mode) or external (Hybrid Mode)
const (
Mode_Unknown Mode = ""
Mode_Local Mode = "local"
Mode_External Mode = "external"
)
// Enum to describe which data type a parameter's value will have, which
// informs the corresponding UI element and value validation
const (
ParameterType_Unknown ParameterType = ""
ParameterType_Int ParameterType = "int"
ParameterType_Uint16 ParameterType = "uint16"
ParameterType_Uint ParameterType = "uint"
ParameterType_String ParameterType = "string"
ParameterType_Bool ParameterType = "bool"
ParameterType_Choice ParameterType = "choice"
ParameterType_Float ParameterType = "float"
)
// Enum to describe the Execution client options
const (
ExecutionClient_Unknown ExecutionClient = ""
ExecutionClient_Geth ExecutionClient = "geth"
ExecutionClient_Nethermind ExecutionClient = "nethermind"
ExecutionClient_Besu ExecutionClient = "besu"
ExecutionClient_Obs_Infura ExecutionClient = "infura"
ExecutionClient_Obs_Pocket ExecutionClient = "pocket"
)
// Enum to describe the Consensus client options
const (
ConsensusClient_Unknown ConsensusClient = ""
ConsensusClient_Lighthouse ConsensusClient = "lighthouse"
ConsensusClient_Nimbus ConsensusClient = "nimbus"
ConsensusClient_Prysm ConsensusClient = "prysm"
ConsensusClient_Teku ConsensusClient = "teku"
ConsensusClient_Lodestar ConsensusClient = "lodestar"
)
// Enum to describe the rewards tree acquisition modes
const (
RewardsMode_Unknown RewardsMode = ""
RewardsMode_Download RewardsMode = "download"
RewardsMode_Generate RewardsMode = "generate"
)
// Enum to identify MEV-boost relays
const (
MevRelayID_Unknown MevRelayID = ""
MevRelayID_Flashbots MevRelayID = "flashbots"
MevRelayID_BloxrouteMaxProfit MevRelayID = "bloxrouteMaxProfit"
MevRelayID_BloxrouteRegulated MevRelayID = "bloxrouteRegulated"
MevRelayID_Eden MevRelayID = "eden"
MevRelayID_Ultrasound MevRelayID = "ultrasound"
MevRelayID_Aestus MevRelayID = "aestus"
MevRelayID_Agnostic MevRelayID = "agnostic"
MevRelayID_TitanRegulated MevRelayID = "titanRegulated"
MevRelayID_TitanUnRegulated MevRelayID = "titanUnRegulated"
)
// Enum to describe MEV-Boost relay selection mode
//
//revive:enable
const (
MevSelectionMode_Unknow MevSelectionMode = ""
MevSelectionMode_Profile MevSelectionMode = "profile"
MevSelectionMode_Relay MevSelectionMode = "relay"
)
// Enum to describe Nimbus pruning modes
const (
NimbusPruningMode_Archive NimbusPruningMode = "archive"
NimbusPruningMode_Prune NimbusPruningMode = "prune"
)
type Config interface {
GetConfigTitle() string
GetParameters() []*Parameter
}
// Interface for common Consensus configurations
type ConsensusConfig interface {
GetValidatorImage() string
GetName() string
}
// Interface for Local Consensus configurations
type LocalConsensusConfig interface {
GetUnsupportedCommonParams() []string
}
// Interface for External Consensus configurations
type ExternalConsensusConfig interface {
GetApiUrl() string
}
// A setting that has changed
type ChangedSetting struct {
Name string
OldValue string
NewValue string
AffectedContainers map[ContainerID]bool
}
// A MEV relay
type MevRelay struct {
ID MevRelayID
Name string
Description string
Urls map[Network]string
Regulated bool
NoSandwiching bool
}