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

don't receive events after some uptime #281

Open
MajesticRaven opened this issue Jun 27, 2019 · 2 comments
Open

don't receive events after some uptime #281

MajesticRaven opened this issue Jun 27, 2019 · 2 comments

Comments

@MajesticRaven
Copy link

Hi, I have some contracts on loom network and I wrote nodejs application for handling contract events from blockchain. Everything okay for first some hours, but some time later events didn't come. This problem is real only with uptime for some hours. When I emit event in first hour - application handle it and wrote to db, but after some hours - there are no events and I tried to debug it with debug mode and found smth interesting:

  1. for each subscription for each block we make rpc call to the node like

ws-rpc-client Sending RPC msg to wss://extdev-plasma-us1.dappchains.com/queryws, method getevmlogs

after receiving answer like

loom-provider Response payload {
  "id": 42,
  "jsonrpc": "2.0",
  "result": []
}

after which it sends requests for filter

loom-provider Request payload {
  "method": "eth_getLogs",
  "params": [
    {
      "fromBlock": "0x6dd392",
      "toBlock": "0x6dd394",
      "address": "0xd0c1a482d6eb9616c3ee860d87f18bb154e3014c",
      "topics": [
        "0x237d4a1ca852c519fa30ab619571a169a13767b6f3af65886d6ed5b6dd6273b6"
      ]
    }
  ],
  "id": 42,
  "jsonrpc": "2.0"
}

and don't receive anything. maybe i messed up with logs, but i can see only this picture for latest minute or smth like that (period when transaction was sent and added to blockchain and some more time)
for all blocks i have no handled events on nodejs part (as i can see - there are no responses for filters). and this problem is coming only with time
2. are u sure that for each subscription is good idea to call node? why not better to send information about new block to client and parse it and find topics on client?

@eduardonunesp
Copy link
Contributor

We're working on a new version of LoomProvider which leverages our new implementation for JSON RPC, if there's an issue, probably this issue will be sane or at least will be easier to follow. Anyway you can check our new implementation for JSON RPC today on https://loomx.io/developers/en/json-rpc-methods.html

@eduardonunesp
Copy link
Contributor

We made few changes on LoomProvider recently, you can now use JSON RPC to call WebSocket connections directly using the same JSON RPC protocol from Ethereum, or if you prefer you can pass the /eth URL on the read URL, for instance:

const client = new Client('default', 'wss://extdev-plasma-us1.dappchains.com/websocket', 'wss://extdev-plasma-us1.dappchains.com/eth')

Could you please check the /eth approach example above. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants