-
Notifications
You must be signed in to change notification settings - Fork 5k
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
7203 - Alchemy rpc provider #7296
base: 4.x
Are you sure you want to change the base?
Conversation
let host = ''; | ||
let token = ''; | ||
|
||
switch (network) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Network.POLYGON_AMOY]: 'polygon-amoy.g.alchemy.com', | ||
[Network.OPTIMISM_MAINNET]: 'opt-mainnet.g.alchemy.com', | ||
[Network.OPTIMISM_SEPOLIA]: 'opt-sepolia.g.alchemy.com', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this screenshot from web.js? Wondering if this is an accurate list of the chains to support with Alchemy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@avkos Made some changes, not sure if all the chains I added are to be supported but lmk.
web3.provider?.disconnect(); | ||
} | ||
}); | ||
it(`AlchemyProvider should work with ${transport} transport and ${network} network`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding all platforms it will be a different array of networks. so it will be better to have separate const networksAlchemy
and separate test networksAlchemy.forEach
5103d29
to
b17f49d
Compare
Co-authored-by: Junaid <[email protected]>
7aefd55
to
2982118
Compare
97135dc
to
2982118
Compare
# Conflicts: # packages/web3-rpc-providers/src/types.ts # packages/web3/test/integration/web3RPCProviders.test.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks @MRLab12 for your contribution,
It seems great now. I think, once other team members approve, we can merge this MR.
I'm trying to run integration tests locally but having issues. Looking at the test errors here, most likely a missing Alchemy key is the issue. Can someone point me to how this should be set up? |
Description
I have opened this Draft PR to make sure I did the correct changes and get some feedback since this is my first contribution here.This PR adds an Alchemy provider in
web3-rpc-providers
. I matched the design of the Quicknode provider.For testing, I wasn't sure if a test for this provider should actually try to make a request. Should we consider mocking? I want to learn more about how testing is done in web3.js.
Fixes #7203
Type of change
Checklist:
npm run lint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:coverage
and my test cases cover all the lines and branches of the added code.npm run build
and testeddist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.