Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: make forking work in the browser #3130

Merged
merged 7 commits into from
Jun 24, 2022
Merged

fix: make forking work in the browser #3130

merged 7 commits into from
Jun 24, 2022

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented May 25, 2022

Ganache's zero-config forking feature now works in the browser!

@davidmurdoch davidmurdoch changed the title Browser forking fix: make forking work in the browser May 27, 2022
@davidmurdoch davidmurdoch force-pushed the browser-forking branch 2 times, most recently from 02abbfe to 18fc14a Compare June 7, 2022 16:57
@davidmurdoch davidmurdoch marked this pull request as ready for review June 7, 2022 21:43
@davidmurdoch
Copy link
Member Author

You can test this by checking out this branch and then running:

$ npm run reinstall && INFURA_KEY=<YOUR INFURA KEY  HERE> npm run build && npm run docs.build && npm run docs.preview

then paste the following in any of the editors:

const p = ganache.provider({fork:"mainnet"});
console.log(await p.request({method:"debug_traceTransaction", params:["0x560900937892cd888a685c836f666804e05e04f3d161e1751ffb5ab7809c55d9"]}));

then wait a while for the result to appear (it can takes a lot of time).

Additionally, you should test the http handler code (the above tests WebSockets):

const p = ganache.provider({fork:{url: "<your infura url goes here>"}});
console.log(await p.request({method:"debug_traceTransaction", params:["0x560900937892cd888a685c836f666804e05e04f3d161e1751ffb5ab7809c55d9"]}));

Example:

image

index.html Outdated Show resolved Hide resolved
@davidmurdoch davidmurdoch force-pushed the browser-forking branch 2 times, most recently from 4831915 to 290f894 Compare June 16, 2022 16:49
Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

🚢 it!

Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Soooo cooooooool! All it needs is a release-ready PR description!

I've also pushed two changes to the README to this branch if you could review them. Let me know and I can remove this commits from your branch, I just knew you were out of town and thought it would be easier to push than have you go in and update the README.

@davidmurdoch
Copy link
Member Author

blocked by #3275

@davidmurdoch davidmurdoch dismissed MicaiahReid’s stale review June 23, 2022 18:36

There are no changes to address but GitHub demands I address them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants