stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
27 stars 37 forks source link

persist between start/stop ? #38

Closed garyng2000 closed 2 years ago

garyng2000 commented 3 years ago

While this is good for quick getting familiar test, there is no way to persist work. A typical use is I am working on some smart contracts and deployed today. down the road more and more are created and that depends on the states of previous transactions and/or other deployed contracts.

I have tried to persist mocket(which is basically just the postgresql content) as well as private-testnet(which is against a regtest bitcoin network).

both have their issue and doesn't work.

Without a way to persist a local development network, it make the development work 10x harder and almost impossible for any form of team development. In a sense, the whole thing becomes a cache setup and whenever the docker is restart(or host reboot), everything is gone.

The only alternative is just use the public testnet for development.

wileyj commented 3 years ago

Public testnet/mainnet data does persist - mocknet data should always be ephemeral by default, as it never syncs with anything. You can absolutely edit the docker-compose files (and the Config.toml) to support a mocknet with persistent data, but the use case we're aiming for doesn't include that.

I'll look into drawbacks of using persistent data for the private-testnet, however.

wileyj commented 3 years ago

I think this is worth pursuing - will have to add a new command to "wipe" the private-testnet data on request though, but shouldn't be too difficult

garyng2000 commented 3 years ago

I have edited the files but they just don't work properly, unfortunately. As for ephemeral, it is really easy given that we are talking about docker, just wipe the mapped volume(or don't map it) and it is gone. So getting things from empty state is easy, getting them persist ? unfortunately I can't find a way.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.