test_lscc.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env bash
  2. # This script will run some lscc queries for testing.
  3. # Importing useful functions for cc testing
  4. if [ -f ./func.sh ]; then
  5. source ./func.sh
  6. elif [ -f scripts/func.sh ]; then
  7. source scripts/func.sh
  8. fi
  9. echo_b "LSCC testing"
  10. org=1
  11. peer=0
  12. # invoke required following params
  13. #-o orderer.example.com:7050 \
  14. #--tls "true" \
  15. #--cafile ${ORDERER_TLS_CA} \
  16. echo_b "LSCC Get id"
  17. chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getid","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  18. echo_b "LSCC Get cc ChaincodeDeploymentSpec"
  19. chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getdepspec","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  20. echo_b "LSCC Get cc bytes"
  21. chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getccdata","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  22. echo_b "LSCC Get all chaincodes installed on the channel"
  23. chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getinstalledchaincodes"]}'
  24. echo_b "LSCC Get all chaincodes instantiated on the channel"
  25. chaincodeQuery "${APP_CHANNEL}" $org $peer lscc '{"Args":["getchaincodes"]}'
  26. #peer chaincode query \
  27. # -C "${APP_CHANNEL}" \
  28. # -n lscc \
  29. # -c '{"Args":["getid","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  30. #peer chaincode query \
  31. # -C "${APP_CHANNEL}" \
  32. # -n lscc \
  33. # -c '{"Args":["getdepspec","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  34. #peer chaincode query \
  35. # -C "${APP_CHANNEL}" \
  36. # -n lscc \
  37. # -c '{"Args":["getccdata","'${APP_CHANNEL}'", "'$CC_NAME'"]}'
  38. #peer chaincode query \
  39. # -C "${APP_CHANNEL}" \
  40. # -n lscc \
  41. # -c '{"Args":["getinstalledchaincodes"]}'
  42. #peer chaincode query \
  43. # -C "${APP_CHANNEL}" \
  44. # -n lscc \
  45. # -c '{"Args":["getchaincodes"]}'
  46. echo_g "LSCC testing done!"