Add member directory and aggregates, cut citation economics from spec (Draft 0.4)

This commit is contained in:
George Coles
2026-09-15 03:56:11 -04:00
parent 82a95fb907
commit fb45cfa8cf
13 changed files with 890 additions and 79 deletions
+44 -1
View File
@@ -11,7 +11,7 @@ use frxd::{commands, node, relay};
#[command(
name = "frxd",
version,
about = "FRX member node — querier, responder, and local index (Draft 0.3)"
about = "FRX member node — querier, responder, and local index (Draft 0.4)"
)]
struct Cli {
#[arg(long, global = true, default_value = "frxd.toml")]
@@ -66,6 +66,32 @@ enum Command {
capacity: usize,
},
Status,
Member {
#[command(subcommand)]
command: MemberCommand,
},
Aggregates {
#[arg(long)]
from: Option<String>,
#[arg(long)]
period: Option<String>,
#[arg(long)]
timeout_ms: Option<u64>,
},
}
#[derive(Subcommand)]
enum MemberCommand {
Add {
name: String,
pubkey: String,
#[arg(long, default_value = "source")]
class: String,
},
Remove {
name: String,
},
List,
}
#[derive(Clone, Copy, ValueEnum)]
@@ -136,6 +162,23 @@ async fn main() -> Result<()> {
relay::run(listener, capacity).await?;
}
Command::Status => commands::status(&cli.config).await?,
Command::Member { command } => match command {
MemberCommand::Add {
name,
pubkey,
class,
} => commands::member_add(&cli.config, &name, &pubkey, &class)?,
MemberCommand::Remove { name } => commands::member_remove(&cli.config, &name)?,
MemberCommand::List => commands::member_list(&cli.config)?,
},
Command::Aggregates {
from,
period,
timeout_ms,
} => {
commands::aggregates(&cli.config, from.as_deref(), period.as_deref(), timeout_ms)
.await?
}
}
Ok(())
}