Add claim example

This commit is contained in:
Yarmo Mackenbach 2021-11-17 15:00:44 +01:00
parent cde83b5b90
commit d5ea56a221
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

17
examples/verify-claim.js Normal file
View file

@ -0,0 +1,17 @@
const doip = require('../src')
const main = async () => {
// Generate the claim
const claim = new doip.Claim("dns:doip.rocks", "3637202523e7c1309ab79e99ef2dc5827b445f4b")
// Match it to candidate service providers
claim.match();
// Verify the claim
await claim.verify();
// Log the claims of the first UID
console.log(claim)
}
main()