vegaprotocol / vegacapsule

Run a complete Vega Protocol network locally
MIT License
4 stars 7 forks source link

Add command that `unsafe-reset-all`'s everything #37

Closed wwestgarth closed 2 years ago

wwestgarth commented 2 years ago

Being able to start and stop a network is amazing, but both tendermint and vega's state persists. This means that when you restart the network the vega core will replay all the blocks. Sometime's, though, you just want to start from fresh again (without having to do the lengthy destroy/bootstrap).

It would be useful if there were a vegacapsule state unsafe_reset_all or something that when the network is stopped, will go and call vega tm unsafe-reset-all and vega unsafe_reset_all for all the nodes.

daniel1302 commented 2 years ago

I was working with a few people and I found an interesting thing. Let's say We have the following use case:

The problem

Wwhen the PyCharm is restarted for any reason (like: plugin upgrade, crash, by users mistake...), the nomad is killed but network processes are orphaned. It means you cannot start a new network because old programs are running and you can see: Cannot bind-address: 0.0.0.0:XXXXX. Port already in use

I think We should add a flag for this command(maybe --kill-processes) to kill all processes. Names for processes We should take from the configuration.

daniel1302 commented 2 years ago

I just did a workaround for the system tests, but it may be done better here: https://github.com/vegaprotocol/system-tests/pull/595/files#diff-8b119a9bacccbd06b544bc77467bcd92e68bd86f980367cb45d4379496759f46R246-R251

karlem commented 2 years ago

Close with #59