2222 LOG_LEVEL ,
2323 PROCESS_INTERVAL ,
2424 BEACON_CHAIN_RPC_ENDPOINT ,
25+ SEND_TELEGRAM_NOTIFICATIONS ,
2526)
2627from src .utils import (
2728 get_web3_client ,
@@ -66,15 +67,16 @@ def main() -> None:
6667 # wait for interrupt
6768 interrupt_handler = InterruptHandler ()
6869
69- # Notify Telegram the oracle is warming up, so that
70- # oracle maintainers know the service has restarted
71- telegram .notify (
72- message = f"Oracle starting with account [{ web3_client .eth .defaultAccount } ]"
73- f"(https://etherscan.io/address/{ web3_client .eth .defaultAccount } )" ,
74- parse_mode = "markdown" ,
75- raise_on_errors = True ,
76- disable_web_page_preview = True ,
77- )
70+ if SEND_TELEGRAM_NOTIFICATIONS :
71+ # Notify Telegram the oracle is warming up, so that
72+ # oracle maintainers know the service has restarted
73+ telegram .notify (
74+ message = f"Oracle starting with account [{ web3_client .eth .defaultAccount } ]"
75+ f"(https://etherscan.io/address/{ web3_client .eth .defaultAccount } )" ,
76+ parse_mode = "markdown" ,
77+ raise_on_errors = True ,
78+ disable_web_page_preview = True ,
79+ )
7880
7981 # wait that node is synced before trying to do anything
8082 wait_prysm_ready (interrupt_handler , BEACON_CHAIN_RPC_ENDPOINT , PROCESS_INTERVAL )
@@ -83,9 +85,10 @@ def main() -> None:
8385 w3 = web3_client , interrupt_handler = interrupt_handler
8486 )
8587 # check oracle balance
86- check_default_account_balance (
87- web3_client , BALANCE_WARNING_THRESHOLD , BALANCE_ERROR_THRESHOLD
88- )
88+ if SEND_TELEGRAM_NOTIFICATIONS :
89+ check_default_account_balance (
90+ web3_client , BALANCE_WARNING_THRESHOLD , BALANCE_ERROR_THRESHOLD
91+ )
8992
9093 while not interrupt_handler .exit :
9194 # update Reward Token total rewards
0 commit comments