File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 2828 InterruptHandler ,
2929 check_default_account_balance ,
3030 wait_prysm_ready ,
31+ telegram ,
3132)
3233
3334# Send notification to admins on error
@@ -63,11 +64,19 @@ def main() -> None:
6364 # wait for interrupt
6465 interrupt_handler = InterruptHandler ()
6566
66- # wait that node is synced before trying to do anything
67- wait_prysm_ready (
68- interrupt_handler , BEACON_CHAIN_RPC_ENDPOINT , PROCESS_INTERVAL , logger
67+ # Notify Telegram the oracle is warming up, so that
68+ # oracle maintainers know the service has restarted
69+ telegram .notify (
70+ message = f"Oracle starting with account [{ web3_client .eth .defaultAccount } ]"
71+ f"(https://etherscan.io/address/{ web3_client .eth .defaultAccount } )" ,
72+ parse_mode = "markdown" ,
73+ raise_on_errors = True ,
74+ disable_web_page_preview = True ,
6975 )
7076
77+ # wait that node is synced before trying to do anything
78+ wait_prysm_ready (interrupt_handler , BEACON_CHAIN_RPC_ENDPOINT , PROCESS_INTERVAL )
79+
7180 reward_token_total_rewards = RewardToken (
7281 w3 = web3_client , interrupt_handler = interrupt_handler
7382 )
Original file line number Diff line number Diff line change 1111from eth_typing .evm import HexAddress
1212from google .protobuf import empty_pb2
1313from grpc import insecure_channel , RpcError , StatusCode
14- from loguru import logger , Logger
14+ from loguru import logger
1515from notifiers .core import get_notifier # type: ignore
1616from web3 import Web3
1717from web3 .contract import Contract
@@ -206,7 +206,6 @@ def wait_prysm_ready(
206206 interrupt_handler : InterruptHandler ,
207207 endpoint : str ,
208208 process_interval : int ,
209- logger : Logger ,
210209) -> None :
211210 """Wait that Prysm accepts requests and is synced.
212211
You can’t perform that action at this time.
0 commit comments