File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ validator_pubkeys = [
120
120
# - SSV: SSV API
121
121
# OPTIONAL
122
122
loader = " ./tests/data/mux_keys.example.json"
123
+ # URL to HTTP endpoint returning JSON list of validator pubkeys
124
+ # Example response:
125
+ # [
126
+ # "0x80c7f782b2467c5898c5516a8b6595d75623960b4afc4f71ee07d40985d20e117ba35e7cd352a3e75fb85a8668a3b745",
127
+ # "0xa119589bb33ef52acbb8116832bec2b58fca590fe5c85eac5d3230b44d5bc09fe73ccd21f88eab31d6de16194d17782e"
128
+ # ]
129
+ # loader = { url = "http://localhost:8000/keys" }
123
130
# loader = { registry = "lido", node_operator_id = 8 }
124
131
# loader = { registry = "ssv", node_operator_id = 8 }
125
132
timeout_get_header_ms = 900
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ impl MuxConfig {
129
129
130
130
Some ( ( get_mux_env ( & self . id ) , path. to_owned ( ) , internal_path) )
131
131
}
132
+ MuxKeysLoader :: HTTP { .. } => None ,
132
133
MuxKeysLoader :: Registry { .. } => None ,
133
134
} )
134
135
}
@@ -139,6 +140,9 @@ impl MuxConfig {
139
140
pub enum MuxKeysLoader {
140
141
/// A file containing a list of validator pubkeys
141
142
File ( PathBuf ) ,
143
+ HTTP {
144
+ url : String ,
145
+ } ,
142
146
Registry {
143
147
registry : NORegistry ,
144
148
node_operator_id : u64 ,
@@ -170,6 +174,14 @@ impl MuxKeysLoader {
170
174
serde_json:: from_str ( & file) . wrap_err ( "failed to parse mux keys file" )
171
175
}
172
176
177
+ Self :: HTTP { url } => {
178
+ let client = reqwest:: Client :: new ( ) ;
179
+ let response = client. get ( url) . send ( ) . await ?;
180
+ let pubkeys = response. text ( ) . await ?;
181
+ serde_json:: from_str ( & pubkeys)
182
+ . wrap_err ( "failed to fetch mux keys from http endpoint" )
183
+ }
184
+
173
185
Self :: Registry { registry, node_operator_id } => match registry {
174
186
NORegistry :: Lido => {
175
187
let Some ( rpc_url) = rpc_url else {
You can’t perform that action at this time.
0 commit comments