Project goal: add an integration layer between Automerge and client code, compatible with any Rust async runtime.
The filesystem disk layout and WebSocket sync protocol implemented in this crate are not compatible with those of the JavaScript automerge-repo implementation. An experimental Rust implementation that aims for compatibility with the JS tools is being developed in the [alexjg/samod] repo.
- Start the server:
cargo run --example tcp-example --features="tokio" -- --tcp-run-ip 127.0.0.1:2345 --http-run-ip 0.0.0.0:3001
- Start any number of clients:
cargo run --example tcp-example --features="tokio" -- --other-ip 127.0.0.1:2345 --http-run-ip 0.0.0.0:3002
- Create a new document at the server:
curl 0.0.0.0:3001/new_doc
- The document id is returned as json.
- Request the document:
curl --json '{document-id}' 0.0.0.0:3002/request_doc
(document id argument should look like'"f9b1a2c6-ca05-4fc7-a02f-7e3d83f1bb49"'
)
- Presss ctr-c at every terminal tab.
- A successful run will print out the expected synced documents.
An implementation of the distributed bakery algorithm, based on this TLA+ specification.
- Start the bootstap peer:
cargo run --release --example distributed-bakery --features="tokio" -- --bootstrap --customer-id "1"
- Start two other peers:
cargo run --release --example distributed-bakery --features="tokio" -- --customer-id "2"
cargo run --release --example distributed-bakery --features="tokio" -- --customer-id "3"
- Watch the peers request new increments from each other, and enter/exit their critical sections(printed out).