braid_rs 0.1.0

Unified Braid Protocol implementation in Rust, including Braid-HTTP, Antimatter CRDT, and BraidFS.
Documentation

braid_rs

A unified Rust implementation of the Braid Protocol.

braid_rs consolidates several Braid-related components into a single, modular crate, providing a comprehensive toolkit for building decentralized, synchronized web applications.

Features

  • Core Braid-HTTP: Implementation of the Braid-HTTP protocol for state synchronization over HTTP.
  • Antimatter CRDT: A high-performance Conflict-free Replicated Data Type (CRDT) based on the Antimatter algorithm.
  • Braid-Blob: Content-addressed blob storage with Braid integration.
  • BraidFS: A filesystem synchronization daemon that uses Braid to sync local directories with remote servers.

Installation

Add this to your Cargo.toml:

[dependencies]

braid_rs = "0.1.0"

Modules

The crate is organized into several modules, gated by features:

core (default)

Contains the core Braid-HTTP client and server implementations.

  • client: A flexible Braid-HTTP client for fetching and subscribing to resources.
  • server: Axum-based server components for serving Braid resources.

antimatter (default)

Implementation of the Antimatter CRDT. Provides AntimatterCrdt for managing distributed state.

blob (default)

Content-addressed blob storage integration.

fs (default)

Filesystem synchronization logic, used by the braidfs binary.

Binaries

braidfs

The braidfs binary allows you to synchronize local files with a Braid server.

Usage:

# Start the braidfs daemon

braidfs run


# Sync a local directory to a remote Braid URL

braidfs sync ./my-folder http://example.com/my-resource

Examples

Creating a Braid Client

use braid_rs::BraidClient;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = BraidClient::new();
    let response = client.get("http://braid.org/resource").await?;
    println!("Content: {:?}", response.body());
    Ok(())
}

License

Licensed under either of:

at your option.

Links