API Reference (docs.rs)
The book explains concepts and tasks; the complete published API surface lives on docs.rs. Start with the main crate and enable its derive feature, then add the storage engine and connector your node uses:
[dependencies]
ankurah = { version = "0.9", features = ["derive"] }
ankurah-storage-sled = "0.9"
ankurah-websocket-server = "0.9"
ankurah– the main API crate. Re-exportsNode, contexts, transactions, queries, and core types. Withfeatures = ["derive"], it also re-exports#[derive(Model)]and the derive/query macros used throughout this book.
The workspace splits into focused crates underneath; you will mostly meet them in error messages and Cargo trees rather than importing them directly:
| Crate | What it is |
|---|---|
ankurah-core | The engine: entities, transactions, the event DAG, policy, reactor |
ankql | The query language: parser and AST for predicates, ORDER BY, LIMIT |
ankurah-signals | The reactive signal primitives used for observability |
ankurah-proto | Wire and storage data types: events, clocks, ids, attestations |
ankurah-derive | The #[derive(Model)] macro |
Storage engines and connectors are separate crates so applications only compile what they use:
| Crate | Role |
|---|---|
ankurah-storage-sled | Embedded native key-value storage; the current starter templates default to it |
ankurah-storage-sqlite | Single-file SQL storage (native, including mobile) |
ankurah-storage-postgres | PostgreSQL-backed storage for server deployments |
ankurah-storage-indexeddb-wasm | Browser storage for WASM nodes |
ankurah-websocket-server | WebSocket server connector |
ankurah-websocket-client | WebSocket client connector (native) |
ankurah-websocket-client-wasm | WebSocket client connector (browser) |
ankurah-jwt-auth | JWT-based policy agent extension |
Ankurah is beta software and its extension crates may publish on a different cadence. Check compatible versions in the selected crate’s dependency list or use one of the maintained templates as a known-good set.
For how these layers fit together, see the overview; for the storage traits behind the engine crates, see the Storage Engine Layer chapter.