Question about fabric event #4329
-
Does fabric generate only one event only when the invocation is correctly endorsed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you are talking about chaincode events... The short answer is that the client API only emits chaincode events for successfully committed / validated transactions. The intent of chaincode eventing is to drive business processes in response to updates to the ledger. Only successful transactions update the ledger, and so only chaincode events for successful transactions are reported. See description in the Fabric Full Stack Development workshop. The long answer is that, if a transaction gets as far as being committed in a block (in other words: endorsed, and then successfully submitted to the orderer), even transactions that fail validation (perhaps because of an MVCC read conflict, or failure to meet endorsement requirements) are still recorded on the blockchain along with their chaincode events. Using block eventing you can iterate over the transactions in a block and dig down to the chaincode event for failed transactions. |
Beta Was this translation helpful? Give feedback.
-
@bestbeforetoday Thank you for your answer. |
Beta Was this translation helpful? Give feedback.
If you are talking about chaincode events...
The short answer is that the client API only emits chaincode events for successfully committed / validated transactions.
The intent of chaincode eventing is to drive business processes in response to updates to the ledger. Only successful transactions update the ledger, and so only chaincode events for successful transactions are reported. See description in the Fabric Full Stack Development workshop.
The long answer is that, if a transaction gets as far as being committed in a block (in other words: endorsed, and then successfully submitted to the orderer), even transactions that fail validation (perhaps because of an MVCC read conflict, or fa…