Get ZKP's status
Check the current status of zero-knowledge proof generation for rollup operations.
Definition
await zkdb
.db(databaseName: string)
.zkProofStatus(): Promise<TZkProofStatusResponse>;
Parameters
- None
Returns
Promise<TZkProofStatusResponse>
: Returns the current status of zero-knowledge proof generation for rollup operations. This indicates whether proofs are ready for blockchain submission, still processing, or have encountered errors that need attention.
The TZkProofStatusResponse
enum contains the following structure:
TZkProofResponse
Status | Description |
---|---|
Queued | The proof request has been queued and is waiting to be processed. |
Processing | The proof request is currently being processed. |
Failed | The proof request has failed due to an error or issue during generation. |
Success | The proof request has successfully completed and is ready for retrieval. |
Unknown | `The proof request status is unknown, possibly due to an zkProof is null. |
Failed Status
Failed
status blocks subsequent operations. Use proverRetry()
to restart failed proof generation.
Workflow: Check proverStatus()
→ proverRetry()
→ Monitor until Success
Example
import { ZkDatabase } from 'zkdb';
const zkdb = await ZkDatabase.connect({
userName: "chiro-user",
privateKey: "EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP",
environment: "node",
// This URL is for test environment
url: "https://api.zkdatabase.org/graphql",
});
await zkdb.auth.signIn();
const dbTest = zkdb.db('zkdb_test');
const status = await dbTest.zkProofStatus();
console.log('ZK Proof Status:', status);
await zkdb.auth.signOut();
Result:
"Success"