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

Managing state #126

Closed
sideninja opened this issue Mar 29, 2021 · 0 comments
Closed

Managing state #126

sideninja opened this issue Mar 29, 2021 · 0 comments
Assignees
Labels
Feature A new user feature or a new package API Feedback

Comments

@sideninja
Copy link
Contributor

There has been a lot of feedback on the creation of accounts in the emulator.
I believe a lot of expectation comes from other blockchains where you have a seed from which you deterministically derive account address which is not the case on Flow. Developers want to create some accounts, deploy contracts and then work on that state even between restarts for multiple days.

I don't believe the solution is in the config. Configuration should be used to set values we will use to execute commands. Not values that are meant to be used to do some work in the background (like setting up the state).

However, this problem needs solving.

I propose we create commands that will enable us to capture the emulator state and start the emulator from a certain state.

An example of such usage would be:
flow project init - we initialize the project
flow emulator start - we start the emulator (fresh)
flow accounts create - we create the first account on the emulator
flow transactions send - we send some tx
flow emulator save kitty-init - we save a state
flow emulator stop - we are satisfied with work and go to sleep

next day:
flow emulator start kitty-init-state - we go back where we started
flow transactions send - upss we made a mistake with the tx
flow emulator restart kitty-init - we restart
flow transactions send - we create a new resource on flow
flow emulator save kitty-new-kibble - we save the new state
flow emulator remove kitty-new-kibble - we remove saved state

This way we could have some prerequisites setup that would allow us to have existing accounts created etc.

This is not to be confused for flow project deploy which will still deploy contracts in config and could and should be used with this state management.

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

Successfully merging a pull request may close this issue.

2 participants