Skip to content
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

Change local rpc #1101

Merged
merged 3 commits into from
Jul 12, 2023
Merged

Change local rpc #1101

merged 3 commits into from
Jul 12, 2023

Conversation

kuzdogan
Copy link
Member

@kuzdogan kuzdogan commented Jul 11, 2023

PR to change the primary Ethereum nodes used by Sourcify (Mainnet, Goerli, Sepolia). Instead of the LAN ones we use the ethpandaops' nodes.

Since the authentication is done through Headers, we had to change the rpc field in the sourcify-chains.ts into an ethers.js FetchRequest.

With that I also abstracted away the blockchain connections (getTx, getBytecode etc.) into a class called SourcifyChain inside lib-sourcify, such that we don't need to go through redundantly checking the rpcUrl + creating the JsonRpc or Websocket providers + sequentially trying the providers with the same sequential logic spread out to different places. With this, we have everything wrapped in SourcifyChain methods, and there's no need to create a new Provider every single time.

View in Huly HI-546

@kuzdogan kuzdogan force-pushed the change-local-rpc branch 2 times, most recently from 877e36f to 3b713de Compare July 11, 2023 12:46
@kuzdogan kuzdogan marked this pull request as ready for review July 11, 2023 13:53
@kuzdogan kuzdogan requested a review from marcocastignoli July 11, 2023 13:53
Copy link
Member

@marcocastignoli marcocastignoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now much more readable having the SoucifyChain class. I read the edits multiple times but I cannot find any problem, 💯 again

@kuzdogan kuzdogan merged commit ea03169 into staging Jul 12, 2023
@kuzdogan kuzdogan deleted the change-local-rpc branch December 19, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants