From 86545d44c7911fe9fc5ab07d2fba307546abdf70 Mon Sep 17 00:00:00 2001 From: Sam Foo Date: Thu, 2 Nov 2023 11:43:56 -0700 Subject: [PATCH] doc: Add instructiosn to switch networks and volumes --- docs/switch-networks.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/switch-networks.md diff --git a/docs/switch-networks.md b/docs/switch-networks.md new file mode 100644 index 0000000..34013d7 --- /dev/null +++ b/docs/switch-networks.md @@ -0,0 +1,29 @@ +# Switch networks when using Docker Compose + +When running Marlowe starter kit, there are three different networks to use alongside the `NETWORK` environment variable: preview, preprod, and mainnet. + +Stop the running containers with: + +``` +$ docker-compose down +``` + +Notice the containers are removed although the volumes are not removed. List the volumes by: + +``` +$ docker volume ls +``` + +This is generally desirable because it allows running the starter kit on the same network with significantly less sync time in the future. + +However when switching networks without removing the volumes, the logs will show a network mismatch. The example below shows an attempt from switching between preprod to preview. + +``` +marlowe-starter-kit-node-1 | NetworkMagicMismatch "/data/db/protocolMagicId" (NetworkMagic {unNetworkMagic = 1}) (NetworkMagic {unNetworkMagic = 2}) +``` + +Remove the associated volumes by passing the volume flag. If the container is still running, the force flag (`-f`) may be needed as well to remove the volume. + +``` +docker-compose down -v +```