207 releases

new 0.7.46 Jan 8, 2025
0.7.45 Dec 11, 2024
0.7.43 Nov 21, 2024
0.7.28 Jul 30, 2024
0.1.4 Jul 26, 2022

#1458 in Network programming

Download history 284/week @ 2024-09-20 227/week @ 2024-09-27 359/week @ 2024-10-04 227/week @ 2024-10-11 359/week @ 2024-10-18 295/week @ 2024-10-25 335/week @ 2024-11-01 319/week @ 2024-11-08 218/week @ 2024-11-15 119/week @ 2024-11-22 357/week @ 2024-11-29 539/week @ 2024-12-06 161/week @ 2024-12-13 74/week @ 2024-12-20 30/week @ 2024-12-27 54/week @ 2025-01-03

510 downloads per month
Used in divviup-cli

MPL-2.0 license

425KB
10K SLoC

janus_client

Build Status latest version docs badge

janus_client is a self-contained implementation of the Distributed Aggregation Protocol's client role. It is intended for use with Janus and Divvi Up, ISRG's privacy-respecting metrics service. janus_client is published to crates.io by a GitHub Action that runs when a janus release is created.


lib.rs:

A DAP client

This library implements the client role of the DAP-PPM protocol. It uploads measurements to two DAP aggregator servers which in turn compute a statistical aggregate over data from many clients, while preserving the privacy of each client's data.

Examples

use url::Url;
use prio::vdaf::prio3::Prio3Histogram;
use janus_messages::{Duration, TaskId};
use std::str::FromStr;

#[tokio::main]
async fn main() {
    let leader_url = Url::parse("https://leader.example.com/").unwrap();
    let helper_url = Url::parse("https://helper.example.com/").unwrap();
    let vdaf = Prio3Histogram::new_histogram(
        2,
        12,
        4
    ).unwrap();
    let taskid = "rc0jgm1MHH6Q7fcI4ZdNUxas9DAYLcJFK5CL7xUl-gU";
    let task = TaskId::from_str(taskid).unwrap();

    let client = janus_client::Client::new(
        task,
        leader_url,
        helper_url,
        Duration::from_seconds(300),
        vdaf
    )
    .await
    .unwrap();
    client.upload(&5).await.unwrap();
}

Dependencies

~38–53MB
~1M SLoC