Crates.io | hypercore-protocol |
lib.rs | hypercore-protocol |
version | 0.5.0 |
source | src |
created_at | 2020-06-01 16:19:37.584113 |
updated_at | 2024-07-05 04:40:32.559299 |
description | Replication protocol for Hypercore feeds |
homepage | |
repository | https://github.com/datrs/hypercore-protocol-rs |
max_upload_size | |
id | 248725 |
size | 307,205 |
Hypercore protocol is a streaming, message based protocol. This is a Rust port of the wire protocol implementation in the original Javascript version. This crate targets the Hypercore LTS version 10.
This crate provides a low-level streaming API to hypercore-protocol and exposes an interface that should make it easy to implement actual protocol logic on top.
This crate uses either async-std or tokio for async IO, snow for the Noise handshake and RustCrypto's crypto_secretsteram for encryption.
crypto_secretstream
.async-std
or tokio
runtimescargo add hypercore-protocol
These examples sync data between Rust and NodeJS hypercore-protocol implementations. To prepare, run
cd examples-nodejs && npm install && cd ..
Runs the replication.rs
example by replicating a hypercore between Rust and Node hypercores and printing the result.
node examples-nodejs/run.js nodeServer
node examples-nodejs/run.js rustServer
node examples-nodejs/run.js rust
node examples-nodejs/run.js node
To test interoperability with Javascript, enable the js_interop_tests
feature:
cargo test --features js_interop_tests
Run benches with:
cargo bench
We're actively looking for contributors to the datrust development! If you're interested, the
easiest is to say hi in the #rust
channel on the
Hypercore Protocol Discord.
Want to help with Hypercore Protocol? Check out our "Contributing" guide and take a look at the open issues.
MIT OR Apache-2.0