eth_rpc
Features
eth_rpc is a simple, portable eth rpc (partial) implementation with features like:
- Helper methods: token symbol, token decimals, ethers-rs abigen compatible eth_call, get function for revm
AccountInfomodel - transports like: Ipc, Http, EnvHttp, RandomizeHttp (for that sweet multiple node provider links setup under the hood)
- Config serialization support
- Most common tx submission errors
- json rpc batch
- Sync (take back control over your thread runtime and run it on linux threads not on tokio)
- Rate limit (for alchemy for instance) and network error protection
(Incomplete) Features Overview
All calls under the hood (EXCEPT TX SUBMISSION FOR FULL CONTROL) use no ratelimit rpc
The abigen compatible eth call:
/// simple wrapper on top of eth call to work with abigen! macro
The json rpc (chunked) batching compatibility:
/// in case of error returns first JRError encountered
Erc20 helpers:
;
;
;
/// for MKR token
;
Custom tx submit error (will handle more based on downstream demand)
Example rpc serialized (json) config (uses all https randomly under the hood):
Functions for:
- eth_blockNumber
- eth_estimateGas
- eth_gasPrice
- eth_getBlockByNumber (using ethers Block type)
- eth_getLogs (using custom log type)
- eth_getStorageAt
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionReceipt (using ethers TransactionReceipt)
Testing
Populate the source_env.sh based on source_env_example.sh and run the tests with sh ./regression.sh