user9040429
user9040429

Reputation: 720

Usage of endorsement policy in hyperledger fabric

So I created and deployed a chaincode having read and write functionalities. I have instantiated it using some endorsement policy. Now I get it that while write operation we there should be valid endorsements, but now when I invoke the read function still the endorsements will come into picture ?

Upvotes: 0

Views: 61

Answers (1)

arnabkaycee
arnabkaycee

Reputation: 1644

Short answer, No. When we send proposal request to the endorsing peers from the client, all these go through the endorsement process. It is just that if the proposal response contains write sets and we send this proposal responses to the orderer, that these transactions get written to the ledger post the endorsement policy check.

So, if you get back a proposal response and do not send it for ordering, that is equivalent to querying the chaincode and endorsements do not come into the picture.

You can refer to channel.queryByTransaction source for more details:

https://github.com/hyperledger/fabric-sdk-node/blob/release-1.1/fabric-client/lib/Channel.js#L1738

Upvotes: 2

Related Questions