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

Export a snapshot of a running warnet simulation #4

Closed
josibake opened this issue Aug 15, 2023 · 6 comments
Closed

Export a snapshot of a running warnet simulation #4

josibake opened this issue Aug 15, 2023 · 6 comments
Labels
backlog feature backlog

Comments

@josibake
Copy link
Collaborator

The longer nodes run, the more rich their states become, such as wallet histories and AddrMan entries. Ideally, a user should be able to stop a simulation and pick back up later, or run a simulation for x days to "seed" certain behavior and then use this as the starting point. For this we would need to export the data directory for each node.

One easy way to do this could be create new contains from existing containers. This would capture everything and save them as images that can be used to restart the warnet from that point later

@pinheadmz
Copy link
Contributor

@josibake josibake added the backlog feature backlog label Aug 17, 2023
@pinheadmz
Copy link
Contributor

I think this can be accomplished without too much fuss. Strategy should be to iterate through all containers and use commit to freeze them into new images. The original docker-compose.yml file would need to be modified to load the newly created images instead but I think all the other settings in that file should still work. The consumer will need to load all the images into docker daemon and then compose-up the modified file. There is one other option we should include requested by @carlaKC which is to detach the warnet from real-world time. I'm pretty sure this can be done by disabling the systemd-timesyncd service in all containers. The goal would be to generate some bitcoin and LN activity, then stop time and freeze the warnet at a specific point such that the entire situation can be restarted from the snapshot in the future without the containers having actually lapsed any time.

@willcl-ark
Copy link
Contributor

Would it not just use the host time in docker?

@pinheadmz
Copy link
Contributor

Not sure, but the request is to stop time when the snapshot is created and continue from that exact second no matter when the snapshot is reloaded and continued.

@willcl-ark
Copy link
Contributor

Seems to be some other crazy ways about... https://croz.net/news/using-datefudge-to-fake-docker-date-time-for-testing/

Not sure, but the request is to stop time when the snapshot is created and continue from that exact second no matter when the snapshot is reloaded and continued.

This seems like a reasonable request. Seems like it could be best to test your way first. :)

@willcl-ark
Copy link
Contributor

Done in #555

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

No branches or pull requests

3 participants