diff --git a/hyperledger_fabric/test/auto.sh b/hyperledger_fabric/test/auto.sh index 559a4d4e..1e92283d 100644 --- a/hyperledger_fabric/test/auto.sh +++ b/hyperledger_fabric/test/auto.sh @@ -1,2 +1,25 @@ -bash fetch-config-block.sh dhanNodeOUf1 testchainid dhannodeouf1-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20003 -bash fetch-config-block.sh dhanNodeOUf1 nodeouchannel01 dhannodeouf1-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20003 +#bash fetch-config-block.sh dhanNodeOUf1 testchainid dhannodeouf1-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20003 +#bash fetch-config-block.sh dhanNodeOUf1 nodeouchannel01 dhannodeouf1-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20003 + +mspId=AutoF4970445621 +endorPolicy="OR('dh0728fab2f3.member')" +peerAddr=autof4970445621-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20009 +#peerAddr=autop4970512879-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20009 +ordererAddr=autof4970445621-bcsnativetest-iad.blockchain.test.ocp.oc-test.com:20003 +channelId=volvotestmultiorg3 +ccName=volvooriginal3 +ccVersion=v1 +ccLabel=${ccName}_${ccVersion} +ccPkg=${ccName}.tar.gz +packageId="${ccName}:bed6b22c90562f2f87d2303895064718c6fa98566a637b58b4037c5082f52777" + +#bash cc-package.sh ${mspId} ${ccName} $PWD/${ccName} ${ccLabel} +#bash cc-install.sh ${mspId} ${peerAddr} ${ccPkg} +#bash cc-approve.sh ${mspId} ${channelId} ${peerAddr} ${ordererAddr} ${ccName} ${ccVersion} ${packageId} ${endorPolicy} +#bash cc-commit.sh ${mspId} ${channelId} ${peerAddr} ${ordererAddr} ${ccName} ${ccVersion} ${endorPolicy} +#bash cc-invoke.sh ${mspId} ${channelId} ${peerAddr} ${ordererAddr} ${ccName} +#bash cc-list-installed.sh ${mspId} ${peerAddr} +#bash cc-list-instantiated.sh ${mspId} ${channelId} ${peerAddr} +#bash cc-getData.sh ${mspId} ${channelId} ${peerAddr} ${ccName} +bash discover.sh ${mspId} ${channelId} ${peerAddr} ${ccName} +#bash cc-marble-test.sh ${mspId} ${channelId} ${peerAddr} ${ordererAddr} ${ccName} diff --git a/hyperledger_fabric/test/cc-approve.sh b/hyperledger_fabric/test/cc-approve.sh new file mode 100644 index 00000000..04d762c3 --- /dev/null +++ b/hyperledger_fabric/test/cc-approve.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Approve a chaincode definition +# Usage: ./script mspId channelID peerAddr ordererAddr ccName ccVersion packageId endorPolicy mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 8 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId channelID peerAddr ordererAddr ccName ccVersion packageId endorPolicy mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local channelID=$2 + local peerAddr=$3 + local ordererAddr=$4 + local ccName=$5 + local ccVersion=$6 + local packageId=$7 + local endorPolicy=$8 + local mspPath=${9:-${PWD}/msp-${mspId}} # Suppose the local msp named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + echo "approve chaincode definition peerAddr=${peerAddr}, channelID=${channelID}, ccVersion=${ccVersion}, packageId=${packageId}, endorPolicy=${endorPolicy}, ordererAddr=${ordererAddr}" + peer lifecycle chaincode approveformyorg \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + --channelID ${channelID} \ + --name ${ccName} \ + --version ${ccVersion} \ + --init-required \ + --package-id ${packageId} \ + --sequence 1 \ + --signature-policy "${endorPolicy}" \ + --waitForEvent \ + --orderer ${ordererAddr} \ + --tls true \ + --cafile ${CORE_PEER_TLS_ROOTCERT_FILE} + + exit 0 +} + +main "$@" \ No newline at end of file diff --git a/hyperledger_fabric/test/cc-commit.sh b/hyperledger_fabric/test/cc-commit.sh new file mode 100644 index 00000000..da5b5b53 --- /dev/null +++ b/hyperledger_fabric/test/cc-commit.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Commit a chaincode definition +# Usage: ./script mspId peerAddr channelId ccName ccVersion endorPolicy ordererAddr mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 7 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId peerAddr channelId ccName ccVersion endorPolicy ordererAddr mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local channelId=$2 + local peerAddr=$3 + local ordererAddr=$4 + local ccName=$5 + local ccVersion=$6 + local endorPolicy=$7 + local mspPath=${8:-${PWD}/msp-${mspId}} # Suppose the local msp named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + echo "commit chaincode definition peerAddr=${peerAddr}, channelId=${channelId}, ccVersion=${ccVersion}, endorPolicy=${endorPolicy}, ordererAddr=${ordererAddr}" + peer lifecycle chaincode commit \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + --channelID ${channelId} \ + --name ${ccName} \ + --version ${ccVersion} \ + --init-required \ + --sequence 1 \ + --signature-policy "${endorPolicy}" \ + --waitForEvent \ + --orderer ${ordererAddr} \ + --tls true \ + --cafile ${CORE_PEER_TLS_ROOTCERT_FILE} + + peer lifecycle chaincode querycommitted \ + --peerAddresses ${peerAddr} \ + --tlsRootCertFiles ${CORE_PEER_TLS_ROOTCERT_FILE} \ + --channelID ${channelId} \ + --output json \ + --name ${ccName} + + exit 0 +} + +main "$@" \ No newline at end of file diff --git a/hyperledger_fabric/test/cc-getData.sh b/hyperledger_fabric/test/cc-getData.sh new file mode 100644 index 00000000..cc580975 --- /dev/null +++ b/hyperledger_fabric/test/cc-getData.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# Get the chaincode data +# Usage: ./script mspId channelID peerAddr ccName + +setupChaincode() { + local channelID=$1 + local peerAddr=$2 + local tlsca_file=$3 + + peer chaincode instantiate \ + -o "dhnodeouf5-bcsnativepreprod-iad.blockchain.ocp.oc-test.com:20003" \ + -C ${channelID} \ + -n "exp02" \ + -v "v1" \ + -c '{"Args":["init","a","100","b","200"]}' \ + -P "OR ('dhnodeOUf5.peer','dhnodeOUf6.peer')" \ + --tls \ + --cafile ${tlsca_file} \ + --peerAddr ${peerAddr} \ + --tlsRootCertFiles ${tlsca_file} +} + +# getChaincodeData get the instantiated chaincode information +# Usage: getChaincodeData channelID peerAddr ccName +getChaincodeData() { + local channelID=$1 + local peerAddr=$2 + local ccName=$3 + local tlsca_file=$4 + + peer chaincode query \ + --connTimeout 10s \ + --channelID ${channelID} \ + -n "lscc" \ + -c '{"Args":["getccdata","'${channelID}'","'${ccName}'"]}' \ + --tls \ + --peerAddresses ${peerAddr} \ + --tlsRootCertFiles ${tlsca_file} \ + > chaincode.ccdata + + peer chaincode query \ + --connTimeout 10s \ + --channelID ${channelID} \ + -n "lscc" \ + -c '{"Args":["getdepspec","'${channelID}'","'${ccName}'"]}' \ + --tls \ + --peerAddresses ${peerAddr} \ + --tlsRootCertFiles ${tlsca_file} \ + > chaincode.depspec +} + +if [ $# -eq 0 ]; then + echo "Please use the as the argument" + exit +fi + +mspId=$1 +channelID=$2 +peerAddr=$3 +ccName=$4 + +echo "mspId=${mspId}" +echo "channelID=${channelID}" +echo "peerAddr=${peerAddr}" +echo "ccName=${ccName}" + +msp_path=${PWD}/msp-${mspId} # Suppose the local msp path named as msp-${mspId} + +export FABRIC_LOGGING_SPEC="debug" +export CORE_PEER_LOCALMSPID=${mspId} +#export CORE_PEER_ADDRESS=${peerAddr} +export CORE_PEER_MSPCONFIGPATH=${msp_path} +export CORE_PEER_TLS_ROOTCERT_FILE=${msp_path}/tlscacerts/tlsca.cert +export CORE_PEER_TLS_ENABLED=true + +#setupChaincode ${channelID} ${peerAddr} ${msp_path}/tlscacerts/tlsca.cert +getChaincodeData ${channelID} ${peerAddr} ${ccName} ${msp_path}/tlscacerts/tlsca.cert diff --git a/hyperledger_fabric/test/cc-install-1.4.sh b/hyperledger_fabric/test/cc-install-1.4.sh new file mode 100644 index 00000000..376f73cf --- /dev/null +++ b/hyperledger_fabric/test/cc-install-1.4.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Install a chaincode +# Usage: ./script mspId peerAddr mspPath=${PWD}/msp-mspId name version path + +# Entry function +main() { + if [ $# -lt 5 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId peerAddr mspPath=${PWD}/msp-mspId name version path" + exit 1 + fi + + local mspId=$1 + local peerAddr=$2 + local mspPath=${3:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} + local name=$4 + local version=$5 + local path=$6 + local lang="golang" + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + #export GRPC_GO_REQUIRE_HANDSHAKE=off + + peer chaincode install \ + -n ${name} \ + -v $version \ + -p ${path} \ + -l ${lang} \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" + + exit 0 +} + +main "$@" \ No newline at end of file diff --git a/hyperledger_fabric/test/cc-install.sh b/hyperledger_fabric/test/cc-install.sh new file mode 100644 index 00000000..d445f121 --- /dev/null +++ b/hyperledger_fabric/test/cc-install.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Install a chaincode from package +# Usage: ./script mspId peerAddr ccPkg mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 3 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId peerAddr ccPkg mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local peerAddr=$2 + local ccPkg=$3 + local mspPath=${4:-${PWD}/msp-${mspId}} # Suppose the local msp named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + echo "installing chaincode to peer=${peerAddr}" + peer lifecycle chaincode install \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + ${ccPkg} + + exit 0 + + peer lifecycle chaincode queryinstalled \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + --output json + + exit 0 +} + +main "$@" \ No newline at end of file diff --git a/hyperledger_fabric/test/cc-invoke.sh b/hyperledger_fabric/test/cc-invoke.sh index 80415bf2..1ccf3b6f 100644 --- a/hyperledger_fabric/test/cc-invoke.sh +++ b/hyperledger_fabric/test/cc-invoke.sh @@ -1,19 +1,19 @@ #!/bin/bash # Invoke a chaincode -# Usage: ./script mspId channel ordererAddr peerAddr ccName mspPath=${PWD}/msp-mspId +# Usage: ./script mspId channelId peerAddr ordererAddr ccName mspPath=${PWD}/msp-mspId # Entry function main() { if [ $# -lt 5 ]; then echo "Not enough argument supplied" - echo "$(basename $0) mspId channel ordererAddr peerAddr ccName mspPath=${PWD}/msp-mspId" + echo "$(basename $0) mspId channelId peerAddr ordererAddr ccName mspPath=${PWD}/msp-mspId" exit 1 fi local mspId=$1 - local channel=$2 - local ordererAddr=$3 - local peerAddr=$4 + local channelId=$2 + local peerAddr=$3 + local ordererAddr=$4 local ccName=$5 local mspPath=${6:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} @@ -27,23 +27,23 @@ main() { peer chaincode invoke \ --connTimeout="30s" \ -o "${ordererAddr}" \ - -C "${channel}" \ + -C "${channelId}" \ -n "${ccName}" \ --peerAddresses "${peerAddr}" \ --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ - -c '{"Args":["invoke","a","b","10"]}' \ + -c '{"Args":["Init","a","100","b","100"]}' \ + --isInit \ --tls \ --cafile "${CORE_PEER_TLS_ROOTCERT_FILE}" - - exit 0 + #-c '{"Args":["invoke","a","b","10"]}' \ peer chaincode query \ --connTimeout=30s \ - -C "${channel}" \ + -C "${channelId}" \ -n "${ccName}" \ --peerAddresses "${peerAddr}" \ --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ - -c '{"Args":["query","b"]}' + -c '{"Args":["query","a"]}' } main "$@" diff --git a/hyperledger_fabric/test/cc-list-installed.sh b/hyperledger_fabric/test/cc-list-installed.sh index c82838cc..b3ad7140 100644 --- a/hyperledger_fabric/test/cc-list-installed.sh +++ b/hyperledger_fabric/test/cc-list-installed.sh @@ -29,12 +29,6 @@ main() { --peerAddresses "${peerAddr}" \ --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" - peer chaincode list \ - --connTimeout=30s \ - --instantiated \ - --peerAddresses "${peerAddr}" \ - --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" - exit 0 } diff --git a/hyperledger_fabric/test/cc-list-instantiated.sh b/hyperledger_fabric/test/cc-list-instantiated.sh new file mode 100644 index 00000000..0a3388e8 --- /dev/null +++ b/hyperledger_fabric/test/cc-list-instantiated.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Invoke a chaincode +# Usage: ./script mspId channelID peerAddr mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 2 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId channelID peerAddr mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local channelID=$2 + local peerAddr=$3 + local mspPath=${4:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + peer chaincode list \ + --connTimeout=30s \ + --channelID "${channelID}" \ + --instantiated \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" + + exit 0 +} + +main "$@" diff --git a/hyperledger_fabric/test/cc-marble-test.sh b/hyperledger_fabric/test/cc-marble-test.sh new file mode 100644 index 00000000..ec495800 --- /dev/null +++ b/hyperledger_fabric/test/cc-marble-test.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Invoke a chaincode +# Usage: ./script mspId channelId peerAddr ordererAddr ccName mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 5 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId channelId peerAddr ordererAddr ccName mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local channelId=$2 + local peerAddr=$3 + local ordererAddr=$4 + local ccName=$5 + local mspPath=${6:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="info" + export CORE_PEER_ADDRESS="${peerAddr}" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + for i in {550..1000} + do + export MARBLE=$(echo -n "{\"name\":\"test02-marble$i\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64 | tr -d \\n) + echo $MARBLE | base64 --decode + + peer chaincode invoke \ + --connTimeout="30s" \ + -o "${ordererAddr}" \ + -C "${channelId}" \ + -n "${ccName}" \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + -c '{"Args":["initMarble"]}' \ + --transient "{\"marble\":\"$MARBLE\"}" \ + --tls \ + --cafile "${CORE_PEER_TLS_ROOTCERT_FILE}" + #-c '{"Args":["invoke","a","b","10"]}' \ + done + + exit 0 + + peer chaincode query \ + --connTimeout="30s" \ + -C "${channelId}" \ + -n "${ccName}" \ + --peerAddresses "${peerAddr}" \ + --tlsRootCertFiles "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + -c '{"Args":["readMarblePrivateDetails","test-marble03"]}' \ + --tls \ + --cafile "${CORE_PEER_TLS_ROOTCERT_FILE}" + #-c '{"Args":["readMarble","test-marble1"]}' \ + + exit 0 + +} + +main "$@" diff --git a/hyperledger_fabric/test/cc-package.sh b/hyperledger_fabric/test/cc-package.sh new file mode 100644 index 00000000..6727b9e9 --- /dev/null +++ b/hyperledger_fabric/test/cc-package.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Package a chaincode +# Usage: ./script mspId ccName ccPath ccLabel ccLang=golang mspPath=${PWD}/msp-mspId + +# Entry function +main() { + if [ $# -lt 4 ]; then + echo "Not enough argument supplied" + echo "$(basename $0) mspId ccName ccPath ccLabel ccLang=golang mspPath=${PWD}/msp-mspId" + exit 1 + fi + + local mspId=$1 + local ccName=$2 + local ccPath=$3 + local ccLabel=$4 + local ccLang=${5:-golang} + local mspPath=${6:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} + + export FABRIC_LOGGING_SPEC="debug" + export CORE_PEER_LOCALMSPID=${mspId} + export CORE_PEER_MSPCONFIGPATH=${mspPath} + export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert + export CORE_PEER_TLS_ENABLED=true + + echo "packaging chaincode=${ccName} with path=${ccPath}, label=${ccLabel}, lang=${ccLang}" + peer lifecycle chaincode package ${ccName}.tar.gz \ + --path ${ccPath} \ + --label ${ccLabel} \ + --lang ${ccLang} + + exit 0 +} + +main "$@" \ No newline at end of file diff --git a/hyperledger_fabric/test/discover.sh b/hyperledger_fabric/test/discover.sh index 25c0c49a..930c3562 100644 --- a/hyperledger_fabric/test/discover.sh +++ b/hyperledger_fabric/test/discover.sh @@ -16,13 +16,36 @@ main() { local ccName=$4 local mspPath=${5:-${PWD}/msp-${mspId}} # Suppose the local msp path named as msp-${msp_id} - export FABRIC_LOGGING_SPEC="debug" + export FABRIC_LOGGING_SPEC="info" export CORE_PEER_ADDRESS="${peerAddr}" export CORE_PEER_LOCALMSPID=${mspId} export CORE_PEER_MSPCONFIGPATH=${mspPath} export CORE_PEER_TLS_ROOTCERT_FILE=${mspPath}/tlscacerts/tlsca.cert export CORE_PEER_TLS_ENABLED=true + for i in {1..1000}; do + echo "round $i" + discover \ + --peerTLSCA "${CORE_PEER_TLS_ROOTCERT_FILE}" \ + --userKey ${mspPath}/keystore/${mspId}-key \ + --userCert ${mspPath}/signcerts/${mspId}-cert.pem \ + --MSP "${mspId}" \ + peers \ + --channel "${channel}" \ + --server "${peerAddr}" > peers.json + + if [ $(jq length peers.json) == 2 ]; then + echo "2" + else + cat peers.json + cp peers.json peers-${i}.json + fi + sleep 1 + done + exit 0 + +for i in {1..1000}; do + echo "round $i" discover \ --peerTLSCA "${CORE_PEER_TLS_ROOTCERT_FILE}" \ --userKey ${mspPath}/keystore/${mspId}-key \ @@ -31,7 +54,17 @@ main() { endorsers \ --channel "${channel}" \ --chaincode "${ccName}" \ - --server "${peerAddr}" + --server "${peerAddr}" > endorsers.json + + if [ $(jq '.[0].EndorsersByGroups|length' endorsers.json) == 2 ]; then + echo "2" + else + cat endorsers.json + cp endorsers.json endorsers-1.json + fi + sleep 1 + done + #--tlsCert tls/client.crt \ #--tlsKey tls/client.key \ } diff --git a/hyperledger_fabric/test/genMSP.sh b/hyperledger_fabric/test/genMSP.sh index 2f8d82f9..cd64c197 100644 --- a/hyperledger_fabric/test/genMSP.sh +++ b/hyperledger_fabric/test/genMSP.sh @@ -34,3 +34,6 @@ jq -r .certs.cacert "${cert_file}" > "msp-${mspId}/cacerts/ca.cert" echo "Get admincerts from ${admin_dir}" cp "${admin_dir}/${mspId}-cert.pem" "msp-${mspId}/admincerts/" + +echo "Clean the temp dir of ${mspId}-admin-credential" +rm -rf ${mspId}-admin-credential \ No newline at end of file