Is there a maximum number of credentials that can be issued per unit of time? #638
-
Hello! I wanted to write a test that issued a large number of verifiable credentials to then test how much time it would take to get the credentials back from the data store. It was supposed to issue 100,000 credentials, however it only created 497 and no errors were thrown. Is there a 'Maximum number of credentials that can be issued per second with the same issuer' or something similar? If it can be of any help, I just used a for loop for creating the credentials: for (let i = 0; i < 100 * 1000; i++) {
const credential: W3CCredential = {
issuer: { id: identifier.did }, // a did:ethr:rinkeby DID
"@context": ["https://www.w3.org/2018/credentials/v1"],
type: ["VerifiableCredential", "Profile"],
issuanceDate: new Date().toISOString(),
credentialSubject: {
name: "Name",
id: identifier.did,
},
};
await agent.createVerifiableCredential({
save: true,
credential,
proofFormat: "jwt",
});
} Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is no limit imposed by Veramo. Please try to add a random nonce to your credentials and see if the issue manifests again. import { v4 as uuidv4 } from 'uuid';
//...
for (let i = 0; i < 100 * 1000; i++) {
const credential: W3CCredential = {
id: uuidv4(),
issuer: { id: identifier.did }, // a did:ethr:rinkeby DID
"@context": ["https://www.w3.org/2018/credentials/v1"],
type: ["VerifiableCredential", "Profile"],
issuanceDate: new Date().toISOString(),
credentialSubject: {
name: "Name",
id: identifier.did,
},
};
await agent.createVerifiableCredential({
save: true,
credential,
proofFormat: "jwt",
});
} |
Beta Was this translation helpful? Give feedback.
There is no limit imposed by Veramo.
I suspect that the reason you are only seeing a small number of credentials is because you are creating groups of identical credentials.
The only difference between the credentials you are creating is the timestamp, which has a resolution of Seconds.
When they are stored, they are hashed and the hash is used as primary key. since they are identical, the same hash is computed so they end up overwriting each other.
Please try to add a random nonce to your credentials and see if the issue manifests again.