mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Move the Balance Transfer sample application from fabric-sdk-node to fabric-samples. This cr will add the files to the fabric-samples. There will another one to remove the files from fabric-sdk-node. Change-Id: I2344ee00bcd47793ae07f203070af93bc2ee69d6 Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
64 lines
1.3 KiB
Bash
Executable file
64 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Copyright IBM Corp. All Rights Reserved.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
function dkcl(){
|
|
CONTAINER_IDS=$(docker ps -aq)
|
|
echo
|
|
if [ -z "$CONTAINER_IDS" -o "$CONTAINER_IDS" = " " ]; then
|
|
echo "========== No containers available for deletion =========="
|
|
else
|
|
docker rm -f $CONTAINER_IDS
|
|
fi
|
|
echo
|
|
}
|
|
|
|
function dkrm(){
|
|
DOCKER_IMAGE_IDS=$(docker images | grep "dev\|none\|test-vp\|peer[0-9]-" | awk '{print $3}')
|
|
echo
|
|
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" = " " ]; then
|
|
echo "========== No images available for deletion ==========="
|
|
else
|
|
docker rmi -f $DOCKER_IMAGE_IDS
|
|
fi
|
|
echo
|
|
}
|
|
|
|
function restartNetwork() {
|
|
echo
|
|
|
|
#teardown the network and clean the containers and intermediate images
|
|
cd artifacts
|
|
docker-compose down
|
|
dkcl
|
|
dkrm
|
|
|
|
#Cleanup the material
|
|
rm -rf /tmp/hfc-test-kvs_peerOrg* $HOME/.hfc-key-store/ /tmp/fabric-client-kvs_peerOrg*
|
|
|
|
#Start the network
|
|
docker-compose up -d
|
|
cd -
|
|
echo
|
|
}
|
|
|
|
function installNodeModules() {
|
|
echo
|
|
if [ -d node_modules ]; then
|
|
echo "============== node modules installed already ============="
|
|
else
|
|
echo "============== Installing node modules ============="
|
|
npm install
|
|
fi
|
|
echo
|
|
}
|
|
|
|
|
|
restartNetwork
|
|
|
|
installNodeModules
|
|
|
|
PORT=4000 node app
|