mirror of
https://github.com/BillionsNetwork/verified-agent-identity.git
synced 2026-09-14 14:27:14 +08:00
28 lines
593 B
JavaScript
28 lines
593 B
JavaScript
const { getInitializedRuntime } = require("./shared/bootstrap");
|
|
const {
|
|
parseArgs,
|
|
outputError,
|
|
outputSuccess,
|
|
createDidDocument,
|
|
getRequiredDidEntry,
|
|
} = require("./shared/utils");
|
|
|
|
async function main() {
|
|
try {
|
|
const args = parseArgs();
|
|
const { didsStorage } = await getInitializedRuntime();
|
|
const entry = await getRequiredDidEntry(didsStorage, args.did);
|
|
|
|
const didDocument = createDidDocument(entry.did, entry.publicKeyHex);
|
|
|
|
outputSuccess({
|
|
didDocument,
|
|
did: entry.did,
|
|
});
|
|
} catch (error) {
|
|
outputError(error, true);
|
|
}
|
|
}
|
|
|
|
main();
|