pub struct AnchorStore { /* private fields */ }Expand description
SQLite-backed store. Each operation opens its own connection so callers may safely share the store across worker threads.
Implementations§
Source§impl AnchorStore
impl AnchorStore
Sourcepub fn open(
path: impl AsRef<Path>,
config: AnchorStoreConfig,
) -> Result<Self, AnchorStoreError>
pub fn open( path: impl AsRef<Path>, config: AnchorStoreConfig, ) -> Result<Self, AnchorStoreError>
Open or create the store and bind it to immutable runtime policy.
§Errors
Fails closed when the path, schema, or previously persisted runtime policy is unavailable or inconsistent.
Validate and persist a signed DID/chain/scope authority snapshot. Identical provisioning is idempotent; any replacement under the same DID/key ID is rejected.
§Errors
Fails for invalid identity documents, delegation signatures, scope, key epoch, audience, validity, or persistent conflicts.
Persist a signed key-epoch retirement. Identical retirement is idempotent; conflicting retirement evidence is rejected.
§Errors
Fails if the retirement is not signed by the configured intermediate, targets another authority epoch, predates the binding, or conflicts with existing evidence.
Persist a governance-authorized revocation of one exact authority epoch.
Sourcepub fn record(
&self,
submission: SubmissionContext<'_>,
signer: &dyn DurableAnchorSigner,
) -> Result<AnchorRecord, AnchorStoreError>
pub fn record( &self, submission: SubmissionContext<'_>, signer: &dyn DurableAnchorSigner, ) -> Result<AnchorRecord, AnchorStoreError>
Validate, authorize, sign exactly once, and atomically commit one request/idempotency/receipt/response record. Exact durable replay is checked before live authority expiry or retirement.
§Errors
Fails closed for invalid protocol bytes, authority state, conflicts, signer errors, persistence errors, or failed self-verification.
Sourcepub fn readback_action(
&self,
source_code: &str,
action_hash: &[u8; 32],
) -> Result<Option<AuthenticatedAnchorReadback>, AnchorStoreError>
pub fn readback_action( &self, source_code: &str, action_hash: &[u8; 32], ) -> Result<Option<AuthenticatedAnchorReadback>, AnchorStoreError>
Read and cryptographically authenticate one stored action record.
§Errors
Returns a readback error if any persisted request, receipt, response, signature journal, authority snapshot, or binding commitment changed.