From b2d792cea08ef24173eedde44ee32fccc04442a7 Mon Sep 17 00:00:00 2001 From: mvonsteinkirch Date: Thu, 16 Feb 2023 11:51:25 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web3toolkit/README.md | 12 ++++++++++-- web3toolkit/scripts/utils/plots.py | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/web3toolkit/README.md b/web3toolkit/README.md index 339ece0..f91ef95 100644 --- a/web3toolkit/README.md +++ b/web3toolkit/README.md @@ -2,10 +2,11 @@
-an on-going development of a library and set of python scripts with my fav on-chain ops. +#### 👉 *on-going* development of a library and set of python scripts with my fav on-chain ops.
+--- ### setting up @@ -28,9 +29,12 @@ vim .env ### scripts +
#### get contracts deployed to mainnet and testnets +we leverage [ethereumetl](https://github.com/blockchain-etl/ethereum-etl) to extract this data. + 1. add info to `.env` 2. run ``` @@ -46,7 +50,7 @@ poetry run python get_contracts_deployed.py #### get reserve history by block for a pair of addresses -1. add the pair abi to `abis/ +1. add the pair abi to `abis/` 2. run ``` cd scripts @@ -85,6 +89,8 @@ poetry run python decode_calldata.py ### troubleshoot +
+ ##### if you see `ethereum-etl not compatible to m1` run: ``` @@ -109,6 +115,8 @@ pip install --no-binary ethereum-etl ### relevant info +
+ ##### providers - providers are how libraries such as `web3.py` talk to the blockchain. diff --git a/web3toolkit/scripts/utils/plots.py b/web3toolkit/scripts/utils/plots.py index 2a0a428..0c74306 100644 --- a/web3toolkit/scripts/utils/plots.py +++ b/web3toolkit/scripts/utils/plots.py @@ -3,7 +3,7 @@ # author: steinkirch import pandas as pd -from utils.os import exit_with_error +from utils.os import exit_with_error, log_error def open_csv(filepath) -> dict: @@ -27,5 +27,6 @@ def save_csv(destination, data, index=False) -> None: def plot_bar(y, x) -> None: """Simplest plot for two sets.""" + df = pd.DataFrame(y, index=x) df.plot.bar(rot=0, subplots=True) \ No newline at end of file