Skip to content

Commit

Permalink
frostd: rename from 'server' (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
conradoplg authored Dec 27, 2024
1 parent 1b1dada commit 54537ba
Show file tree
Hide file tree
Showing 22 changed files with 140 additions and 158 deletions.
86 changes: 43 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ members = [
"dkg",
"coordinator",
"tests",
"server", "frost-client",
"frostd",
"frost-client",
# "zcash-sign",
]
# TODO: go back to the workspace. It currently can't because it has a dependency
Expand All @@ -18,6 +19,6 @@ default-members = [
"dkg",
"coordinator",
"tests",
"server"
"frostd"
]
resolver = "2"
2 changes: 1 addition & 1 deletion coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ itertools = "0.13.0"
exitcode = "1.1.2"
clap = { version = "4.5.23", features = ["derive"] }
reqwest = { version = "0.12.9", features = ["json"] }
server = { path = "../server" }
frostd = { path = "../frostd" }
participant = { path = "../participant" }
tokio = { version = "1", features = ["full"] }
message-io = "0.18"
Expand Down
32 changes: 16 additions & 16 deletions coordinator/src/comms/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use frost_core::{
Identifier, SigningPackage,
};

use participant::comms::http::Noise;
use rand::thread_rng;
use server::{
use frostd::{
Msg, PublicKey, SendCommitmentsArgs, SendSignatureSharesArgs, SendSigningPackageArgs, Uuid,
};
use participant::comms::http::Noise;
use rand::thread_rng;
use xeddsa::{xed25519, Sign as _};

use super::Comms;
Expand Down Expand Up @@ -344,10 +344,10 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
let challenge = self
.client
.post(format!("{}/challenge", self.host_port))
.json(&server::ChallengeArgs {})
.json(&frostd::ChallengeArgs {})
.send()
.await?
.json::<server::ChallengeOutput>()
.json::<frostd::ChallengeOutput>()
.await?
.challenge;

Expand All @@ -365,7 +365,7 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
self.access_token = Some(
self.client
.post(format!("{}/login", self.host_port))
.json(&server::KeyLoginArgs {
.json(&frostd::KeyLoginArgs {
challenge,
pubkey: self
.args
Expand All @@ -376,7 +376,7 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
})
.send()
.await?
.json::<server::LoginOutput>()
.json::<frostd::LoginOutput>()
.await?
.access_token
.to_string(),
Expand All @@ -386,13 +386,13 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
.client
.post(format!("{}/create_new_session", self.host_port))
.bearer_auth(self.access_token.as_ref().expect("was just set"))
.json(&server::CreateNewSessionArgs {
.json(&frostd::CreateNewSessionArgs {
pubkeys: self.args.signers.iter().cloned().map(PublicKey).collect(),
message_count: 1,
})
.send()
.await?
.json::<server::CreateNewSessionOutput>()
.json::<frostd::CreateNewSessionOutput>()
.await?;

if self.args.signers.is_empty() {
Expand Down Expand Up @@ -453,13 +453,13 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
.client
.post(format!("{}/receive", self.host_port))
.bearer_auth(self.access_token.as_ref().expect("was just set"))
.json(&server::ReceiveArgs {
.json(&frostd::ReceiveArgs {
session_id: r.session_id,
as_coordinator: true,
})
.send()
.await?
.json::<server::ReceiveOutput>()
.json::<frostd::ReceiveOutput>()
.await?;
for msg in r.msgs {
let msg = self.decrypt(msg)?;
Expand Down Expand Up @@ -507,9 +507,9 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
.as_ref()
.expect("must have been set before"),
)
.json(&server::SendArgs {
.json(&frostd::SendArgs {
session_id: self.session_id.unwrap(),
recipients: vec![server::PublicKey(recipient.clone())],
recipients: vec![frostd::PublicKey(recipient.clone())],
msg,
})
.send()
Expand All @@ -529,13 +529,13 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
.as_ref()
.expect("must have been set before"),
)
.json(&server::ReceiveArgs {
.json(&frostd::ReceiveArgs {
session_id: self.session_id.unwrap(),
as_coordinator: true,
})
.send()
.await?
.json::<server::ReceiveOutput>()
.json::<frostd::ReceiveOutput>()
.await?;
for msg in r.msgs {
let msg = self.decrypt(msg)?;
Expand All @@ -557,7 +557,7 @@ impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
.as_ref()
.expect("must have been set before"),
)
.json(&server::CloseSessionArgs {
.json(&frostd::CloseSessionArgs {
session_id: self.session_id.unwrap(),
})
.send()
Expand Down
2 changes: 1 addition & 1 deletion frost-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ reqwest = { version = "0.12.9", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
snow = "0.9.6"
toml = "0.8.19"
server = { path = "../server" }
frostd = { path = "../frostd" }
trusted-dealer = { path = "../trusted-dealer" }
coordinator = { path = "../coordinator" }
participant = { path = "../participant" }
Expand Down
14 changes: 7 additions & 7 deletions frost-client/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ pub(crate) async fn list(args: &Command) -> Result<(), Box<dyn Error>> {

let challenge = client
.post(format!("{}/challenge", host_port))
.json(&server::ChallengeArgs {})
.json(&frostd::ChallengeArgs {})
.send()
.await?
.json::<server::ChallengeOutput>()
.json::<frostd::ChallengeOutput>()
.await?
.challenge;

Expand All @@ -65,14 +65,14 @@ pub(crate) async fn list(args: &Command) -> Result<(), Box<dyn Error>> {

let access_token = client
.post(format!("{}/login", host_port))
.json(&server::KeyLoginArgs {
.json(&frostd::KeyLoginArgs {
challenge,
pubkey: comm_pubkey.clone(),
signature: signature.to_vec(),
})
.send()
.await?
.json::<server::LoginOutput>()
.json::<frostd::LoginOutput>()
.await?
.access_token
.to_string();
Expand All @@ -83,7 +83,7 @@ pub(crate) async fn list(args: &Command) -> Result<(), Box<dyn Error>> {
.bearer_auth(&access_token)
.send()
.await?
.json::<server::ListSessionsOutput>()
.json::<frostd::ListSessionsOutput>()
.await?;

if r.session_ids.is_empty() {
Expand All @@ -93,10 +93,10 @@ pub(crate) async fn list(args: &Command) -> Result<(), Box<dyn Error>> {
let r = client
.post(format!("{}/get_session_info", host_port))
.bearer_auth(&access_token)
.json(&server::GetSessionInfoArgs { session_id })
.json(&frostd::GetSessionInfoArgs { session_id })
.send()
.await?
.json::<server::GetSessionInfoOutput>()
.json::<frostd::GetSessionInfoOutput>()
.await?;
let coordinator = config.contact_by_pubkey(&r.coordinator_pubkey);
let participants: Vec<_> = r
Expand Down
2 changes: 1 addition & 1 deletion server/Cargo.toml → frostd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "server"
name = "frostd"
version = "0.1.0"
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions server/README.md → frostd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ You will need to have [Rust and Cargo](https://doc.rust-lang.org/cargo/getting-s
To compile and run:

1. Clone the repo. Run `git clone https://github.com/ZcashFoundation/frost-zcash-demo.git`
2. Run `cargo build --release --bin server`
3. Run `./target/release/server -h` to learn about the command line arguments.
2. Run `cargo build --release --bin frostd`
3. Run `./target/release/frostd -h` to learn about the command line arguments.

You will need to specify a TLS certificate and key with the `--tls-cert`
and `--tls-key` arguments.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions server/src/main.rs → frostd/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::Parser;
use server::args::Args;
use server::run;
use frostd::args::Args;
use frostd::run;
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 54537ba

Please sign in to comment.