Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
/ cached-eth-rpc Public archive

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

Notifications You must be signed in to change notification settings

tonyke-bot/cached-eth-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Further development has been moved to https://github.com/fuzzland/cached-eth-rpc

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)

docker run \
  -d \
  -p 8124:8124 \
  -v ./data/:/data/ \
  -e DATA_PERSISTENCE=1 \
  -e ENDPOINTS="eth-chain=https://rpc.ankr.com/eth,bsc-chain=https://rpc.ankr.com/bsc" \
  --name cached-eth-rpc \
  ghcr.io/tonyke-bot/cached-eth-rpc

Usage

With

cargo run --release -- \
  --port 8124 \
  --endpoint "eth-chain=https://rpc.ankr.com/eth" \
  --endpoint "bsc-chain=https://rpc.ankr.com/bsc"

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_getBalance
  • eth_getBlockByNumber
  • eth_getCode
  • eth_getStorageAt
  • eth_getTransactionByHash
  • eth_getTransactionCount
  • eth_getTransactionReceipt
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getTransactionByBlockHashAndIndex

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages