Rust Object Database.
The decentralized social networking application Iris-messenger syncs over Rod peers by default.
Install Rust first.
cargo install rod
rod start
use rod::{Node, Config, Value};
use rod::adapters::*;
#[tokio::main]
async fn main() {
let config = Config::default();
let ws_client = OutgoingWebsocketManager::new(
config.clone(),
vec!["ws://localhost:4944/ws".to_string()],
);
let mut db = Node::new_with_config(config.clone(), vec![], vec![Box::new(ws_client)]);
let mut sub = db.get("greeting").on();
db.get("greeting").put("Hello World!".into());
if let Value::Text(str) = sub.recv().await.unwrap() {
assert_eq!(&str, "Hello World!");
println!("{}", &str);
}
db.stop();
}
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'
cargo test
Watch for code changes and re-run tests that contain the word "stats":
RUST_LOG=debug cargo watch -x 'test stats'
cargo bench
heroku create --buildpack emk/rust
git push heroku master
or: