Hypercore
Hypercore is a secure, distributed append-only log. This crate is a limited Rust port of the original Javascript holepunchto/hypercore. The goal is to maintain binary compatibility with the LTS version with regards to disk storage.
See hypercore-protocol-rs for the corresponding wire protocol implementation.
Features
- Create in-memory and disk hypercores
- Append to hypercore either a single entry or a batch of entries
- Get entries from hypercore
- Clear range from hypercore, with optional support for sparse files
- Support basic replication by creating proofs in a source hypercore and verifying and applying them to a destination hypercore
- Support
tokio
orasync-std
runtimes - Support WASM for in-memory storage
- Test Javascript interoperability for supported features
- Add optional read cache
- Support the new manifest in the wire protocol to remain compatible with upcoming v11
- Finalize documentation and release v1.0.0
Usage
// Create an in-memory hypercore using a builder
let mut hypercore = new
.build
.await
.unwrap;
// Append entries to the log
hypercore.append.await.unwrap;
hypercore.append.await.unwrap;
// Read entries from the log
assert_eq!;
assert_eq!;
Find more examples in the examples folder, and/or run:
Installation
Safety
This crate uses #![forbid(unsafe_code)]
to ensure everythong is implemented in
100% Safe Rust.
Development
To test interoperability with Javascript, enable the js_interop_tests
feature:
Run benches with:
Contributing
Want to join us? Check out our "Contributing" guide and take a look at some of these issues:
License
MIT OR Apache-2.0