IBM / customer-loyalty-program-hyperledger-fabric-VSCode

Customer loyalty program
https://developer.ibm.com/patterns/customer-loyalty-program-with-iks-saas-v2-fabric/
Apache License 2.0
98 stars 67 forks source link

Getting error while Submit EarnPoints transaction #45

Open tim5chneider opened 1 year ago

tim5chneider commented 1 year ago

Hi @All,

i got the following error message when i want to "Earn Points through purchases":

Submit EarnPoints transaction.
2023-02-22T16:22:05.943Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
    peer=peer0.org1.example.com:7051, status=500, message=Cannot read properties of undefined (reading 'low')
    peer=peer0.org2.example.com:9051, status=500, message=Cannot read properties of undefined (reading 'low')
at newEndorsementError ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:74:12)
    at getResponsePayload ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:41:23)
    at Transaction.submit ([..]/customer-loyalty-program-hyperledger-fabric/web-app/node_modules/fabric-network/lib/transaction.js:255:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.earnPointsTransaction ([..]/customer-loyalty-program-hyperledger-fabric/web-app/network/network.js:304:40) {
  responses: [
    {
      version: 0,
      timestamp: null,
      response: [Object],
      payload: <Buffer 0a 20 26 c9 ae 9b 52 c5 7d 7b 91 09 a6 97 80 c0 ab 2f f9 cc f8 b6 a8 8d fc df 1e d0 53 3b 53 a6 1e a1 12 ae 01 0a 61 12 39 0a 0a 5f 6c 69 66 65 63 79 ... 161 more bytes>,
      endorsement: null,
      connection: [Object],
      peer: 'peer0.org1.example.com:7051'
    },
    {
      version: 0,
      timestamp: null,
      response: [Object],
      payload: <Buffer 0a 20 26 c9 ae 9b 52 c5 7d 7b 91 09 a6 97 80 c0 ab 2f f9 cc f8 b6 a8 8d fc df 1e d0 53 3b 53 a6 1e a1 12 ae 01 0a 61 12 39 0a 0a 5f 6c 69 66 65 63 79 ... 161 more bytes>,
      endorsement: null,
      connection: [Object],
      peer: 'peer0.org2.example.com:9051'
    }
  ],
  errors: []

Last error comes from this line in the network.js network.js:304:40

const earnPointsResponse = await contract.submitTransaction('EarnPoints', JSON.stringify(earnPoints));

Anybody a hint what the problem can be or how i can fix this?

tim5chneider commented 1 year ago

I found this but it didn't helped me because i instantiate the chaincode..

https://stackoverflow.com/questions/75024899/syntaxerror-unexpected-end-of-json-input-when-trying-to-query-transaction-detai

Any other hints to fix my problem?