Skip to content

A simple http server to cache specific eth rpc requests in memory.

License

Notifications You must be signed in to change notification settings

fuzzland/cached-eth-rpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETH RPC Cache Layer

A simple http server to cache specific eth rpc requests in memory. Useful for massive repeatedly requests to ETH rpc endpoints. Multiple endpoints/chains can be configured to be cached.

Usage (with docker)

  1. Edit docker-compose.yml

  2. docker-compose up

Usage

redis-url is optional

cargo run --release -- \
  --port=8124 \
  --bind=0.0.0.0 \
  --endpoint=eth=https://rpc.ankr.com/eth \
  --endpoint=bsc=https://rpc.ankr.com/bsc \
  --redis-url=redis://localhost:6379

Following redirection will be made:

Supported methods

Mainly supported requests with determined block number. Other methods will be directly send to the configured ETH rpc endpoint.

  • eth_call

  • eth_chainId

  • eth_estimateGas

  • eth_getBalance

  • eth_getBlockByHash

  • eth_getBlockByNumber

  • eth_getBlockReceipts

  • eth_getCode

  • eth_getLogs

  • eth_getStorageAt

  • eth_getTransactionByBlockHashAndIndex

  • eth_getTransactionByBlockNumberAndIndex

  • eth_getTransactionByHash

  • eth_getTransactionCount

  • eth_getTransactionReceipt

  • debug_traceBlockByHash

  • debug_traceBlockByNumber

  • debug_traceCall

  • debug_traceTransaction

About

A simple http server to cache specific eth rpc requests in memory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Rust 98.9%
  • Dockerfile 1.1%