Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation open-attestation-verify FALSE #231

Open
wechta opened this issue Jul 5, 2022 · 1 comment
Open

Documentation open-attestation-verify FALSE #231

wechta opened this issue Jul 5, 2022 · 1 comment

Comments

@wechta
Copy link

wechta commented Jul 5, 2022

Hi, I try to follow documentation:
https://www.openattestation.com/docs/developer-section/libraries/remote-files/open-attestation-verify/

I use your wrapped document, with similar piece of code (tried to select ropsten network):
`import { isValid, verify } from "@govtechsg/oa-verify";
import { verificationBuilder, openAttestationVerifiers } from "@govtechsg/oa-verify";
//import * as document from "./bill-ONE8888-ropsten.json";
import * as document from "./document.json";

const fragments1 = await verify(document);
console.log("verify1: "+isValid(fragments1));
console.log("fragments1", fragments1)

const verify2 = verificationBuilder(openAttestationVerifiers, { network: "ropsten" });
const fragments2 = await verify2(document);
console.log("verify2: "+isValid(fragments2));
console.log("fragments2", fragments2)`

The response is:
verify1: false fragments1 [ { status: 'SKIPPED', type: 'DOCUMENT_INTEGRITY', name: 'OpenAttestationHash', reason: { code: 2, codeString: 'SKIPPED', message: 'Document does not have merkle root, target hash or data.' } }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationEthereumTokenRegistryStatus', reason: { code: 4, codeString: 'SKIPPED', message: Document issuers doesn't have "tokenRegistry" property or TOKEN_REGISTRY method} }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationEthereumDocumentStoreStatus', reason: { code: 4, codeString: 'SKIPPED', message:Document issuers doesn't have "documentStore" or "certificateStore" property or DOCUMENT_STORE method} }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationDidSignedDocumentStatus', reason: { code: 0, codeString: 'SKIPPED', message: 'Document was not signed by DID directly' } }, { status: 'SKIPPED', type: 'ISSUER_IDENTITY', name: 'OpenAttestationDnsTxtIdentityProof', reason: { code: 2, codeString: 'SKIPPED', message:Document issuers doesn't have "documentStore" / "tokenRegistry" property or doesn't use DNS-TXT type} }, { status: 'SKIPPED', type: 'ISSUER_IDENTITY', name: 'OpenAttestationDnsDidIdentityProof', reason: { code: 0, codeString: 'SKIPPED', message: 'Document was not issued using DNS-DID' } } ] verify2: false fragments2 [ { status: 'SKIPPED', type: 'DOCUMENT_INTEGRITY', name: 'OpenAttestationHash', reason: { code: 2, codeString: 'SKIPPED', message: 'Document does not have merkle root, target hash or data.' } }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationEthereumTokenRegistryStatus', reason: { code: 4, codeString: 'SKIPPED', message:Document issuers doesn't have "tokenRegistry" property or TOKEN_REGISTRY method} }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationEthereumDocumentStoreStatus', reason: { code: 4, codeString: 'SKIPPED', message:Document issuers doesn't have "documentStore" or "certificateStore" property or DOCUMENT_STORE method} }, { status: 'SKIPPED', type: 'DOCUMENT_STATUS', name: 'OpenAttestationDidSignedDocumentStatus', reason: { code: 0, codeString: 'SKIPPED', message: 'Document was not signed by DID directly' } }, { status: 'SKIPPED', type: 'ISSUER_IDENTITY', name: 'OpenAttestationDnsTxtIdentityProof', reason: { code: 2, codeString: 'SKIPPED', message:Document issuers doesn't have "documentStore" / "tokenRegistry" property or doesn't use DNS-TXT type } }, { status: 'SKIPPED', type: 'ISSUER_IDENTITY', name: 'OpenAttestationDnsDidIdentityProof', reason: { code: 0, codeString: 'SKIPPED', message: 'Document was not issued using DNS-DID' } }

Even if I try same example as in documentation, the response is still false? What could go wrong?
Thank you, Peter

@cavacado
Copy link
Contributor

cavacado commented Jul 8, 2022

could we look at the document you are trying to validate?
if its like what you've written, the example from the documentation, then using https://toolkit.openattestation.com/verify (just a front end to wrap around the functionality) shows that the document is valid.

in this case, verify1 will be false, as you are indicating to the verification builder that you want to validate on the mainnet, verify2 will be true as shown by the results of the the toolkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants