Gun-rs

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

Why?

Use

Install Rust first.

Gun relay

cargo install gundb gundb start

Gun library

rust 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!"); }

Status

15/5/2022:

Issues

Develop

cargo install cargo-watch RUST_LOG=debug cargo watch -x 'run -- start'

Run on Heroku

heroku create --buildpack emk/rust git push heroku master

or:

Deploy