Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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-exports Node, contexts, transactions, queries, and core types. With features = ["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:

CrateWhat it is
ankurah-coreThe engine: entities, transactions, the event DAG, policy, reactor
ankqlThe query language: parser and AST for predicates, ORDER BY, LIMIT
ankurah-signalsThe reactive signal primitives used for observability
ankurah-protoWire and storage data types: events, clocks, ids, attestations
ankurah-deriveThe #[derive(Model)] macro

Storage engines and connectors are separate crates so applications only compile what they use:

CrateRole
ankurah-storage-sledEmbedded native key-value storage; the current starter templates default to it
ankurah-storage-sqliteSingle-file SQL storage (native, including mobile)
ankurah-storage-postgresPostgreSQL-backed storage for server deployments
ankurah-storage-indexeddb-wasmBrowser storage for WASM nodes
ankurah-websocket-serverWebSocket server connector
ankurah-websocket-clientWebSocket client connector (native)
ankurah-websocket-client-wasmWebSocket client connector (browser)
ankurah-jwt-authJWT-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.