Skip to content

Commit

Permalink
⚡️ Add blockpi rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Jul 4, 2024
1 parent e4fbaf0 commit 420c400
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
36 changes: 13 additions & 23 deletions ponder.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createConfig, mergeAbis } from "@ponder/core";
import { http, parseAbiItem } from "viem";
import { http, fallback, parseAbiItem } from "viem";
import {
interactionCampaignAbi,
referralCampaignAbi,
Expand All @@ -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,
},
},
Expand Down
9 changes: 4 additions & 5 deletions sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
];
Expand Down

0 comments on commit 420c400

Please sign in to comment.