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

Run the emulator from a snapshot of Testnet or Mainnet #26

Closed
janezpodhostnik opened this issue Jan 21, 2021 · 5 comments
Closed

Run the emulator from a snapshot of Testnet or Mainnet #26

janezpodhostnik opened this issue Jan 21, 2021 · 5 comments
Assignees
Labels
Feature A new user feature or a new package API Feedback

Comments

@janezpodhostnik
Copy link
Contributor

Issue To Be Solved

Some applications will want to build on top of other applications already deployed on Flow.
This is difficult, given currently there is no way to simulate live network contracts and their state besides manually deploying those contracts on the Emulator, and generating interactions to arrive at the desired starting state.

(Optional): Suggest A Solution

Ability to load a slice of time/block delineated protocol state (Testnet or Mainnet) into the Emulator using a cli command.

@turbolent
Copy link
Member

turbolent commented Jan 21, 2021

I think what's required to make this work is an AN function to read individual register keys at a specific block height.

Then, the emulator's storage layer would transparently fetch the registers from another AN (e.g. testnet), and store the results locally. Basically, LedgerViewByHeight would return a delta view function which makes the request to the AN.

@10thfloor
Copy link
Contributor

10thfloor commented Jan 21, 2021

@turbolent sounds like this might take a while to implement? What about a set of scripts that automate deploying some of the contracts on the emulator, in the meantime?

@JeffreyDoyle
Copy link
Member

During an internal sync on how to tackle this, two ideas emerged:

  1. We could include a way for users to specify which contracts they want included when they boot up the emulator. These specified contracts could live in the flow.json file or in some other piece of configuration. We could also add other "core" contracts that aren't already included to be included by default.
  2. We could allow the user to load a snapshot of the testnet/mainnet state to their local machine and have the emulator read and write from this snapshot. In this method, the user could have access to identical chain state as it existed when the snapshot was created. All of the contracts and accounts that existed at the time of this snapshot would be available to users of the emulator in this method.

@sideninja
Copy link
Member

Closing in favour of buildathlon task.

@mwufi
Copy link

mwufi commented Sep 23, 2021

I'm curious... how does launching a development wallet help with this issue? I'm a bit new to Flow, so I don't get what scenarios having a FCL development wallet would help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new user feature or a new package API Feedback
Projects
None yet
Development

No branches or pull requests

7 participants