From 420c40022202ed622a09c1c6253e6e6c00b90fc9 Mon Sep 17 00:00:00 2001 From: KONFeature Date: Thu, 4 Jul 2024 10:02:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Add=20blockpi=20rpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ponder.config.ts | 36 +++++++++++++----------------------- sst.config.ts | 9 ++++----- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/ponder.config.ts b/ponder.config.ts index c0e943b..182490a 100644 --- a/ponder.config.ts +++ b/ponder.config.ts @@ -1,5 +1,5 @@ import { createConfig, mergeAbis } from "@ponder/core"; -import { http, parseAbiItem } from "viem"; +import { http, fallback, parseAbiItem } from "viem"; import { interactionCampaignAbi, referralCampaignAbi, @@ -25,31 +25,21 @@ export default createConfig({ publishSchema: "publish", }, networks: { - // Mainnets - /*arbitrum: { - chainId: 42161, - transport: http(process.env.PONDER_RPC_URL_ARB), - ...pollingConfig, - },*/ - /*base: { - chainId: 8453, - transport: http(process.env.PONDER_RPC_URL_BASE), - ...pollingConfig, - }, - optimism: { - chainId: 10, - transport: http(process.env.PONDER_RPC_URL_OPTIMISM), - ...pollingConfig, - }, - polygon: { - chainId: 137, - transport: http(process.env.PONDER_RPC_URL_POLYGON), - ...pollingConfig, - },*/ // Testnets arbitrumSepolia: { chainId: 421614, - transport: http(process.env.PONDER_RPC_URL_ARB_SEPOLIA), + transport: fallback([ + 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}` + ), + http(), + ], { + // Huge retry delay to avoid spamming + retryDelay: 600 + }), ...pollingConfig, }, }, diff --git a/sst.config.ts b/sst.config.ts index cbd93f2..818e33a 100644 --- a/sst.config.ts +++ b/sst.config.ts @@ -43,11 +43,10 @@ function IndexerStack({ app, stack }: StackContext) { const secrets = [ // Db url new Config.Secret(stack, "DATABASE_URL"), - // Mainnet RPCs - new Config.Secret(stack, "PONDER_RPC_URL_ARB"), - new Config.Secret(stack, "PONDER_RPC_URL_OPTIMISM"), - new Config.Secret(stack, "PONDER_RPC_URL_BASE"), - new Config.Secret(stack, "PONDER_RPC_URL_POLYGON"), + // BlockPi rpcs + new Config.Secret(stack, "BLOCKPI_API_KEY_ARB_SEPOLIA"), + // Alchemy RPC + new Config.Secret(stack, "ALCHEMY_API_KEY"), // Testnet RPCs new Config.Secret(stack, "PONDER_RPC_URL_ARB_SEPOLIA"), ];