0

I am new to developing Dapps with Hyperledger Fabric using Composer. I would like to know the purposes and use cases of Events in Hyperledger Fabric. On the Hyperledger Composer website it states:

Events can be emitted by Hyperledger Composer and subscribed to by external applications. Events are defined in the model file of a business network definition, and are emitted by transaction JavaScript in the transaction processor functions file.

So do Events act like triggers for the Composer Web Service that can be used in external applications such as notifications? What are the potential use cases of Events and the significance of Events in the overall blockchain landscape?

Pronoy Chaudhuri
  • 131
  • 1
  • 1
  • 15

4 Answers4

0

Yes, events basically are triggers that can be used in external applications such as notifications. My favourite example is that you can use events to signal a printer to print something.

Pronoy Chaudhuri
  • 131
  • 1
  • 1
  • 15
0

Events provide a way to interact with external system , like you need to notify external system when transaction submitted. also events can be used to identify transaction details to retrieve history of transaction over a specific asset like https://github.com/hyperledger/composer/issues/2458

0

Yes, Events act like triggers for the Composer Web Service that can be used in external applications such as notifications. Use cases like Bidding Application, Voting Application on the Hyperledger Composer and using events, we can see live changes of a bid on bidding App. And also using events we can see transaction history of asset or participant also.

Isha Padalia
  • 877
  • 7
  • 24
0

Events are emitted by transaction JavaScript in the transaction processor functions file.

That means, when you call any transaction in Hyperledger, It will generate some events, which contains the data, that changed by you in the blockchain.

So, on front-end side you can view live changes in data. This can be done by in JavaScript by using Web Socket. So, user can get run time notification.

Here is an tutorial for Events generation.

Demo for events is here.

Monarth Sarvaiya
  • 1,041
  • 8
  • 20