@armada/sdk / index / IndexedDbArtifactCache
Class: IndexedDbArtifactCache
Defined in: src/prover/artifact-cache.ts:37
Caches an inner ArtifactSource's resolved sets in IndexedDB (browser). The first resolve for a shape fetches + stores; later resolves read from IndexedDB, so the multi-MB zkey isn't re-downloaded per proof.
Wrap the source you want cached — including a VerifiedArtifactSource, so only integrity-checked bytes are ever stored. Cache entries are keyed by (version, shape): bump version (e.g. the armada-circuits build id) whenever the artifacts change to invalidate stale entries, or call clear().
Implements
Constructors
Constructor
new IndexedDbArtifactCache(
inner,opts):IndexedDbArtifactCache
Defined in: src/prover/artifact-cache.ts:40
Parameters
inner
opts
version
string
dbName?
string
Returns
IndexedDbArtifactCache
Methods
resolve()
resolve(
shape):Promise<ArtifactSet>
Defined in: src/prover/artifact-cache.ts:45
Parameters
shape
Returns
Promise<ArtifactSet>
Implementation of
clear()
clear():
Promise<void>
Defined in: src/prover/artifact-cache.ts:55
Drop every cached artifact (e.g. on a circuits rebuild without a version bump).
Returns
Promise<void>