-
Create a config file for the backends to be used. Example -
providers: - url: 'https://mainnet.infura**' config: priority: 2 stallTimeout: 200 weight: 2 - url: 'infura.io/zzz' config: priority: 1 stallTimeout: 100 weight: 1
Priority
: The priority used for the provider. Higher priorities are favoured over lower priorities. If multiple providers share the same priority, they are chosen at random.stallTimeout
: The timeout (in ms) after which another Provider will be attempted. This does not affect the current Provider; if it returns a result it is counted as part of the quorum.Lower values will result in more network traffic, but may reduce the response time of requests.weight
: The weight a response from this provider provides. This can be used if a given Provider is more trusted, for example. -
Add the package to the project
npm i fallback-provider
OR
yarn add fallback-provider
-
Import the provider as usual, i.e
const {FallbackProvider} = require('fallback-provider') const provider = new FallbackProvider(<pathToConfig>)
-
Notifications
You must be signed in to change notification settings - Fork 0
"Redundant & Robust Connections to your Ethereum Node Infra. Works with L2
License
rymnc/fallback-provider
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
"Redundant & Robust Connections to your Ethereum Node Infra. Works with L2
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published