Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is contract.on reliable for production? #507

Closed
kraikov opened this issue May 7, 2019 · 2 comments
Closed

Is contract.on reliable for production? #507

kraikov opened this issue May 7, 2019 · 2 comments
Labels
discussion Questions, feedback and general information.

Comments

@kraikov
Copy link

kraikov commented May 7, 2019

Hey!

Is it okay to use contract.on for event listening on production? We've implemented a mechanism to keep track which events are already processed and what's the latest processed block so we can handle failures. I was wondering if it is possible to miss an event?

We have our own node on DigitalOcean and it seems everything is working flawlessly on Ropsten.

Thanks in advance.

@ricmoo
Copy link
Member

ricmoo commented May 8, 2019

The contract.on just uses the normal provider.getLogs, so if you consider that ok for production, then yes. :)

Missing events is more a thing that would happen on the node side, and it depends on your failure recovery more so then anything. I generally do no see missed events for recent blocks, but if your service went down for too many blocks, when it came back up, there may have been events which were pruned. And that doesn’t mean it never happens, so depends on how important events are to correct operation.

In general I would always recommend building a caching layer for events, if they are mission critical, since you usually need them frequently and quickly.

@ricmoo ricmoo added the discussion Questions, feedback and general information. label May 8, 2019
@ricmoo
Copy link
Member

ricmoo commented May 24, 2019

Closing this now, but please feel free to continue discussion (I monitor closed issues) or re-open.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Questions, feedback and general information.
Projects
None yet
Development

No branches or pull requests

2 participants