#client #janus #protocols #distributed #aggregation #up #dap

janus_client

Client for Janus, the server powering ISRG's Divvi Up

157 releases

new 0.7.10 May 14, 2024
0.7.6 Apr 25, 2024
0.7.1 Mar 21, 2024
0.6.7 Dec 14, 2023
0.1.4 Jul 26, 2022

#73 in HTTP client

Download history 6/week @ 2024-01-22 18/week @ 2024-02-05 123/week @ 2024-02-12 271/week @ 2024-02-19 547/week @ 2024-02-26 331/week @ 2024-03-04 324/week @ 2024-03-11 542/week @ 2024-03-18 419/week @ 2024-04-01 576/week @ 2024-04-08 295/week @ 2024-04-15 291/week @ 2024-04-22 388/week @ 2024-04-29 386/week @ 2024-05-06

1,378 downloads per month

MPL-2.0 license

395KB
9K 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–52MB
~1M SLoC