2017-11-02 10:19:05 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This script will run some qscc queries for testing.
|
|
|
|
|
2017-11-15 14:46:12 +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-11-02 10:19:05 +08:00
|
|
|
fi
|
|
|
|
|
2017-11-23 17:17:29 +08:00
|
|
|
echo_b "QSCC testing"
|
|
|
|
|
2017-11-24 14:45:16 +08:00
|
|
|
org=1
|
|
|
|
peer=0
|
|
|
|
|
2017-11-15 14:46:12 +08:00
|
|
|
echo_b "QSCC GetChainInfo"
|
2017-12-06 16:50:55 +08:00
|
|
|
chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetChainInfo","'${APP_CHANNEL}'"]}'
|
2017-11-02 10:19:05 +08:00
|
|
|
|
2017-11-15 14:46:12 +08:00
|
|
|
echo_b "QSCC GetBlockByNumber 2"
|
2017-12-06 16:50:55 +08:00
|
|
|
chaincodeQuery ${APP_CHANNEL} $org $peer qscc '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}'
|
2017-11-23 22:22:20 +08:00
|
|
|
|
|
|
|
#peer chaincode query \
|
|
|
|
# -C "" \
|
|
|
|
# -n qscc \
|
2017-12-06 16:24:33 +08:00
|
|
|
# -c '{"Args":["GetChainInfo","'${APP_CHANNEL}'"]}'
|
2017-11-23 22:22:20 +08:00
|
|
|
|
|
|
|
#peer chaincode query \
|
|
|
|
# -C "" \
|
|
|
|
# -n qscc \
|
2017-12-06 16:24:33 +08:00
|
|
|
# -c '{"Args":["GetBlockByNumber","'${APP_CHANNEL}'","2"]}'
|
2017-11-02 10:19:05 +08:00
|
|
|
|
2018-01-23 17:53:52 +08:00
|
|
|
echo_g "QSCC testing done!"
|
|
|
|
|
|
|
|
echo
|