decentralized-identity / ethr-did-resolver

DID resolver for Ethereum Addresses with support for key management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infura token needs to be configurable

ajunge opened this issue · comments

I understand is configurable now but the current default does not work anymore.

I'm getting this error:

{
	"code": -32005,
	"message": "legacy access request rate exceeded",
	"data": {
		"reason": "project ID not provided",
		"see": "https://infura.io/dashboard"
	}
}

Probable line to change:

return new HttpProvider(conf.rpcUrl || 'https://mainnet.infura.io/ethr-did')

Any news?

We're working through it now.
There probably won't be a default URL here but we expect developers to provide their own RPC endpoints or providers when they use this lib.

Ciao Mircea , that is breaking change for us, by when do you think we can have a patch we can use ?

It depends, if you are using ethr-did-resolver directly, you can already provide a proper RPC-url.

Here is some sample code for that:

import { Resolver } from 'did-resolver'
import getResolver from 'ethr-did-resolver'

// You can set a rpc endpoint to be used by the web3 provider
const providerConfig = { rpcUrl: 'https://mainnet.infura.io/v3/<YOUR_OWN_PROJECT_ID_HERE>'}

// getResolver will return an object with a key/value pair of { "ethr": resolver } where resolver is a function used by the generic did resolver. 
const didResolver = Resolver(getResolver(providerConfig))

didResolver.resolve('did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74').then(doc => console.log)

// You can also use ES7 async/await syntax
const doc = await didResolver.resolve('did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74')

If you are using it through did-jwt, you have to use the Resolver instance during verification:

const didResolver = Resolver(getResolver(providerConfig))
didjwt.verifyJWT(token, {resolver : didResolver})

uport-credentials and uport-connect are also affected and we're working on fixes for it there as well.

Ciao Mircea , that is breaking change for us, by when do you think we can have a patch we can use ?

The broken URL will be temporarily reinstated to allow some time for the changes to be propagated.
new versions of the libraries will expect a configuration to be provided.