loom-js icon indicating copy to clipboard operation
loom-js copied to clipboard

Implementing Loom Provider 2 (WebSocket + JSON RPC)

Open eduardonunesp opened this issue 6 years ago • 2 comments
trafficstars

  • [x] Depends on Loomchain eth_sendRawTransaction https://github.com/loomnetwork/loomchain/pull/1227
  • [x] Update e2e configs with new Loomchain configs
  • [x] Replicate tests from original Loom Provider
  • [x] Import code from test branch
  • [x] Use stable version of Web3 1.2.1 (WebsocketProvider) as reference
  • [x] Loom Provider 2 using WebSocket as default
  • [x] WebSocket communication and eth_subscribe/eth_unsubscribe tracking by Loom Provider 2
  • [x] Adding retry strategies like original Loom Provider
  • [x] Wallet management on ethers/Wallet
  • [x] Signed transaction from ethers/Wallet
  • [x] JSON RPC documentation on Loom Developers Site (https://loomx.io/developers/en/json-rpc-methods.html)

eduardonunesp avatar Aug 26 '19 03:08 eduardonunesp

The main difference between the current version of LoomProvider and this new one is that this one is meant to work more like a wallet provider, similar to the HD wallet provider (https://www.trufflesuite.com/tutorials/using-infura-custom-provider). It interacts directly with the /eth endpoint on Loom nodes (and only that endpoint), both for querying and sending txs, the latter requires https://github.com/loomnetwork/loomchain/pull/1227.

enlight avatar Sep 24 '19 18:09 enlight

Totally agree with you, the LoomProvider2 right now is doing that the accounts and sign the transactions are happening on the provider other stuff related to /eth are delegated. However, I noticed that LoomProvider2 still needs to manage the listeners for the WebSocket connections, so the Web3 will use those Websocket "intefaces"

eduardonunesp avatar Sep 24 '19 18:09 eduardonunesp