Federated relay tier: peer flooding, per-member isolation, registry admission and relay discovery

This commit is contained in:
George Coles
2026-09-15 06:49:43 -04:00
parent d30e612be8
commit 2c97fd523f
11 changed files with 759 additions and 177 deletions
+13
View File
@@ -277,6 +277,7 @@ pub fn registry_init(dir: &Path) -> Result<()> {
issued_at: now_ts(),
ma_key: String::new(),
members: Vec::new(),
relays: Vec::new(),
};
let signed = registry::sign_registry(doc, &ma);
registry::save_registry(&registry_path, &signed)?;
@@ -390,11 +391,23 @@ pub fn registry_list(dir: &Path) -> Result<()> {
Ok(())
}
pub fn registry_set_relays(dir: &Path, relays: &[String]) -> Result<()> {
mutate_registry(dir, |doc| {
doc.relays = relays.to_vec();
Ok(())
})?;
println!("relays: {}", relays.join(" "));
Ok(())
}
pub fn registry_show(dir: &Path) -> Result<()> {
let (_, signed) = open_registry(dir)?;
println!("ma_key {}", signed.doc.ma_key);
println!("version {}", signed.doc.version);
println!("issued_at {}", signed.doc.issued_at);
for relay in &signed.doc.relays {
println!("relay {relay}");
}
Ok(())
}