-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding API tokens to default provider #799
Comments
The v5 getDefaultProvider does though. See here for the properties to use. :) More details will be added to the docs soon. INFURA and Etherscan will no longer return any result without an API key. For now, the API keys seem mostly for metric purposes and throttling is (as it probably should be) based on the source IP address. I would recommend you use v5, and certainly pass in your own API keys. At the very least, it gives you useful metrics into the usage of your app. Also, if you pay extra for INFURA, you can get archival access and other perks. :) |
To be clear though, the rate limit applies mostly to the IP address than the API key, as far as I know, so far. |
To be clear though, the rate limit applies mostly to the IP address than the API key, as far as I know, so far.
Verified for Etherscan:
The APIs are free for the community with a maximum rate limit of up to 5 calls per sec/IP with a valid API key
Looks legit
|
Concerning at Infura though:
Rate limiting will be applied account wide after the accounts daily request limit is exceeded.
They take ip into account but the limiting happens account-wide, not per ip
|
I would recommend you use v5, and certainly pass in your own API keys.
This is a production site. Is V5 ready for prime time? Or should I just create a FallbackProvider using an initialized EtherscanProvider and InfuraProvider? That would be equivalent, right?
|
Yes, that would be the equivalent for v4. I personally use v5 in production services and I think the last hold up I s the documentation, which is what I'm working on getting out the door right now. :) |
I think this has been answered? If not, please feel free to re-open. Thanks! :) |
The documentation suggests we use
getDefaultProvider
unless running our own nodes:However, Etherscan says:
Both the EtherscanProvider and the InfuraProvider give us a way to pass these API tokens:
It seems that if
getDefaultProvider
doesn't provide the ability to add API tokens for the Etherscan and Infura providers that it creates that we won't really be getting the benefit of the fallback. Based on their statement, it seems Etherscan will just not work without the API token. Looking at Infura, the docs all suggest a project id is required for access to its API.I have dapp that is working, but I want to understand whether the more appropriate and reliable thing to do would be to create an
EthereumProvider
and anInfuraProvider
with my API tokensand finally build a
FallbackProvider
using those other two providers as opposed to usinggetDefaultProvider
which doesn't allow me to send any API tokens.Any advice from the team on this matter?
The text was updated successfully, but these errors were encountered: