Skip to main content

Get ZKP's status

The zkProofStatus method is used to retrieve the current status of a database's ZKP. This method helps track the progress of proof generation or identify any issues that may have occurred during the process.

Method Signature

zkProofStatus(): Promise<TZkProofStatusResponse>;

Syntax

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();


console.log(await zkdb.db("zkdb_test").zkProofStatus());

await zkdb.auth.signOut();

Returns

  • A promise that resolves to a TZkProofStatusResponse.

The TZkProofStatusResponse enum contains the following structure:

TZkProofResponse
StatusDescription
QueuedThe proof request has been queued and is waiting to be processed.
ProcessingThe proof request is currently being processed.
FailedThe proof request has failed due to an error or issue during generation.
SuccessThe proof request has successfully completed and is ready for retrieval.
Unknown`The proof request status is unknown, possibly due to an zkProof is null.
info

The Failed status also indicates that subsequent operations to generate proofs will be blocked until corrective action is taken. Refer to Detect and retry failed operations for more information on how to handle failure.