Contract event listener not firing sometimes #2652
Replies: 13 comments 20 replies
-
@ricmoo Seems like it's missing almost 20% of the events. |
Beta Was this translation helpful? Give feedback.
-
What backend are you using? |
Beta Was this translation helpful? Give feedback.
-
node.js |
Beta Was this translation helpful? Give feedback.
-
I mean, infura vs alchemy vs running your own geth instance, etc. :) |
Beta Was this translation helpful? Give feedback.
-
Not quite sure since I am still a newbie in crypto. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
What is the RPC_URL? Are you running your own infrastructure? I’ve heard reports of BSC not being reliable for events, but I don’t personally use it, so perhaps someone else can provide more insight. Moving to discussions. |
Beta Was this translation helpful? Give feedback.
-
Have a related question - do we know why filtering for events with provider versus contract returns different values? When I use by contract, I get more information underneath like:
|
Beta Was this translation helpful? Give feedback.
-
I believe this should have been address in v5.6 as part #2274. Please try it out and let me know.#2478 Thanks! :) |
Beta Was this translation helpful? Give feedback.
-
If you are using or planning to get the active events then this is not a better option, but to have a update with the previous events even after some time here is the sample that is working for me from long time, var web3 = new Web3(new Web3.providers.HttpProvider("<#infuralink>")); result would be the latest block number, |
Beta Was this translation helpful? Give feedback.
-
@ricmoo I am using JsonRpcProvider to listen for events from the blockchain with contract.on. However, sometimes I miss events. Could you help me to resolve it? 🙇 |
Beta Was this translation helpful? Give feedback.
-
I'm using ether with nodejs to listen event. |
Beta Was this translation helpful? Give feedback.
-
Depending on performance of RPC Url and it's nodes, contract event can't be missed generally. Missing contract event is never strange on EVM networks.Catching smart contract events is not recommended for product projects. Instead of using contract events, you need to research about mempool monitoring.Thank you |
Beta Was this translation helpful? Give feedback.
-
I am using
JsonRpcProvider
and listen to contract event by following.The problem is that sometimes the contract event is not firing.
Did I miss something?
Beta Was this translation helpful? Give feedback.
All reactions