[][src]Crate hypercore

Introduction

Hypercore is a secure, distributed append-only log. Built for sharing large datasets and streams of real time data as part of the Dat project. This is a rust port of the original node version aiming for interoperability. The primary way to use this crate is through the Feed struct.

Example

let mut feed = hypercore::open("./feed.db").await?;

feed.append(b"hello").await?;
feed.append(b"world").await?;

assert_eq!(feed.get(0).await?, Some(b"hello".to_vec()));
assert_eq!(feed.get(1).await?, Some(b"world".to_vec()));

Modules

bitfield

Bitfield module. Exposes {data, tree, index} internally. Serializable to disk.

prelude

Convenience wrapper to import all of Hypercore's core.

Structs

Feed

Append-only log structure.

FeedBuilder

Construct a new Feed instance.

Node

Nodes that are persisted to disk.

Peer

A peer on the network.

Proof

A merkle proof for an index, created by the .proof() method.

PublicKey

An ed25519 public key.

SecretKey

An EdDSA secret key.

Signature

An ed25519 signature.

Storage

Save data to a desired storage backend.

Enums

Event

Events emitted.

Store

The types of stores that can be created.

Traits

NodeTrait

Functions that need to be implemented for the Data that MerkleTreeStream works with.

Functions

generate_keypair

Generate a new Ed25519 key pair.

open

Create a new Hypercore Feed.

sign

Sign a byte slice using a keypair's private key.

verify

Verify a signature on a message with a keypair's public key.