- Rust 94.3%
- Shell 5.7%
book.toml declares mdbook-mermaid as a required preprocessor, so local-ci.sh's doc job and the TMT doc test both need it alongside mdbook to build docs/ successfully instead of failing on a missing preprocessor. Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> |
||
|---|---|---|
| .fmf | ||
| .github/workflows | ||
| contrib/tmt | ||
| crates | ||
| docs | ||
| scripts | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
agirru
Asynchronous Gossip Information Retrieval and Replication Utility — a push-pull anti-entropy gossip engine and a small set of causal-tag CRDT primitives for replicating state across peers, written in Rust for Tokio.
agirru doesn't ship a network stack, a storage engine, or a peer discovery
mechanism. It defines the merge/delta/gossip protocol as traits, and an
application supplies the Transport, Membership, Storage, and (optionally)
GossipHooks implementations that fit its own environment — an HTTP client,
a QUIC stream, an in-process channel for tests, whatever.
Workspace layout
| Crate | Description |
|---|---|
agirru |
Facade crate — re-exports agirru-crdt and agirru-engine, plus the #[derive(Merge)]/#[derive(Delta)]/#[derive(ReplicaScoped)] macros. Depend on this one. |
agirru-crdt |
Causal-tag CRDT primitives (RwMap, GCounter, PnCounter, LwwRegister, DwRegister, VectorClock, GenerationClock). No I/O, no async, no network types. |
agirru-engine |
The Transport/Membership/Storage/GossipHooks/Codec traits and the GossipEngine push-pull anti-entropy round loop. |
agirru-derive |
#[derive(Merge)] / #[derive(Delta)] / #[derive(ReplicaScoped)] proc macros for aggregate state structs. |
agirru-sim |
Reference in-memory Transport/Storage/Membership implementations, used by the convergence test suite and the three_node_convergence example. Not published. |
Quick example
use agirru::{Clock, GenerationClock, LwwRegister, Merge, ReplicaId};
let gen = GenerationClock::new();
let mut clock = Clock::new(ReplicaId::from_bytes([1; 16]));
let mut reg: LwwRegister<&str> = LwwRegister::default();
reg.set("hello", clock.tick(1), &gen);
assert_eq!(reg.get(), Some(&"hello"));
A full end-to-end demo — spinning up a mesh of gossiping nodes, writing keys,
and watching them converge — lives at
crates/agirru-sim/examples/three_node_convergence.rs:
cargo run --release --example three_node_convergence -p agirru-sim
Building and testing
cargo build --workspace
cargo test --workspace
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.