Multicall batching middleware for asynchronous scripts using web3.py
Project description
Dank Mids
Dank Mids is a EVM RPC batching library that helps reduce the number of HTTP requests to a node, saving time and resources. It automatically collects eth_call calls into multicalls and bundles all RPC calls together in jsonrpc batch calls. tl;dr: its fast as fuck.
The goal of this tool is to reduce the workload on RPC nodes and allow users to make calls to their preferred node more efficiently. This optimization is especially useful for developers writing scripts that perform large-scale blockchain analysis, as it can save development time and resources.
Installation
To install Dank Mids, use pip:
pip install dank-mids
Usage with web3.py
The primary function you need to use Dank Mids is setup_dank_w3_from_sync
. This function takes a sync Web3 instance and wraps it for async use. If using dank_mids with eth-brownie, you can just import the premade dank_web3 object as well
Example usage of Dank Mids with web3py:
from dank_mids.helpers import setup_dank_w3_from_sync
dank_web3 = setup_dank_w3_from_sync(w3)
# OR
from dank_mids.helpers import dank_web3
# Then:
random_block = await dank_web3.eth.get_block(123)
Usage with eth-brownie
Usage with ape
- COMING SOON: Dank Mids will also work with ape.
Testimonials
Yearn big brain Tonkers Kuma had this to say:
Notes
You can also set DANK_MIDS_DEMO_MODE=True
to see a visual representation of the batching in real time on your console.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dank_mids-4.20.104.tar.gz
.
File metadata
- Download URL: dank_mids-4.20.104.tar.gz
- Upload date:
- Size: 63.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.20 Linux/5.15.0-1074-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b129b7975b6464fbc09721b7ebd19225a7886bc659588bffca917d86ddd596 |
|
MD5 | 7e0e33692b417d1ca11632b385f2e3fe |
|
BLAKE2b-256 | 0ed3d294584f2b1c9a6e6a401a274c451665cdf2723cf90ac439786648d3d181 |
File details
Details for the file dank_mids-4.20.104-py3-none-any.whl
.
File metadata
- Download URL: dank_mids-4.20.104-py3-none-any.whl
- Upload date:
- Size: 76.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.20 Linux/5.15.0-1074-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6da59a801e1d3bebbad912938ef8202a4d077f4ef7cf4abd13b48cb82b9f59 |
|
MD5 | b3ae1ffff14a63a9bfd8e26595d0ab63 |
|
BLAKE2b-256 | 60d0926fa1b3b0597f4fa79f18224873ddd372ff7c56e2c364dcd9bb842a94a0 |