docker-compose-files/hyperledger_fabric/v1.0.5/scripts/test_cc_peer0.sh

29 lines
621 B
Bash
Raw Normal View History

2017-11-02 10:19:05 +08:00
#!/bin/bash
# Importing useful functions for cc testing
if [ -f ./func.sh ]; then
source ./func.sh
elif [ -f scripts/func.sh ]; then
source scripts/func.sh
fi
2017-12-06 16:24:33 +08:00
echo_b "Channel name: "${APP_CHANNEL}
2017-11-02 10:19:05 +08:00
2017-11-15 14:46:12 +08:00
echo_b "Query the existing value of a"
chaincodeQuery ${APP_CHANNEL} 0 ${CC_02_NAME} ${CC_02_QUERY_ARGS} 100
2017-11-02 10:19:05 +08:00
sleep 1
2017-11-15 14:46:12 +08:00
echo_b "Invoke a transaction to transfer 10 from a to b"
chaincodeInvoke ${APP_CHANNEL} 0 ${CC_02_NAME} ${CC_02_INVOKE_ARGS}
2017-11-02 10:19:05 +08:00
sleep 1
2017-11-15 14:46:12 +08:00
echo_b "Check if the result of a is 90"
chaincodeQuery ${APP_CHANNEL} 0 ${CC_02_NAME} ${CC_02_QUERY_ARGS} 90
2017-11-02 10:19:05 +08:00
echo
2017-11-15 14:46:12 +08:00
echo_g "All GOOD, MVE Test completed"
2017-11-02 10:19:05 +08:00
echo
exit 0