Skip to content

Commit

Permalink
✨ Add block pi to indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Oct 18, 2024
1 parent fb95e0a commit e392f8c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
22 changes: 19 additions & 3 deletions packages/erpc/erpc-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ const alchemyRateLimits = buildRateLimit({
rules: [
{
method: "*",
maxCount: 200,
maxCount: 400,
period: "1s",
},
],
});
const blockPiRateLimits = buildRateLimit({
id: "block-pi-rate-limit",
rules: [
{
method: "*",
maxCount: 400,
period: "1s",
},
],
Expand Down Expand Up @@ -129,10 +139,16 @@ const alchemyUpstream = buildAlchemyUpstream({
const blockpiArbSepoliaUpstream = buildEvmUpstream({
id: "blockpi-arbSepolia",
endpoint: `https://arbitrum-sepolia.blockpi.network/v1/rpc/${envVariable("BLOCKPI_API_KEY_ARB_SEPOLIA")}`,
allowMethods: ["*"],
rateLimitBudget: blockPiRateLimits.id,
ignoreMethods: pimlicoSpecificMethods,
});
const blockpiArbUpstream = buildEvmUpstream({
id: "blockpi-arb",
endpoint: `https://arbitrum.blockpi.network/v1/rpc/${envVariable("BLOCKPI_API_KEY_ARB")}`,
allowMethods: ["*"],
rateLimitBudget: blockPiRateLimits.id,
ignoreMethods: pimlicoSpecificMethods,
});
const pimlicoUpstream = buildPimlicoUpstream({
apiKey: envVariable("PIMLICO_API_KEY"),
Expand All @@ -145,7 +161,7 @@ const pimlicoUpstream = buildPimlicoUpstream({
const ponderProject: ProjectConfig = buildProject({
id: "ponder-rpc",
networks,
upstreams: [envioUpstream, alchemyUpstream],
upstreams: [envioUpstream, alchemyUpstream, blockpiArbUpstream],
auth: {
strategies: [
buildSecretAuthStrategy({
Expand Down Expand Up @@ -218,7 +234,7 @@ export default buildErpcConfig({
},
projects: [ponderProject, nexusProject],
rateLimiters: {
budgets: [alchemyRateLimits, pimlicoRateLimits],
budgets: [alchemyRateLimits, pimlicoRateLimits, blockPiRateLimits],
},
},
});
46 changes: 28 additions & 18 deletions packages/erpc/erpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ database:
projects:
- rateLimitBudget: ""
id: ponder-rpc
networks: &var3
networks: &var4
- failsafe: &var1
timeout:
duration: 30s
Expand Down Expand Up @@ -111,13 +111,13 @@ projects:
- eth_uninstallFilter
- eth_newFilter
autoIgnoreUnsupportedMethods: true
- &var4
- &var5
id: alchemy
endpoint: evm+alchemy://${ALCHEMY_API_KEY}
type: evm+alchemy
rateLimitBudget: alchemy-rate-limit
vendorName: Alchemy
ignoreMethods: &var5
ignoreMethods: &var3
- eth_estimateUserOperationGas
- eth_getUserOperationByHash
- eth_getUserOperationReceipt
Expand All @@ -127,6 +127,16 @@ projects:
- pimlico_*
allowMethods: []
autoIgnoreUnsupportedMethods: true
- &var6
id: blockpi-arb
endpoint: https://arbitrum.blockpi.network/v1/rpc/${BLOCKPI_API_KEY_ARB}
rateLimitBudget: block-pi-rate-limit
type: evm
vendorName: Generic Evm
ignoreMethods: *var3
allowMethods:
- "*"
autoIgnoreUnsupportedMethods: true
auth:
strategies:
- allowMethods:
Expand All @@ -138,34 +148,28 @@ projects:
value: ${PONDER_RPC_SECRET}
- rateLimitBudget: ""
id: nexus-rpc
networks: *var3
networks: *var4
upstreams:
- *var4
- *var5
- id: pimlico
endpoint: evm+pimlico://${PIMLICO_API_KEY}
rateLimitBudget: pimlico-rate-limit
type: evm+pimlico
vendorName: Pimlico
ignoreMethods:
- "*"
allowMethods: *var5
allowMethods: *var3
autoIgnoreUnsupportedMethods: true
- id: blockpi-arbSepolia
endpoint: https://arbitrum-sepolia.blockpi.network/v1/rpc/${BLOCKPI_API_KEY_ARB_SEPOLIA}
rateLimitBudget: ""
type: evm
vendorName: Generic Evm
ignoreMethods: []
allowMethods: []
autoIgnoreUnsupportedMethods: true
- id: blockpi-arb
endpoint: https://arbitrum.blockpi.network/v1/rpc/${BLOCKPI_API_KEY_ARB}
rateLimitBudget: ""
rateLimitBudget: block-pi-rate-limit
type: evm
vendorName: Generic Evm
ignoreMethods: []
allowMethods: []
ignoreMethods: *var3
allowMethods:
- "*"
autoIgnoreUnsupportedMethods: true
- *var6
cors:
allowedOrigins:
- https://wallet.frak.id
Expand Down Expand Up @@ -199,7 +203,7 @@ rateLimiters:
- id: alchemy-rate-limit
rules:
- method: "*"
maxCount: 200
maxCount: 400
period: 1s
waitTime: ""
- id: pimlico-rate-limit
Expand All @@ -208,3 +212,9 @@ rateLimiters:
maxCount: 500
period: 1s
waitTime: ""
- id: block-pi-rate-limit
rules:
- method: "*"
maxCount: 400
period: 1s
waitTime: ""

0 comments on commit e392f8c

Please sign in to comment.