Skip to content

Commit

Permalink
updated README for the project (#2)
Browse files Browse the repository at this point in the history
- canonicalised dependencies
  • Loading branch information
CluEleSsUK authored Sep 11, 2023
1 parent 32831d3 commit 9f7027b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ name = "drand-client-rs"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hex = { version = "0.4.3", features = ["serde"] }
sha2 = "0.9"
bls12_381 = { version = "0.8.0", features = ["experimental"] }
thiserror = "1.0.38"
hex = { version = "0.4.3", features = ["serde"] }
reqwest = { version = "0.11.20", features = ["blocking", "json"] }
serde = { version = "1.0.187", features = ["derive"] }
serde_json = "1.0.105"
reqwest = { version = "0.11.20", features = ["blocking", "json"] }
sha2 = "0.9" # this can't be upgraded for compat with bls12_381 it seems :<
thiserror = "1.0.38"
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,41 @@

A simple drand client implementation written in rust

## Features
- HTTP transport
- `pedersen-bls-chained` scheme
- `pedersen-bls-unchained` scheme
- `bls-unchained-on-g1` scheme
- `bls-unchained-on-g1-rfc9380` scheme

## Example usage

```rust
use drand_client_rs::{new_http_client, DrandClientError};

fn main() -> Result<(), DrandClientError> {
// first create the client using one of the relays as a `base_url`
let drand_client = new_http_client("https://api.drand.sh")?;

// you can fetch the latest random value using `latest_randomness`
if let Ok(beacon) = drand_client.latest_randomness() {
println!("the latest round is {}", beacon.round_number);
println!("the latest randomness is {:?}", beacon.randomness);
}

// or a specific round using `randomness`
if let Ok(beacon) = drand_client.randomness(1) {
println!("the selected round is {}", beacon.round_number);
println!("the latest randomness is {:?}", beacon.randomness);
}

Ok(())
}

```


## Roadmap
- [x] http transport
- [x] json parser
- [x] chained scheme
- [x] unchained scheme
- [ ] unchained scheme with G1 and G2 swapped
- [ ] protobuf parser
- [ ] libp2p transport
- [ ] nicer error messages
- [ ] comprehensive testing
- [ ] rustdoc
- [x] github actions for testing
- [ ] examples
- [ ] wasm-specific target
- [ ] libp2p transport

0 comments on commit 9f7027b

Please sign in to comment.