Skip to content

cowlicks/replicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypercore Replicator

⚠️ WARNING 🚧 API unstable ⚒️ and still in development 👷

This repo defines a Replicator trait for use with Hypercore. It implements the same functionality as this JavaScript Hypercore replication code.

Usage (aspirational):

// import the trait
use replicator::Replicate;

// Get a hypercore
let hypercore = HypercoreBuilder::new(Storage::new_memory().await.unwrap())
    .build()
    .await
    .unwrap();

// Get a AsyncRead + AsyncWrite stream to another hypercore
let listener = TcpListener::bind(&address).await?;

// the `true` indicates this hypercore is the initiator
hypercore.replicate(stream, true))

About

Replicator for hypercores

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published