You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, ran into some problems getting the examples from the README and NPM to run. By borrowing code from the mocha tests the following works to issue a sample credential.
// To run in Node.js use put this in a *.mjs file or set "type": "module" in// your package.json file.import{Ed25519VerificationKey2018}from'@digitalbazaar/ed25519-verification-key-2018';import{Ed25519Signature2018}from'@digitalbazaar/ed25519-signature-2018';import{issue}from'@digitalbazaar/vc';letkeyPair=awaitEd25519VerificationKey2018.generate({id: 'https://example.edu/issuers/keys/1',controller: 'https://example.edu/issuers/565049'});console.log(keyPair);// Set up the signature suite, using the generated keyletsuite=newEd25519Signature2018({verificationMethod: 'https://example.edu/issuers/keys/1',key: keyPair});console.log(suite);constmockCredential={'@context': ['https://www.w3.org/2018/credentials/v1','https://www.w3.org/2018/credentials/examples/v1'],id: 'http://example.edu/credentials/1872',type: ['VerifiableCredential','AlumniCredential'],issuer: 'https://example.edu/issuers/565049',issuanceDate: '2010-01-01T19:23:24Z',credentialSubject: {id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',alumniOf: '<span lang="en">Example University</span>'}};letverifiableCredential=awaitissue({credential: mockCredential,
suite
});console.log(verifiableCredential);
If I try to use the Ed25519VerificationKey2020 and Ed25519Signature2020 packages I get the following error:
However the JSON document seems resolvable in my web browser. Any ideas of what is going wrong. Note that the Mocha tests do not test the *2020 packages.
Cheers
Greg
The text was updated successfully, but these errors were encountered:
Hi, ran into some problems getting the examples from the README and NPM to run. By borrowing code from the mocha tests the following works to issue a sample credential.
If I try to use the Ed25519VerificationKey2020 and Ed25519Signature2020 packages I get the following error:
However the JSON document seems resolvable in my web browser. Any ideas of what is going wrong. Note that the Mocha tests do not test the *2020 packages.
Cheers
Greg
The text was updated successfully, but these errors were encountered: