dnsprove.js
Functionalities
- Fetches DNS information of given domain name and type
- Validates DNS reponses and constructs proofs
- Submits the proofs into DNSSEC(Domain Name System Security Extensions) Oracle smart contract
- Works from both browser and from node.js
Installing
npm install '@ensdomains/dnsprovejs' --save
Usage
var provider = web3currentProvider; var DnsProve = ; var dnsprove = provider; var textDomain = '_ens.matoken.xyz'; var dnsResult = await dnsprove; var oracle = await dnsprove; var proofs = dnsResultproofs; ifdnsResultfound await oracle; else if dnsResultnsec await oracle; else throw"DNSSEC is not supported"
Alternatively, if you want to submit the proof not only to Oracle contract but also to claim via dnsregistrar
, then you can call getAllProofs
and pass the result into the proveAndClaim
function.
let dnsResult = await dnsprove; let oracle = await dnsprove; let data = await oracle; await registrarmethods
API
Please refer to the doc
Testing
npm run test