Long running event handling...

xavieryvezxavieryvez Member Posts: 2
Ok, I'm trying to get to the bottom of this and need to start somewhere. Basically I have a server I'm running 24/7 (Node.js) that serves up pages. These pages receives events captured from the server. i.e. Geth (via RPC ->) Node.js (via SSE ->) front-end. On the server basically attach the contract via web3 and then do a

contract.allEvents({ fromBlock: startBlock }, (error, data) => { });

It is quite obvious that the Geth server seems to not be 100% at some points (monitoring it via ethstats.net), however I have also seen that out of the 3 contracts 2 would receive events and 1 won't. So I may as well starting with asking questions around Web3 before delving into the Geth operations side. So my questions are -

1. Which errors may pop up on .allEvents (I just log currently) and should I do anything more than just log them

2. Under which conditions should I try and re-establish connection to the server (in a separate place I forcibly re-connect when the isConnected(), as polled, is false)

3. Should I be trying to use this as a long-running process anyway or rather attempt another solution?

Any ideas as to why events run fine for a couple of hours and then me having to re-start would be appreciated here.
Sign In or Register to comment.