Skip to content

Commit

Permalink
⚗️ Reput erpc as provider for ponder
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Aug 24, 2024
1 parent 89d2ab8 commit 046c857
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 152 deletions.
19 changes: 18 additions & 1 deletion packages/erpc/erpc-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,24 @@ const pimlicoSpecificMethods: RpcMethodWithRegex<EIP1474Methods>[] = [
// Build each upstream we will use
const envioUpstream = buildEnvioUpstream({
ignoreMethods: ["*"],
allowMethods: ["eth_getLogs"],
// todo: simple port of the vendors/evio.go stuff hereh
// since ts sdk doesn't support null value if ts definition doesn't give optional stuff
allowMethods: [
"eth_chainId",
"eth_blockNumber",
"eth_getBlockByNumber",
"eth_getBlockByHash",
"eth_getTransactionByHash",
"eth_getTransactionByBlockHashAndIndex",
"eth_getTransactionByBlockNumberAndIndex",
"eth_getTransactionReceipt",
"eth_getBlockReceipts",
"eth_getLogs",
"eth_getFilterLogs",
"eth_getFilterChanges",
"eth_uninstallFilter",
"eth_newFilter",
],
});
const alchemyUpstream = buildAlchemyUpstream({
apiKey: envVariable("ALCHEMY_API_KEY"),
Expand Down
13 changes: 13 additions & 0 deletions packages/erpc/erpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,20 @@ projects:
ignoreMethods:
- "*"
allowMethods:
- eth_chainId
- eth_blockNumber
- eth_getBlockByNumber
- eth_getBlockByHash
- eth_getTransactionByHash
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getTransactionReceipt
- eth_getBlockReceipts
- eth_getLogs
- eth_getFilterLogs
- eth_getFilterChanges
- eth_uninstallFilter
- eth_newFilter
autoIgnoreUnsupportedMethods: true
- &var4
id: alchemy
Expand Down
2 changes: 1 addition & 1 deletion packages/erpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"aws-cdk-lib": "2.142.1",
"sst": "2.43.6",
"typescript": "^5.3.2",
"viem": "^2.19.8"
"viem": "^2.20.0"
},
"engines": {
"node": ">=18.14"
Expand Down
4 changes: 2 additions & 2 deletions packages/ponder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"typecheck": "tsc"
},
"dependencies": {
"@ponder/core": "^0.5.18",
"@ponder/core": "^0.5.19",
"hono": "^4.5.8",
"viem": "^2.19.8"
"viem": "^2.20.0"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/ponder/ponder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function getTransport(chainId: number) {
);

return fallback([
erpcTransport,
http(
`https://arb-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`
),
envioTransport,
erpcTransport,
]);
}

Expand Down
Loading

0 comments on commit 046c857

Please sign in to comment.