uport-project / ethr-did

Create ethr DIDs
Apache License 2.0
260 stars 54 forks source link

Uncaught (in promise) Error: [ethjs-query] while formatting outputs from RPC '{}' #3

Closed RobertoSnap closed 6 years ago

RobertoSnap commented 6 years ago

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.

riusricardo commented 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})

mi-xu commented 6 years ago

Here is the relevant issue in web3: https://github.com/ethereum/web3.js/issues/1119 Truffle-contract uses web3 v0.20

mi-xu commented 6 years ago

Related to https://app.zenhub.com/workspace/o/uport-project/uport-js/issues/87

hsnhrn commented 5 years ago

const ethrDid = new EthrDID({provider, registry, address})

what is registry here? what we have to put here?

mirceanis commented 5 years ago

The default registry address for mainnet and the public test networks is 0xdca7ef03e98e0dc2b855be647c39abe984fcf21b

hsnhrn commented 5 years ago

Thank you @mirceanis :)

hsnhrn commented 5 years ago

does anyone have any idea about this error while calling verifyJWT? (node:3310) UnhandledPromiseRejectionWarning: Error: Unsupported DID method: 'ethr'

thanks alot!!

mirceanis commented 5 years ago

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.

hsnhrn commented 5 years ago

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