Federated relay tier: peer flooding, per-member isolation, registry admission and relay discovery
This commit is contained in:
@@ -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(®istry_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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user