⚾️ Catch ⚾️
An RPC cache for 10x faster requests
We hit Ethereum nodes thousands of times a day. Some functions take seconds to resolve, yet they are immutable. If the result is immutable why do we ever recompute it?
Now we don't!
Catch is a global RPC cache for the entire world to use EVM Chains faster
🤖 Q: How does it know what to catch?
💸 Q: Does this save me credits?
⏰ Q: Does this save me time?
⛓️ Q: What chains does this support?
♻️ Q: Does this affect the envionment?
- Scroll Alpha Testnet
- Celo Alfajores Testnet
- Linea Testnet
- Taiko Hackathon L2
- Gnosis Chain
- Polygon Mainnet
Polygon fetch (cached thanks to the deployed smart-contract):
curl --location 'https://catch-rpc.vercel.app/api/eth?rpc=https%253A%252F%252Ffree-eth-node.com%252Fapi%252Fmatic&chainId=137' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 4,
"method": "eth_call",
"params": [
{
"to": "0x7ffb3d637014488b63fb9858e279385685afc1e2",
"data": "0x626381a0"
},
"latest"
]
}'
Example mainnet fetch
curl --location 'https://catch-rpc.vercel.app/api/rpc?rpc=https%253A%252F%252Ffree-eth-node.com%252Fapi%252Feth' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_call",
"params": [
{
"data": "0x9e34070f0000000000000000000000000000000000000000000000000000000000000002",
"to": "0x090d4613473dee047c3f2706764f49e0821d256e"
},
"latest"
]
}'
The cache rules are determined by the deployed CatchManager
contracts deployed to every chain. Here is an example graphic of how the smart-contract works:
To add a new caching rule, simply call pushCatchConfig
on the smart-contract and include the following data:
_to
: What smart-contract address should this rule apply to?_functionSignature
: What function should this rule apply to?_cacheIfEqualTo
: What raw hex string if seen as a response should be applied forever?
Here is an example:
const to = "0x7FFB3d637014488b63fb9858E279385685AFc1e2";
const functionSignature = "CHILD_CHAIN_ID()";
const cacheIfEqualTo =
"0x0000000000000000000000000000000000000000000000000000000000000089";
await contract.pushCatchConfig(to, functionSignature, cacheIfEqualTo);
In the future whenever someone wants the CHILD_CHAIN_ID
from that address, it's served instantly from the cache! This example is real and deployed live at https://polygonscan.com/address/0xCBBB04FDe79E40e98d6c49B539abd60858C7b525#readContract
Solidity contract is viewable at https://github.com/dawsbot/catch-solidity