1

I have a chaincode with endorsement policy of -P 'OR (ORG1.peer, ORG2.peer)'. when I invoke the chaincode using command peer chaincode invoke ... it just accepts transaction proposal without any interruptions or waiting for endorsement. In other words: the endorsement logic always returns true. According to this part of documentation:

By default, endorsing logic at a peer accepts the tran-proposal and simply signs the tran-proposal. However, endorsing logic may interpret arbitrary functionality, to, e.g., interact with legacy systems with tran-proposal and tx as inputs to reach the decision whether to endorse a transaction or not.

Now I want to override this logic such that it listens on a port for an accept or reject message from an external application.

Is it possible?

If so, how can I do that?

Do I need to build my own docker image for fabric-peer?

Does my endorsement logic, waiting for an external call (ex. the administrator of organization) makes any sense to real world fabric use cases?

Amir169
  • 45
  • 1
  • 9

1 Answers1

1

Endorsement is done by executing smart contracts (chaincode in fabric). Chaincodes are written in Go, NodeJs and Java primarily.

Although not recommended (because it makes your contract vulnerable to attacks if the endpoint is not trusted), you can access any external app (like by using HTTP) that drives your endorsement logic.

Successful execution of the contract means that the particular peer running your chaincode has signed your transaction. Example, if Org1 peers and Org2 peers has run the chaincode successfully, you have signatures of both in your transaction.

Refer to these documentations for more details: http://hyperledger-fabric.readthedocs.io/en/release/chaincode.html

http://hyperledger-fabric.readthedocs.io/en/release/endorsement-policies.html

http://hyperledger-fabric.readthedocs.io/en/release/txflow.html

arnabkaycee
  • 1,634
  • 13
  • 26