forked from Xandyhoss/blockbank-cc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartDev.sh
executable file
·36 lines (30 loc) · 856 Bytes
/
startDev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
ORG_QNTY=3
while getopts n: opt; do
case $opt in
n) ORG_QNTY=${OPTARG}
;;
esac
done
if [ $ORG_QNTY != 3 -a $ORG_QNTY != 1 ]
then
echo 'WARNING: The number of organizations allowed is either 3 or 1.'
echo 'Defaulting to 3 organizations.'
ORG_QNTY=3
fi
# Clear unused images and volumes
docker rmi $(docker images --quiet --filter "dangling=true")
docker volume rm $(docker volume ls -qf dangling=true)
# Script used to start the development environment.
if [ ! -d "chaincode/vendor" ]; then
cd ./chaincode; go mod vendor; cd ..
fi
cd ./chaincode; go fmt ./...; cd ..
cd ./fabric; ./startDev.sh -n $ORG_QNTY; cd ..
## This brings up API in Go
if [ $ORG_QNTY == 1 ]
then
cd ./ccapi; docker-compose -f docker-compose-1org.yaml up -d; cd ..
else
cd ./ccapi; docker-compose up -d; cd ..
fi