diff --git a/.env.sample b/.env.sample index b4e6fea7..6c4c0e47 100644 --- a/.env.sample +++ b/.env.sample @@ -1,4 +1,4 @@ -export DUNE_USER= -export DUNE_PASSWORD= -export DUNE_QUERY_ID= -export FILE_OUT_PATH=./out +DUNE_USER= +DUNE_PASSWORD= +DUNE_QUERY_ID= +FILE_OUT_PATH=./out diff --git a/README.md b/README.md index c2b478d5..7533f605 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,7 @@ python3 -m venv env source ./env/bin/activate pip install -r requirements.txt -cp .env.sample .env -source .env +cp .env.sample .env <----- Copy your Dune credentials here! ``` Fill out your Dune credentials in the `.env` file. The Dune user and password are @@ -79,7 +78,6 @@ The solver reimbursements are to be executed each Tuesday with the accounting pe In order to do the payout, run the following scripts: ```shell -source .env rm -r out/ python -m src.fetch.transfer_file --start '2022-MM-DD' ``` diff --git a/logging.conf b/logging.conf new file mode 100644 index 00000000..06bd8703 --- /dev/null +++ b/logging.conf @@ -0,0 +1,28 @@ +[loggers] +keys=root,src.fetch + +[handlers] +keys=consoleHandler + +[formatters] +keys=sampleFormatter + +[logger_root] +level=INFO +handlers=consoleHandler +propagate=0 + +[logger_src.fetch] +level=INFO +qualname=src.fetch +handlers=consoleHandler +propagate=0 + +[handler_consoleHandler] +class=StreamHandler +level=DEBUG +formatter=sampleFormatter +args=(sys.stdout,) + +[formatter_sampleFormatter] +format=%(asctime)s %(levelname)s %(name)s %(message)s \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 589be820..7317dce7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ black==22.3.0 -duneapi==2.0.4 -mypy==0.941 -pylint==2.12.2 +duneapi==2.2.2 +mypy==0.942 +pylint==2.13.4 pytest==7.1.1 -types-requests==2.27.14 +python-dotenv==0.20.0 +types-requests==2.27.16 web3>=5.28.0 \ No newline at end of file diff --git a/src/fetch/period_slippage.py b/src/fetch/period_slippage.py index d2b04cac..51f28287 100644 --- a/src/fetch/period_slippage.py +++ b/src/fetch/period_slippage.py @@ -1,6 +1,7 @@ """A standalone script for fetching Solver Slippage for Accounting Period""" from __future__ import annotations +import logging.config from dataclasses import dataclass from enum import Enum from pprint import pprint @@ -13,6 +14,9 @@ from src.token_list import fetch_trusted_tokens from src.utils.script_args import generic_script_init +log = logging.getLogger(__name__) +logging.config.fileConfig(fname="logging.conf", disable_existing_loggers=False) + def allowed_token_list_query(token_list: list[str]) -> str: """Constructs sub query for allowed tokens"""