vector icon indicating copy to clipboard operation
vector copied to clipboard

[DNM] ChainRpcProvider class with fallback capabilities

Open jakekidd opened this issue 4 years ago • 1 comments

The Problem

Issue #410: https://github.com/connext/vector/issues/410

The Solution

The user should be able to specify in their router's config multiple provider addresses which can be used to fallback to.

For fallback functionality, we are leaning on ethersproject FallbackProvider, but have made a custom extending class ChainProvider which wraps that functionality but also enforces we are using JsonRpcProvider.

Here we've implemented this change with backwards compatability by using comma-separated values. Example for chainProviders in config:

{
  "1337": "http://localhost:8545,http://localhost:8546",
  "1338": "http://localhost:8547"
}

TODO: Link change in docs where we've updated the config API.

jakekidd avatar Mar 26 '21 08:03 jakekidd

Pending tests.

rhlsthrm avatar Mar 26 '21 12:03 rhlsthrm