hyperledger / firefly

Hyperledger FireFly is the first open source Supernode: a complete stack for enterprises to build and scale secure Web3 applications. The FireFly API for digital assets, data flows, and blockchain transactions makes it radically faster to build production-ready apps on popular chains and protocols.
https://hyperledger.github.io/firefly
Apache License 2.0
507 stars 208 forks source link

Unable to listen to events emitted before creating event listener #897

Open bharadwajambati172 opened 2 years ago

bharadwajambati172 commented 2 years ago

Launched a fabric network using fabric cli with a total of 3 firefly nodes. Deployed asset-transfer-basic chaincode by following the steps mentioned in the documentation https://hyperledger.github.io/firefly/tutorials/custom_contracts/fabric.html.

Ran three blockchain transactions from org1 and then created an event listener from org2. After creating an event listener, org2 didn't receive any events. Ran fourth transaction from org1, now org2 received the fourth transaction but not the previous transactions.

Below is the payload used for creating event listener in org2

{
  "interface": {
    "id": "f1e5522c-59a5-4787-bbfd-89975e5b0954"
  },
  "location": {
    "channel": "firefly",
    "chaincode": "asset_transfer"
  },
  "event": {
    "name": "AssetCreated"
  },
  "options": {
    "firstEvent": "oldest"
  },
  "topic": "assets"
}

Expected:

Org2 should receive all the events emitted before creating an event listener

Actual:

Org2 didn't receive events emitted before creating an event listener

nguyer commented 2 years ago

Thanks for reporting this @bharadwajambati172. I'll take a look at it and see if I can reproduce the same behavior.

awrichar commented 2 years ago

Notably in FireFly Core, we specifically convert "oldest" to "0" when creating a subscription. It's possible fabconnect doesn't actually honor "oldest" (would need to verify).

sifisKoen commented 11 months ago

Hello @awrichar and @nguyer I checked firefly project and I liked it. I am now in a process of learning Go lang and also study blockchain technology. So if it is possible I would like to try resolve this issue. Finally it would be appreciated if you guide me from where to start solve this issue, I mean if you can give me a guide from which area/folder to start. Thank you :smile: