41 releases (14 breaking)
new 0.15.0 | Sep 19, 2023 |
---|---|
0.13.1 | Jul 21, 2023 |
0.8.0 | Mar 29, 2023 |
0.5.0 | Dec 15, 2022 |
0.4.0 | Nov 30, 2022 |
#268 in Filesystem
375 downloads per month
Used in 2 crates
715KB
15K
SLoC
Noosphere
This is the entrypoint for most language-specific distributable packages the deal with accessing the Noosphere. It contains language-specific bindings and platform-sensitive behavior to provide a common set of high-level APIs.
Building Headers
To build the C FFI headers:
cargo run --features=headers --example generate_header
lib.rs
:
This crate is a high-level entrypoint for embedders of the Noosphere protocol. Embedders may use [NoosphereContext] to initialize a singleton that enables manaing spheres, including creating new ones and joining existing ones.
#
let noosphere = NoosphereContext::new(NoosphereContextConfiguration {
storage: NoosphereStorage::Scoped {
path: "/path/to/block/storage".into(),
},
security: NoosphereSecurity::Insecure {
path: "/path/to/key/storage".into(),
},
network: NoosphereNetwork::Http {
gateway_api: Some(Url::parse("http://example.com")?),
ipfs_gateway_url: None,
},
})?;
noosphere.create_key("my-key").await?;
let SphereReceipt { identity, mnemonic } = noosphere.create_sphere("my-key").await?;
// identity is the sphere's DID
// mnemonic is a recovery phrase that must be stored securely by the user
let mut sphere_channel = noosphere.get_sphere_channel(&identity).await?;
let sphere = sphere_channel.mutable();
// Write something to the sphere's content space
sphere.write("foo", &ContentType::Text, "bar".as_bytes(), None).await?;
sphere.save(None).await?;
// Sync the sphere with the network via a Noosphere gateway
sphere.sync().await?;
Dependencies
~15–36MB
~588K SLoC