question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infura token needs to be configurable

See original GitHub issue

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:

https://github.com/decentralized-identity/ethr-did-resolver/blob/d46a8ee65c1f8224ca4097f3c02478c60cb165ab/src/ethr-did-resolver.js#L175

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mirceaniscommented, Jan 22, 2020

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.

0reactions
mirceaniscommented, Jan 22, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started With Infura
View the details of the transaction on the blockchain; Review code implementation. Module 2.1: Configuration and Setup. Download and install the ...
Read more >
Using Infura (or a custom provider) - Truffle Suite
Before you can use Infura, you need to register. Upon registration, this guide will walk you through creating a new project, authenticating with...
Read more >
Infura Explained - What is Infura? - Moralis Academy
You may have heard of the Web3 backend Infrastructure-as-a-Service "Infura". However, what is Infura, and what are the alternatives?
Read more >
Using Infura (or a custom provider) - Truffle Suite
Before you can use Infura, you need to register for an Infura Access Token. Fill out the form and you will receive your...
Read more >
How to set up and first run - Security token documentation
You need an Ethereum node. You can either install yourself (see Install Parity) or use a Ethereum node provider like Infura. Sign up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found