-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat-performance
- Loading branch information
Showing
52 changed files
with
1,295 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package id.walt | ||
|
||
import id.walt.credentials.w3c.VerifiableCredential | ||
import id.walt.credentials.w3c.W3CIssuer | ||
import id.walt.model.DidMethod | ||
import id.walt.servicematrix.ServiceMatrix | ||
import id.walt.services.did.DidService | ||
import id.walt.signatory.ProofConfig | ||
import id.walt.signatory.ProofType | ||
import id.walt.signatory.Signatory | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.Job | ||
import kotlinx.coroutines.launch | ||
import java.io.File | ||
import kotlin.system.measureTimeMillis | ||
|
||
val RESOURCES_PATH: String = "src/test/resources" | ||
|
||
fun getTemplate(name: String): VerifiableCredential = | ||
VerifiableCredential.fromString(File("$RESOURCES_PATH/verifiable-credentials/vc-template-default.json").readText(Charsets.UTF_8)) | ||
|
||
suspend fun main() { | ||
ServiceMatrix("service-matrix.properties") | ||
val issuerWebDid: String = DidService.create(DidMethod.web) | ||
|
||
//val credentialService: JwtCredentialService = JwtCredentialService.getService() | ||
val signatory = Signatory.getService() | ||
val template = getTemplate("ebsi-attestation") | ||
|
||
template.issuer = W3CIssuer(issuerWebDid) | ||
template.credentialSubject!!.id = issuerWebDid // self signed | ||
|
||
println("" + measureTimeMillis { | ||
val jobs = ArrayList<Job>() | ||
repeat(500000) { | ||
jobs.add(GlobalScope.launch { | ||
signatory.issue("VerifiableId", ProofConfig(issuerDid = issuerWebDid, proofType = ProofType.JWT)) | ||
}) | ||
} | ||
|
||
jobs.forEach { it.join() } | ||
} + " ms overall") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/kotlin/id/walt/credentials/w3c/templates/VcTemplate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package id.walt.credentials.w3c.templates | ||
|
||
import id.walt.common.SingleVCObject | ||
import id.walt.credentials.w3c.VerifiableCredential | ||
|
||
data class VcTemplate( | ||
val name: String, | ||
val template: VerifiableCredential? = null, | ||
@SingleVCObject val template: VerifiableCredential? = null, | ||
val mutable: Boolean | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.