mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-17 14:10:21 -04:00
💾
This commit is contained in:
parent
183d7d8841
commit
b2d792cea0
2 changed files with 12 additions and 3 deletions
|
@ -2,10 +2,11 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### setting up
|
### setting up
|
||||||
|
|
||||||
|
@ -28,9 +29,12 @@ vim .env
|
||||||
|
|
||||||
### scripts
|
### scripts
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
#### get contracts deployed to mainnet and testnets
|
#### 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`
|
1. add info to `.env`
|
||||||
2. run
|
2. run
|
||||||
```
|
```
|
||||||
|
@ -46,7 +50,7 @@ poetry run python get_contracts_deployed.py
|
||||||
|
|
||||||
#### get reserve history by block for a pair of addresses
|
#### 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
|
2. run
|
||||||
```
|
```
|
||||||
cd scripts
|
cd scripts
|
||||||
|
@ -85,6 +89,8 @@ poetry run python decode_calldata.py
|
||||||
|
|
||||||
### troubleshoot
|
### troubleshoot
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
##### if you see `ethereum-etl not compatible to m1` run:
|
##### if you see `ethereum-etl not compatible to m1` run:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -109,6 +115,8 @@ pip install --no-binary ethereum-etl
|
||||||
|
|
||||||
### relevant info
|
### relevant info
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
##### providers
|
##### providers
|
||||||
|
|
||||||
- providers are how libraries such as `web3.py` talk to the blockchain.
|
- providers are how libraries such as `web3.py` talk to the blockchain.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# author: steinkirch
|
# author: steinkirch
|
||||||
|
|
||||||
import pandas as pd
|
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:
|
def open_csv(filepath) -> dict:
|
||||||
|
@ -27,5 +27,6 @@ def save_csv(destination, data, index=False) -> None:
|
||||||
|
|
||||||
def plot_bar(y, x) -> None:
|
def plot_bar(y, x) -> None:
|
||||||
"""Simplest plot for two sets."""
|
"""Simplest plot for two sets."""
|
||||||
|
|
||||||
df = pd.DataFrame(y, index=x)
|
df = pd.DataFrame(y, index=x)
|
||||||
df.plot.bar(rot=0, subplots=True)
|
df.plot.bar(rot=0, subplots=True)
|
Loading…
Add table
Add a link
Reference in a new issue