Is there a way to persist the sandbox’s state so that it doesn’t get lost if I stop and restart the sandbox?
The easiest thing to do would be to follow these that show how you can attach a PostgreSQL DB to Sandbox for persistence.
Hope this helps
@nemanja is this still possible today?
Yes, it’s still possible. On the referenced page there’s this section:
Behind the scenes, Sandbox spins up a Canton ledger with an in-memory participant
sandboxand an in-memory domain
local. You can pass additional Canton configuration files via
-c. This option can be specified multiple times and the resulting configuration files will be merged
Then just take a look at setting up persistence with Postgres