Crates.io | gnostr-core |
lib.rs | gnostr-core |
version | 0.4.2-alpha.1 |
source | src |
created_at | 2024-04-30 17:36:32.311354 |
updated_at | 2024-04-30 17:36:32.311354 |
description | Replication protocol for Hypercore feeds |
homepage | |
repository | https://github.com/gnostr-org/gnostr-core |
max_upload_size | |
id | 1225318 |
size | 331,390 |
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