Skip to content

PoC: Command to run ganache with mainnet fork + env var to pre-populate development state#19389

Closed
danjm wants to merge 4 commits intodevelopfrom
run-ganache-mainnet-fork
Closed

PoC: Command to run ganache with mainnet fork + env var to pre-populate development state#19389
danjm wants to merge 4 commits intodevelopfrom
run-ganache-mainnet-fork

Conversation

@danjm
Copy link
Copy Markdown
Contributor

@danjm danjm commented Jun 1, 2023

Explanation

The usual local development flow is this:

  1. Run yarn start
  2. Wait for build to complete
  3. Install local build in chrome
  4. Go through onboarding to the point where you need to import seed phrase
  5. Go to the repo or a local file to copy your development seed phrase
  6. Complete onboarding (which will require closing notifications like the what's new notifications)
  7. Open the network dropdown
  8. If you have goerli or sepolia eth, open the network dropdown, click "Show/hide test networks", then toggle on that setting, then open the network dropdown again and select the test net where you have your eth, and now you can go to step 11. If you don't have goerli or sepolia eth, proceed to step 9
  9. Run ganache locally with yarn start:ganache, or (more effectively) with the flags to fork mainnet (which requires finding your infura id and copying and pasting it into the correct flags)
  10. Open the network dropdown, click "Add Network", then click "Add a network manually", then fill in the appropriate details.
  11. Start using MetaMask for local development

The changes in this PR simplify this to:

  1. Run yarn start:devState
  2. Wait for build to complete
  3. Install local build in chrome
  4. Start using MetaMask for local development

Opening as a draft for demo and comment.

Screenshots/Screencaps

Before

After

Manual Testing Steps

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 1, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Jul 31, 2023
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Aug 14, 2023
pedronfigueiredo added a commit that referenced this pull request May 27, 2024
## **Description**

- Implements a new development build script that skips onboarding by
preloading state from the end-to-end test fixtures.
- The vault state is dynamically generated from the environment
variables `TEST_SRP` and `PASSWORD`.
- This build hides all the "What's New?" modals and the "Product Tour"
as well as all onboarding screens.
- The network is set to "Sepolia" by default.
- Alternatively, onboarding can be skipped without setting a `TEST_SRP`,
in which case the e2e tests SRP and accounts are used.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/23781?quickstart=1)

## **Related issues**

Related: #23615, #19389

## **Manual testing steps**

1. Checkout this branch
2. Set a `TEST_SRP` environment variable on your `.metamaskrc` file as
well as `PASSWORD` if you haven't already
3. Run `yarn start:skip-onboarding`
4. Load the extension on your favorite browser and open the popup

## **Screenshots/Recordings**

### **After**



https://github.com/MetaMask/metamask-extension/assets/13814744/e34bac0f-8f6f-4d04-8452-b9962c99cfb9



## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@HowardBraham HowardBraham deleted the run-ganache-mainnet-fork branch January 19, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale issues and PRs marked as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant