ipfs-embed
A small embeddable ipfs implementation compatible with libipld and with a concurrent garbage collector. It supports
- node discovery via mdns
- provider discovery via kademlia
- exchange blocks via bitswap
The ipld-block-builder
can be used for using the store effectively. It also supports
- creating encrypted/private block stores for sensitive data
- caching of native data types to maximize performance
ipld-collections
provide high level multiblock abstractions using the ipld-block-builder
.
Getting started
use ;
use ;
use DagCbor;
async
Concurrent garbage collection
// #roots = {} #live = {}
let a = builder.insert.await?;
// #roots = {a} #live = {a}
let b = builder.insert.await?;
// #roots = {a, b} #live = {a, b}
// block `b` contains a reference to block `a`, so the
// garbage collector won't remove it until block `b` gets
// unpinned
builder.unpin.await?;
// #roots = {b} #live = {a, b}
let c = builder.insert.await?;
// #roots = {b, c} #live = {a, b, c}
// the backing storage is content addressed, but inserting
// a block multiple times increases the ref count.
let c2 = builder.insert.await?;
// #roots = {b, c, c} #live = {a, b, c}
builder.unpin.await?;
// #roots = {b, c} #live = {a, c}
builder.unpin.await?;
// #roots = {c} #live = {a, c}
builder.unpin.await?;
// #roots = {} #live = {}
Multiblock collections
use ;
use List;
async
License
MIT OR Apache-2.0