Skip to content

Commit cf179e7

Browse files
authored
Update SetEvent documentation (#399)
Update SetEvent documentation to indicate that only a single chaincode event can be included in a transaction. Signed-off-by: David Enyeart <enyeart@us.ibm.com>
1 parent 6f66124 commit cf179e7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

libraries/fabric-shim/lib/stub.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,15 @@ class ChaincodeStub {
752752
}
753753

754754
/**
755-
* Allows the chaincode to propose an event on the transaction proposal. When the transaction
756-
* is included in a block and the block is successfully committed to the ledger, the block event
757-
* will be delivered to the current event listeners that have been registered with the peer's
758-
* event producer. Note that the block event gets delivered to the listeners regardless of the
759-
* status of the included transactions (can be either valid or invalid), so client applications
760-
* are responsible for checking the validity code on each transaction. Consult each SDK's documentation
761-
* for details.
755+
* Allows the chaincode to propose an event on the transaction proposal response.
756+
* When the transaction is included in a block and the block is successfully committed to the ledger,
757+
* the block event (including transaction level chaincode events)
758+
* will be delivered to the current client application event listeners that have been registered with the peer's event producer.
759+
* Consult each SDK's documentation for details.
760+
* Only a single chaincode event can be included in a transaction.
761+
* If setEvent() is called multiple times only the last event will be included in the transaction.
762+
* The event must originate from the outer-most invoked chaincode in chaincode-to-chaincode scenarios.
763+
* The marshaled ChaincodeEvent will be available in the transaction's ChaincodeAction.events field.
762764
* @param {string} name Name of the event
763765
* @param {byte[]} payload A payload can be used to include data about the event
764766
*/

0 commit comments

Comments
 (0)