forked from hyperledger/fabric-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-test-network-ledger.sh
More file actions
executable file
·43 lines (37 loc) · 1.02 KB
/
Copy pathrun-test-network-ledger.sh
File metadata and controls
executable file
·43 lines (37 loc) · 1.02 KB
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
37
38
39
40
41
42
43
set -euo pipefail
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
CHAINCODE_NAME=${CHAINCODE_NAME:-ledger}
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-ledger-queries}
function print() {
GREEN='\033[0;32m'
NC='\033[0m'
echo
echo -e "${GREEN}${1}${NC}"
}
function createNetwork() {
print "Creating network"
./network.sh up createChannel -ca -s couchdb
print "Deploying ${CHAINCODE_NAME} chaincode"
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}"
}
function stopNetwork() {
print "Stopping network"
./network.sh down
}
# Run Java application
createNetwork
print "Initializing Java application"
pushd ../asset-transfer-ledger-queries/application-java
print "Executing Gradle Run"
./gradlew run
popd
stopNetwork
# Run Javascript application
createNetwork
print "Initializing Javascript application"
pushd ../asset-transfer-ledger-queries/application-javascript
npm install
print "Executing app.js"
node app.js
popd
stopNetwork