mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
* initial commit Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> Code refactor Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * readme Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * lint fix Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * adopted best practises Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * code refactor Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * updated azure pipeline to include the app Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * mapped json and client object Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * Moved contract interactions to contractWrapper Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * salt value unexported Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * moved try catch from contract wrapper to app Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * contract wrapper refactor moved interfaces from utils to contract wrapper Signed-off-by: sapthasurendran <saptha.surendran@ibm.com> * exported data objects Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
48 lines
1.2 KiB
Bash
Executable file
48 lines
1.2 KiB
Bash
Executable file
set -euo pipefail
|
|
|
|
CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go}
|
|
CHAINCODE_NAME=${CHAINCODE_NAME:-secured}
|
|
CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-secured-agreement}
|
|
|
|
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
|
|
print "Deploying ${CHAINCODE_NAME} chaincode"
|
|
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
|
|
}
|
|
|
|
function stopNetwork() {
|
|
print "Stopping network"
|
|
./network.sh down
|
|
}
|
|
|
|
# Run Javascript application
|
|
createNetwork
|
|
print "Initializing Javascript application"
|
|
pushd ../asset-transfer-secured-agreement/application-javascript
|
|
npm install
|
|
print "Executing app.js"
|
|
node app.js
|
|
popd
|
|
stopNetwork
|
|
print "Remove wallet storage"
|
|
rm -R ../asset-transfer-secured-agreement/application-javascript/wallet
|
|
|
|
# Run Typescript Gateway application
|
|
createNetwork
|
|
print "Initializing typescript application"
|
|
pushd ../asset-transfer-secured-agreement/application-gateway-typescript
|
|
npm install
|
|
print "Build app"
|
|
npm run build
|
|
print "Executing dist/app.js"
|
|
npm start
|
|
popd
|
|
stopNetwork
|