-
-
Save banteg/98dbccbf6e2a3f997199a1b16eb93c5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tx | bytes_raw | bytes_data | elapsed | block_number | |
---|---|---|---|---|---|
0x9ef7a35012286fef17da12624aa124ebc785d9e7621e1fd538550d1209eb9f7d | 2227272883 | 41365028007 | 1037.0734836910851 | 14174380 | |
0xd770356649f1e60e7342713d483bd8946f967e544db639bd056dfccc8d534d8e | 2443027079 | 43851356338 | 462.4402022489812 | 14111772 | |
0x2428a69601105c365b9fe9d2f30688b91710b6a43bc6d2026344674ae7ffcac3 | 2947518853 | 50350613625 | 457.4804815109819 | 15127211 | |
0xb9e6b6f275212824215e8f50818f12b37b7ca4c2e0b943785357c35b23743b94 | 3478126580 | 71479914637 | 948.5805297840852 | 13678567 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import zlib | |
import httpx | |
def stream_trace(tx): | |
payload = {"jsonrpc": "2.0", "id": 1, "method": "debug_traceTransaction", "params": [tx]} | |
bytes_raw = 0 | |
bytes_data = 0 | |
d = zlib.decompressobj(zlib.MAX_WBITS | 16) | |
with httpx.stream("POST", "http://127.0.0.1:8545", json=payload) as r: | |
for chunk in r.iter_raw(): | |
bytes_raw += len(chunk) | |
chunk_fat = d.decompress(chunk) | |
bytes_data += len(chunk_fat) | |
print({'tx': tx, 'bytes_raw': bytes_raw, 'bytes_data': bytes_data}) | |
if __name__ == "__main__": | |
stream_trace(sys.argv[1]) |
Author
banteg
commented
Jul 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment