-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
The document in question: Run a Private Network with Docker.
As best I can tell, if you stop the network (docker-compose down) and then start it up again, the network's history begins again from scratch because the database directories are not persisted. This may surprise users following the tutorial, depending on their familiarity and expectations for Docker containers.
Presumably, if you change the docker-compose.yml file to map database directories in each container to folders on the host, it should persist the data across runs allowing you to resume the network from where it was before, probably¹.
We should update the tutorial to (a) warn users that ledger/transaction data isn't persisted when you stop & start the network, and (b) explain how to reconfigure the network to persist data in case they want to do that.
¹ Resuming a network from a standstill is, I think, a somewhat delicate operation that isn't thoroughly tested/understood and might involve some tricky stuff to get the validators to achieve a consensus on the ledger that you expect them to—there may still be some non-deterministic behavior depending on timing details of where the validators were when they shut down and how close together they are when they come back up. This may be mitigated in this scenario since in the Docker container the validators are pretty uniform and will probably be starting at about the same time, but it's at least worth testing that it works reliably.