From 322b91a862c9f31a589f8f22e1d7580f149e70ba Mon Sep 17 00:00:00 2001 From: KONFeature Date: Wed, 10 Jul 2024 18:12:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Retry=20load=20balancing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ponder.config.ts | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/ponder.config.ts b/ponder.config.ts index ee0458c..7e4952c 100644 --- a/ponder.config.ts +++ b/ponder.config.ts @@ -1,5 +1,5 @@ -import { createConfig, mergeAbis } from "@ponder/core"; -import { http, fallback, parseAbiItem } from "viem"; +import { createConfig, loadBalance, mergeAbis } from "@ponder/core"; +import { http, parseAbiItem } from "viem"; import { interactionCampaignAbi, referralCampaignAbi, @@ -23,20 +23,17 @@ export default createConfig({ // Testnets arbitrumSepolia: { chainId: 421614, - transport: fallback( - [ - http( - `https://arb-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` - ), - http( - `https://arbitrum-sepolia.blockpi.network/v1/rpc/${process.env.BLOCKPI_API_KEY_ARB_SEPOLIA}` - ), - ], - { - retryCount: 5, - retryDelay: 300, - } - ), + transport: loadBalance([ + http( + `https://arb-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + http( + `https://arbitrum-sepolia.blockpi.network/v1/rpc/${process.env.BLOCKPI_API_KEY_ARB_SEPOLIA}` + ), + http( + `https://arb-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}` + ), + ]), pollingInterval: 10_000, maxRequestsPerSecond: 64, },