Skip to main content

Publish

Publish your did in blockchain. To do that it's require a URL of QuarkID API, that represents a QuarkID node that is executed as a service.

You can provide your own node or use the following.


Node:

const node = "https://node-ssi.buenosaires.gob.ar";

Create the funtion below to call the node.

export const getQuarkidApiURL = () => {
return node;
};

Import the following dependency encharge of publishing your DID.

import { CreateDIDResponse, Did } from "@extrimian/did-registry";

Write the code below.

export const publishDID = async (createDID: CreateDIDResponse) => {
const registry = new Did();

return await registry.publishDID({
modenaApiURL: getQuarkidApiURL(),
createDIDResponse: createDID,
});
};

Execute the publishDID function that receives the parameter createDidResponse, created in the last section.

publishDID(createDidResponse);

The response of that function returns a canonicalId, a short did and a long did that later will allow you to resolve and obtain the Did Doctument.