1.1.0 • Published 4 years ago

ethereum-provider-failover v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

web3-rpc-failover

npm i web3-rpc-failover

Usage

create configuration file

providers:
  - url: 'https://mainnet.infura**'
    config:
      priority: 2
      stallTimeout: 200
      weight: 2
  - url: 'infura.io/zzz'
    config:
      priority: 1
      stallTimeout: 100
      weight: 1

priority: priority used for the provider stallTimeout: timeout (in ms)

Import into application

const {FallbackProvider} = require('web3-rpc-failover')
const provider = new FallbackProvider(<pathToConfig>)

License

MIT