Skip to content

Commit

Permalink
Rename leader to driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jimouris committed Dec 18, 2023
1 parent 14e897d commit 2f63a4e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ name = "server"
path = "src/bin/server.rs"

[[bin]]
name = "leader"
path = "src/bin/leader.rs"
name = "driver"
path = "src/bin/driver.rs"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Page](https://datatracker.ietf.org/doc/draft-mouris-cfrg-mastic/).


## Building

Please note that this repository relies on `x86_64` specific instructions in [prg.rs](src/prg.rs).
First, make sure that you have a working Rust installation:
```bash
❯❯ rustc --version
Expand Down Expand Up @@ -39,14 +41,14 @@ Now, the servers should be ready to process client requests.
#### Clients:
In another shell, run the following command to send 100 client requests to the servers.
```bash
cargo run --release --bin leader -- --config src/bin/config.json -n 100
cargo run --release --bin driver -- --config src/bin/config.json -n 100
```

To run with the presence of malicious clients include the `--malicious` flag followed by the
percentage of malicious clients to generate ([0.0, 0.9]). For instance, to run with 5% malicious
clients use:
```bash
cargo run --release --bin leader -- --config src/bin/config.json -n 100 --malicious 0.05
cargo run --release --bin driver -- --config src/bin/config.json -n 100 --malicious 0.05
```


Expand Down
2 changes: 1 addition & 1 deletion src/bin/leader.rs → src/bin/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async fn run_level_last(

#[tokio::main]
async fn main() -> io::Result<()> {
let (cfg, _, num_clients, malicious) = config::get_args("Leader", false, true, true);
let (cfg, _, num_clients, malicious) = config::get_args("Driver", false, true, true);
assert!((0.0..0.8).contains(&malicious));
println!("Running with {}% malicious clients", malicious * 100.0);
let client_0 = Client::new(
Expand Down
21 changes: 12 additions & 9 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ pub fn get_args(
get_n_reqs: bool,
get_malicious: bool,
) -> (Config, i8, usize, f32) {
let mut flags = App::new(name).version("0.1").about("Mastic.").arg(
Arg::with_name("config")
.short("c")
.long("config")
.value_name("FILENAME")
.help("Location of JSON config file")
.required(true)
.takes_value(true),
);
let mut flags = App::new(name)
.version("0.1")
.about("Mastic: Private Aggregated Statistics through Fully Linear Proofs")
.arg(
Arg::with_name("config")
.short("c")
.long("config")
.value_name("FILENAME")
.help("Location of JSON config file")
.required(true)
.takes_value(true),
);
if get_server_id {
flags = flags.arg(
Arg::with_name("server_id")
Expand Down

0 comments on commit 2f63a4e

Please sign in to comment.