Crates.io | gundb |
lib.rs | gundb |
version | 0.2.1 |
source | src |
created_at | 2022-01-21 15:29:24.138237 |
updated_at | 2022-05-16 11:06:35.384836 |
description | Distributed graph database that syncs over websockets and multicast |
homepage | |
repository | https://github.com/mmalmi/gun-rs |
max_upload_size | |
id | 518596 |
size | 31,283,204 |
Pure Rust implementation of Gun.js. For a wasm version, check out gun-rs-wasm.
Iris-messenger uses the gun-rs node at wss://gun-rs.iris.to/gun
Install Rust first.
cargo install gundb
gundb start
use gundb::{Node, NodeConfig};
use gundb::types::GunValue;
let mut db = Node::new_with_config(NodeConfig {
outgoing_websocket_peers: vec!["wss://some-server-to-sync.with/gun".to_string()],
..NodeConfig::default()
});
let mut sub = db.get("greeting").on();
db.get("greeting").put("Hello World!".into());
if let GunValue::Text(str) = sub.recv().await.unwrap() {
assert_eq!(&str, "Hello World!");
}
15/5/2022:
db.get('#').get(data_hash).put(data)
)db.get('~' + pubkey).get('profile') ...
)cargo install cargo-watch
RUST_LOG=debug cargo watch -x 'run -- start'
heroku create --buildpack emk/rust
git push heroku master
or: