Anchor Credentials / Entries on to the CORD blockchain #249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
C4GT 2023 | CORD NETWORK
Issue Link
Integrate APIs to create credentials, or entries on to this registry
How It Works
api/v1/{entityName}
api/v1/Schema
is hit, the schema is created and anchored to the chain. Refer this PR for schema and registry anchoring.The major changes are done in these files :
In the
RegistryHelper.java
, I have created a private functionand a public function
anchorCredentialsToCord()
, which internally calls the above function to anchor credentials.anchorCredentialsToCord()
is used for the following :a. Getting the schemaId and registryId of the anchored schema
b. In order to get the schemaId and registryId, this function calls the predefined
searchEntity()
function which is used by the/api/v1/{entityName}/search
endpoint internally, to get schema details.c. We are making this call, to get back the schemaId and registryId we received when we anchored the schema to chain.At that moment, we also anchored these values to the schema.
The response from the search schema api -
api/v1/Schema/search
looks like :d. After extracting the schemaId and registryId, we create a json structure to send to the credentials api, in the
appendCredentialsToCord()
functionHelper functions