2017-09-01 20:09:18 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This script will run some qscc queries for testing.
|
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
# Importing useful functions for cc testing
|
|
|
|
if [ -f ./func.sh ]; then
|
|
|
|
source ./func.sh
|
|
|
|
elif [ -f scripts/func.sh ]; then
|
|
|
|
source scripts/func.sh
|
2017-09-01 20:09:18 +08:00
|
|
|
fi
|
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
echo_b "QSCC testing"
|
2017-09-01 20:09:18 +08:00
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
org=1
|
|
|
|
peer=0
|
2017-09-01 20:09:18 +08:00
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
echo_b "QSCC GetChainInfo"
|
|
|
|
chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetChainInfo","'${APP_CHANNEL}'"]}'
|
2017-09-01 20:09:18 +08:00
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
echo_b "QSCC GetBlockByNumber 2"
|
|
|
|
chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}'
|
2017-09-01 20:09:18 +08:00
|
|
|
|
2019-04-09 12:10:04 +08:00
|
|
|
#chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetTransactionByID","'${APP_CHANNEL}'","2361df2089384d27470f62327bdde3eced8c64cc9b21e4da2abf78b45aadbf6b"]}'
|
|
|
|
|
2018-01-03 21:19:09 +08:00
|
|
|
#peer chaincode query \
|
|
|
|
# -C "" \
|
|
|
|
# -n qscc \
|
|
|
|
# -c '{"Args":["GetChainInfo","'${APP_CHANNEL}'"]}'
|
|
|
|
|
|
|
|
#peer chaincode query \
|
|
|
|
# -C "" \
|
|
|
|
# -n qscc \
|
|
|
|
# -c '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}'
|
|
|
|
|
2018-01-18 13:31:00 +08:00
|
|
|
echo_g "QSCC testing done!"
|
|
|
|
|
|
|
|
echo
|