hyperledger / bevel

An automation framework for rapidly and consistently deploying production-ready DLT platforms
https://hyperledger-bevel.readthedocs.io/en/latest/
Apache License 2.0
342 stars 709 forks source link

The postman collection suite is not working for supplychain Ref App on fabric version 2.2 #1156

Closed lakshyakumar closed 3 years ago

lakshyakumar commented 3 years ago

Describe the bug The postman collection suite is not working for fabric version 2.2, the same chaincode function from the peer cli as peer chaincode invoke -o ${ORDERER_URL} --tls --cafile ${ORDERER_CA} -C ${CHANNEL_NAME} -n supplychain --peerAddresses <peer0-cl-Address> --peerAddresses <peer0-ml-Address> --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/crypto/endorsers/cl/msp/cacerts/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/crypto/endorsers/ml/msp/cacerts/ca.crt -c '{"function":"createContainer","Args":["{\"misc\":{\"name\":\"Medicine Container\"},\"trackingID\":\"613254c0-5395-4069-971b-fff77dc9c73d\",\"counterparties\":[\"CN=Admin@org2.example.com,OU=client+OU=org2,O=Org2,L=San Francisco,C=US\"]}"]}' is working. We found out that the syntax of the invokation is different from the non-lifecycle enabled chaincode. Investigate and fix the same

To Reproduce Steps to reproduce the behavior:

  1. Edit fabric network.yaml for version fabric 2.2
  2. Setup the fabric networ version 2.2
  3. Setup the ref app.
  4. run create container api from postman.

Expected behavior The postman api collection suite should work.

Screenshots image

suvajit-sarkar commented 3 years ago

Dependent on #1147

jagpreetsinghsasan commented 3 years ago

For fabric 2.2, the node sdk is changed, as per the documentation This folder needs to be looked into https://github.com/hyperledger-labs/blockchain-automation-framework/tree/develop/examples/supplychain-app/fabric/chaincode_rest_server/rest-server/src

lakshyakumar commented 3 years ago

The postman api calls are working fine for fabric version 2.2, Able to create the container using the createContainer API.

creating container working in 2 2

The API's after the creation of the container are failing in the test suite because of wrong OU. The rest of the API calls will be fixed by the issue #1191