hypercore 0.5.0

Secure, distributed, append-only log
Documentation

hypercore

crates.io version build status downloads docs.rs docs

WIP. Secure, distributed, append-only log structure. Adapted from mafintosh/hypercore.

Usage

extern crate hypercore;

use hypercore::Feed;
use std::path::PathBuf;

let path = PathBuf::from("./my-first-dataset");
let mut feed = Feed::new(&path).unwrap();

feed.append(b"hello").unwrap();
feed.append(b"world").unwrap();

println!("{:?}", feed.get(0)); // prints "hello"
println!("{:?}", feed.get(1)); // prints "world"

Networking Vaporware API

let feed = Feed::default();

feed.append(b"data")?;

for event in feed {
  match event {
    Event::Data(data) => {},
    Event::PeerAdd => {},
    Event::PeerRemove => {},
    Event::Download => {},
    Event::Synchronize => {},
    Event::Append => {},
  }
}

Data Structures

  • feed: The main data structure in Hypercore. Append-only log that uses multiple data structures and algorithms to safely store data.
  • data: Data that's written to the feed by users.
  • key pair: An Ed25519 key pair used to encrypt data with.
  • signature: A cryptographic certificate of authenticity for a given piece of code.
  • tree: A binary tree mapped as a flat-tree to keep an index of the current data.
  • bitfield: ???

Installation

$ cargo add hypercore

License

MIT OR Apache-2.0