From 97d32fe861ca4791667312cfebe125feb2c95c50 Mon Sep 17 00:00:00 2001 From: preminem <1466681844@qq.com> Date: Fri, 25 Jan 2019 16:21:12 +0800 Subject: [PATCH] fix balance-transfer script Signed-off-by: preminem <1466681844@qq.com> --- balance-transfer/testAPIs.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/balance-transfer/testAPIs.sh b/balance-transfer/testAPIs.sh index 6526f3f6..96dd6dc6 100755 --- a/balance-transfer/testAPIs.sh +++ b/balance-transfer/testAPIs.sh @@ -185,7 +185,7 @@ echo echo "POST invoke chaincode on peers of Org1 and Org2" echo -curl -s -X POST \ +VALUES=$(curl -s -X POST \ http://localhost:4000/channels/mychannel/chaincodes/mycc \ -H "authorization: Bearer $ORG1_TOKEN" \ -H "content-type: application/json" \ @@ -193,8 +193,11 @@ curl -s -X POST \ \"peers\": [\"peer0.org1.example.com\",\"peer0.org2.example.com\"], \"fcn\":\"move\", \"args\":[\"a\",\"b\",\"10\"] -}" -echo +}") +echo $VALUES +# Assign previous invoke transaction id to TRX_ID +MESSAGE=$(echo $VALUES | jq -r ".message") +TRX_ID=${MESSAGE#*ID:} echo echo "GET query chaincode on peer1 of Org1" @@ -213,7 +216,7 @@ BLOCK_INFO=$(curl -s -X GET \ -H "authorization: Bearer $ORG1_TOKEN" \ -H "content-type: application/json") echo $BLOCK_INFO -# Assign previvious block hash to HASH +# Assign previous block hash to HASH HASH=$(echo $BLOCK_INFO | jq -r ".header.previous_hash") echo