mattdean1 / blockchain-supply-chain

⛓ Supply Chain on Hyperledger Fabric
141 stars 50 forks source link

Stuck in selling grapes #6

Open harry-chin opened 6 years ago

harry-chin commented 6 years ago

There is an error in sell grapes step

curl --request POST   --url 'http://localhost:3000/api/biswas.grower.SellGrapes'   --header 'Content-Type: application/json'   --header 'X-Access-Token:ACESS-TOKEN'   --data '{
  "$class": "biswas.grower.SellGrapes",
  "grapes": "resource:biswas.grower.Grapes#grapes1",
  "buyer": "resource:biswas.producer.WineProducer#producer1",
  "quantity": 400
}'

When I tried to run this with my own access token, it returns following error:

{
  "error": {
    "statusCode": 500,
    "name": "Error",
    "message": "Error trying invoke business network. Error: Peer localhost:15051 has rejected transaction 'df2bd09d27554e44bc2ab0754f35e9022b1eb90c25b173ad0bb7a94408d1656c' with code ENDORSEMENT_POLICY_FAILURE",
    "stack": "Error: Error trying invoke business network. Error: Peer localhost:15051 has rejected transaction 'df2bd09d27554e44bc2ab0754f35e9022b1eb90c25b173ad0bb7a94408d1656c' with code ENDORSEMENT_POLICY_FAILURE\n    at HLFConnection.invokeChainCode (/usr/local/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:999:30)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)"
  }
}

I think it is related to default endorsement policy, and am checking.

harry-chin commented 6 years ago

I have stuck in selling grapes procedure with composer 1.19.12. Can't proceed anymore.