Initialise Issuer¶
Important
Before you implement the proof service and initalise circuit storage please ensure you have setup data storage, credential wallet, and identity wallet and created identity.
Circuit Storage¶
Function Definition¶
export async function initCircuitStorage(): Promise<ICircuitStorage> {
try {
return new FSCircuitStorage({
dirname: path.join(__dirname, "../circuits"),
});
} catch (error) {
console.log("Error occur while initialising Circuit Storage : ", error);
}
}
Initialisation¶
Proof Service¶
Function Definition¶
export async function initProofService(
identityWallet: IIdentityWallet,
credentialWallet: ICredentialWallet,
stateStorage: IStateStorage,
circuitStorage: ICircuitStorage
): Promise<ProofService> {
try {
return new ProofService(
identityWallet,
credentialWallet,
circuitStorage,
stateStorage
// { ipfsGatewayURL: "https://ipfs.io" }
);
} catch (error) {
console.log("Error occur while initialising Proof Service: ", error);
}
}
Initialisation¶
let proofService = await initProofService(
identityWallet,
credentialWallet,
dataStorage.states,
circuitStorage
);