Skip to content

Commit

Permalink
Requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeannettemcd committed Oct 24, 2023
1 parent 9326591 commit 6db8043
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
19 changes: 10 additions & 9 deletions chief_keeper/chief_keeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class ChiefKeeper:

logger = logging.getLogger("chief-keeper")

logging.basicConfig(
format="%(asctime)-15s %(levelname)-8s %(message)s",
level=(logging.DEBUG if self.arguments.debug else logging.INFO),
)

def __init__(self, args: list, **kwargs):
"""Pass in arguements assign necessary variables/objects and instantiate other Classes"""

Expand Down Expand Up @@ -155,7 +160,7 @@ def __init__(self, args: list, **kwargs):
self.our_address = Address(self.arguments.eth_from)

isConnected = self.web3.isConnected()
print(f'web3 isConntected is: {isConnected}')
self.logger.info(f'web3 isConntected is: {isConnected}')

if self.arguments.dss_deployment_file:
self.dss = DssDeployment.from_json(
Expand All @@ -166,18 +171,14 @@ def __init__(self, args: list, **kwargs):
self.dss = DssDeployment.from_network(
web3=self.web3, network=self.arguments.network
)
print(f"DS-Chief: {self.dss.ds_chief.address}")
self.logger.info(f"DS-Chief: {self.dss.ds_chief.address}")
self.deployment_block = self.arguments.chief_deployment_block

self.max_errors = self.arguments.max_errors
self.errors = 0

self.confirmations = 0

logging.basicConfig(
format="%(asctime)-15s %(levelname)-8s %(message)s",
level=(logging.DEBUG if self.arguments.debug else logging.INFO),
)

def main(self):
"""Initialize the lifecycle and enter into the Keeper Lifecycle controller.
Expand Down Expand Up @@ -231,8 +232,8 @@ def get_initial_tip(arguments) -> int:
)
if result.ok and result.content:
confidence_80_tip = result.json().get('blockPrices')[0]['estimatedPrices'][3]['maxPriorityFeePerGas']
logging.info(f"Using Blocknative 80% confidence tip {confidence_80_tip}")
logging.info(int(confidence_80_tip * GeometricGasPrice.GWEI))
self.logger.info(f"Using Blocknative 80% confidence tip {confidence_80_tip}")
self.logger.info(int(confidence_80_tip * GeometricGasPrice.GWEI))
return int(confidence_80_tip * GeometricGasPrice.GWEI)
except Exception as e:
logging.error(str(e))
Expand All @@ -246,7 +247,7 @@ def process_block(self):
This is the entrypoint to the Keeper's monitoring logic
"""
isConnected = self.web3.isConnected()
logging.info(f'web3 isConntected is: {isConnected}')
self.logger.info(f'web3 isConntected is: {isConnected}')

if self.errors >= self.max_errors:
self.lifecycle.terminate()
Expand Down
5 changes: 2 additions & 3 deletions install-dev.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
#cd "$(dirname "$0")"

if [[ "$0" = "$BASH_SOURCE" ]]; then
echo "Needs to be run using source: . install.sh"
echo "Needs to be run using source: . install-dev.sh"

else
rm -rf _virtualenv
Expand All @@ -29,4 +28,4 @@ fi

python --version
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
pip3 install -r requirements-dev.txt
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#cd "$(dirname "$0")"


if [[ "$0" = "$BASH_SOURCE" ]]; then
echo "Needs to be run using source: . install.sh"
Expand Down Expand Up @@ -28,4 +28,4 @@ else
fi

python --version
pip3 install -r requirements.txt
pip3 install -r requirements.txt

0 comments on commit 6db8043

Please sign in to comment.