Closed RobertoSnap closed 6 years ago
This is an issue caused by Web3 1.0 library. It can be solved by creating an http provider with another library. Being more specific, it's caused by undefined web3.currentProvider.sendAsync.
Issue:
import Web3 from 'web3'
var provider = new Web3.providers.HttpProvider('http://localhost:8545')
const ethrDid = new EthrDID({provider, registry, address});
Possible solutions:
import HttpProvider from 'ethjs-provider-http'
let provider = new HttpProvider('http://localhost:8545')
const ethrDid = new EthrDID({provider, registry, address})
or
import Web3 from 'web3'
Web3.providers.HttpProvider.prototype.sendAsync = Web3.providers.HttpProvider.prototype.send
let provider = new Web3.providers.HttpProvider('http://localhost:8545')
const ethrDid = new EthrDID({provider, registry, address})
Here is the relevant issue in web3: https://github.com/ethereum/web3.js/issues/1119 Truffle-contract uses web3 v0.20
const ethrDid = new EthrDID({provider, registry, address})
what is registry here? what we have to put here?
The default registry address for mainnet and the public test networks is 0xdca7ef03e98e0dc2b855be647c39abe984fcf21b
Thank you @mirceanis :)
does anyone have any idea about this error while calling verifyJWT? (node:3310) UnhandledPromiseRejectionWarning: Error: Unsupported DID method: 'ethr'
thanks alot!!
check out this comment: https://github.com/uport-project/ethr-did/issues/22#issuecomment-525360269
If that doesn't help, please create a new issue and point to gist or minimal project that can reproduce the problem.
Thank you for your comment. But i am still having problem and created a new issue.. https://github.com/uport-project/ethr-did/issues/33
Thanks
This returns a fully functional ethrdid object
const ethrDid = new EthrDID({address: '0x...', privateKey: '...', provider})
Then, this errors out with message "Uncaught (in promise) Error: [ethjs-query] while formatting outputs from RPC '{}'"
const kp = await ethrDid.createSigningDelegate()
Used both ganache and private chain as providers over http.