p2panda_blobs/lib.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! Blobs service offering storage, retrieval and synchronisation of content-addressed data.
4//!
5//! `p2panda-blobs` relies on the
6//! [`iroh-blobs`](https://docs.rs/iroh-blobs/latest/iroh_blobs/index.html) crate and offers an API
7//! to import blobs into a store and use the resulting BLAKE3 hashes to address them for downloads.
8//! In-memory and filesystem-based store options are provided.
9//!
10//! The blobs service integrates with `p2panda-net` to provide a means of synchronising files
11//! between devices using BLAKE3 verified streaming. Memory usage is generally low, even when
12//! transferring very large files.
13mod blobs;
14mod config;
15mod download;
16mod export;
17mod import;
18mod protocol;
19
20use iroh_blobs::store;
21
22pub use blobs::Blobs;
23pub use config::Config;
24pub use download::DownloadBlobEvent;
25pub use import::ImportBlobEvent;
26pub use protocol::{BlobsProtocol, BLOBS_ALPN};
27
28/// In-memory storage database with support for partial blobs.
29pub type MemoryStore = store::mem::Store;
30
31/// Filesystem storage database backed by [redb](https://crates.io/crates/redb) for small blobs and
32/// files for large blobs.
33pub type FilesystemStore = store::fs::Store;