Skip to main content

Module actor

Module actor 

Source
Expand description

Single-owner KERI state for the witness.

All libkeri state lives in one libkeri::Habery owned by a dedicated OS thread. HTTP handlers never touch it directly: they send a Command over a channel and await the reply. Because exactly one thread ever holds the state, there are no locks, so there is nothing to deadlock on.

The Habery is opened on the owner thread, and a plain thread (not a tokio task) is used because libkeri is synchronous and does blocking work (LMDB, signing, Argon2 stretching) that must not stall the async runtime.

Structsยง

ActorHandle
Cheap, cloneable handle used by HTTP handlers to talk to the actor.
WitnessActor ๐Ÿ”’
State owned by the actor thread. Only ever accessed from that one thread.

Enumsยง

ActorError
Error returned by the actor, mapped to an HTTP status by the server.
Command ๐Ÿ”’
Work the actor can perform. Each variant carries its own reply channel.
ReceiptOutcome
Outcome of submitting an event to /receipts (keripy ReceiptEnd.on_post).

Constantsยง

QUEUE_DEPTH ๐Ÿ”’
Max queued commands before handlers wait (backpressure).

Functionsยง

spawn
Spawn the owner thread, open the witness Habery on it, and return a handle plus the witness AID once initialization has finished.
witness_salt ๐Ÿ”’
Returns the 16-byte salt for a known witness alias, matching keripy demo salts.

Type Aliasesยง

Reply ๐Ÿ”’