Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ validator_pubkeys = [
# - SSV: SSV API
# OPTIONAL
loader = "./tests/data/mux_keys.example.json"
# URL to HTTP endpoint returning JSON list of validator pubkeys
# Example response:
# [
# "0x80c7f782b2467c5898c5516a8b6595d75623960b4afc4f71ee07d40985d20e117ba35e7cd352a3e75fb85a8668a3b745",
# "0xa119589bb33ef52acbb8116832bec2b58fca590fe5c85eac5d3230b44d5bc09fe73ccd21f88eab31d6de16194d17782e"
#]
# loader = { url = "http://localhost:8000/keys" }
# loader = { registry = "lido", node_operator_id = 8 }
# loader = { registry = "ssv", node_operator_id = 8 }
timeout_get_header_ms = 900
Expand Down
12 changes: 12 additions & 0 deletions crates/common/src/config/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ impl MuxConfig {

Some((get_mux_env(&self.id), path.to_owned(), internal_path))
}
MuxKeysLoader::HTTP { .. } => None,
MuxKeysLoader::Registry { .. } => None,
})
}
Expand All @@ -139,6 +140,9 @@ impl MuxConfig {
pub enum MuxKeysLoader {
/// A file containing a list of validator pubkeys
File(PathBuf),
HTTP {
url: String,
},
Registry {
registry: NORegistry,
node_operator_id: u64,
Expand Down Expand Up @@ -170,6 +174,14 @@ impl MuxKeysLoader {
serde_json::from_str(&file).wrap_err("failed to parse mux keys file")
}

Self::HTTP { url } => {
let client = reqwest::Client::new();
let response = client.get(url).send().await?;
let pubkeys = response.text().await?;
serde_json::from_str(&pubkeys)
.wrap_err("failed to fetch mux keys from http endpoint")
}

Self::Registry { registry, node_operator_id } => match registry {
NORegistry::Lido => {
let Some(rpc_url) = rpc_url else {
Expand Down