Fix balance-transfer script

Change-Id: I610d9cd3b91b3be83fa62ea126c7b326e092239d
Signed-off-by: preminem <preminem@ruc.edu.cn>
This commit is contained in:
preminem 2019-01-26 15:16:51 +08:00 committed by Gari Singh
parent 72edb7e3bb
commit 6be46eed05

View file

@ -185,16 +185,19 @@ 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" \
-d "{
\"peers\": [\"peer0.org1.example.com\",\"peer0.org2.example.com\"],
\"fcn\":\"move\",
\"args\":[\"a\",\"b\",\"10\"]
}"
echo
\"peers\": [\"peer0.org1.example.com\",\"peer0.org2.example.com\"],
\"fcn\":\"move\",
\"args\":[\"a\",\"b\",\"10\"]
}")
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