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
const Web3 = require('web3');
Web3.providers.HttpProvider.prototype.sendAsync = Web3.providers.HttpProvider.prototype.send
let provider = new Web3.providers.HttpProvider('http://localhost:9545')
const { Resolver } = require('did-resolver')
const { getResolver } = require('ethr-did-resolver')
const EthrDID = require('ethr-did');
let test = async () => {
const registry = '0x71d2fb13e289fbb9ccae91571ca6637ccb29c727';
const address = '0x23149630a1a84df75a8dccc3a50c02d0ad146d8e';
const ethrDid = new EthrDID({ provider, registry, address });
let did = ethrDid.did;
const ethrDidResolver = getResolver(provider, registry)
const didResolver = Resolver(ethrDidResolver)
console.log(didResolver); // undefined
}
test();
Steps to Reproduce
init npm project
paste the above code into index.js
config the provider
replace the address and registry with your own stuff
install the web3, ethr-did, did-resolver, ethr-did-resolver dependencies
run node index.js
Expected Behaviour
It should resolve the DID Document for give DID.
Actual Behaviour
const didResolver = Resolver(ethrDidResolver) is undefined so the rest of code (didResolver.resolve('did:ethr:0x23149630a1a84df75a8dccc3a50c02d0ad146d8e').then(doc => console.log)) is not executing.
Description
I'm trying to resolve a DID document using
did-resolver
andethr-did-resolver
using the instructions described here:https://github.com/uport-project/ethr-did-resolver#resolving-a-did-document
Sample Code
Steps to Reproduce
index.js
address
andregistry
with your own stuffweb3
,ethr-did
,did-resolver
,ethr-did-resolver
dependenciesnode index.js
Expected Behaviour
It should resolve the DID Document for give DID.
Actual Behaviour
const didResolver = Resolver(ethrDidResolver)
isundefined
so the rest of code (didResolver.resolve('did:ethr:0x23149630a1a84df75a8dccc3a50c02d0ad146d8e').then(doc => console.log)
) is not executing.Versions
"did-resolver": "^1.0.0",
"ethjs-provider-http": "^0.1.6",
"ethr-did": "^1.1.0",
"ethr-did-resolver": "^1.0.1",
"web3": "^1.2.1"
The text was updated successfully, but these errors were encountered: