When first time I deployed any business network I can connect the network and composer-playground
. But when I restart my PC after shutdown, I can't connect the network but the composer-playground
showing the card related the network and can connect by the card. Should I need to deploy business network every time after opening my PC?
Asked
Active
Viewed 61 times
1

mohammadjh
- 722
- 5
- 12
2 Answers
2
When you restart the environment with ./startFabric.sh
all of the dev environment gets re-initialized. If you want not to lose the earlier deployed BNA then don't use ./startFabric
& ./stopFabric
scripts. You have to run docker-compose stop
to stop fabric containers in ./fabric-scripts/hlfv1/composer
. When restart your dev environment then run docker ps -q -a | xargs docker start
. This will start all dangling containers.

user8029684
- 21
- 2
-
indeed or just `docker-compose start` from the same directory as pointed out above to make use of the docker-compose.yml file – Paul O'Mahony Mar 23 '18 at 15:02
2
I created a bash script
named fabricDev
so that I can easily start and stop docker-compose
of Fabric. I added as an answer so that others can use this script.
fabricDev.sh
#!/bin/bash
start_fabric() {
cd ./fabric-scripts/hlfv1/composer
docker-compose start
echo
echo 'Fabric DEV environment started'
}
stop_fabric() {
cd ./fabric-scripts/hlfv1/composer
docker-compose stop
echo
echo 'Fabric DEV environment stopped'
}
case $1 in
start)
start_fabric
;;
stop)
stop_fabric
;;
*)
esac
Need to run ./fabricDev.sh stop
and ./fabricDev.sh start

mohammadjh
- 722
- 5
- 12