Skip to content

Instantly share code, notes, and snippets.

View ko1ebayev's full-sized avatar
👾
👾👾👾👾👾👾👾

ko1ebayev

👾
👾👾👾👾👾👾👾
View GitHub Profile
@miguelmota
miguelmota / fallbackProvider.js
Last active February 2, 2023 10:59
JavaScript ethers fallback provider example
const { providers } = require('ethers')
async function main() {
const url1 = 'https://optimism-mainnet.infura.io/v3/84842078b09946638c03157f83405213'
const url2 = 'https://mainnet.optimism.io'
const stallTimeout = 2 * 1000
const options = {
timeout: 60 * 1000,
throttleLimit: 1
}