mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Re-enable CI tests for asset-transfer-private-data JavaScript application. Also re-add the error when private asset details are not found in the collection, so that the CLI instructions work as desired, and to demonstrate error handing in the client application. Signed-off-by: David Enyeart <enyeart@us.ibm.com>
34 lines
909 B
Bash
Executable file
34 lines
909 B
Bash
Executable file
set -euo pipefail
|
|
|
|
FABRIC_VERSION=${FABRIC_VERSION:-2.2}
|
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
|
CHAINCODE_NAME=${CHAINCODE_NAME:-private}
|
|
|
|
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 -i "${FABRIC_VERSION}"
|
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
|
|
}
|
|
|
|
function stopNetwork() {
|
|
print "Stopping network"
|
|
./network.sh down
|
|
}
|
|
|
|
# Run Javascript application
|
|
createNetwork
|
|
print "Initializing Javascript application"
|
|
pushd ../asset-transfer-private-data/application-javascript
|
|
npm install
|
|
print "Executing app.js"
|
|
node app.js
|
|
popd
|
|
stopNetwork
|