File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ where `settings.txt` is an environment file with [Settings](#settings).
7070| ----------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------| ---------|
7171| LOG_LEVEL | The log level of the program. | No | DEBUG |
7272| WEB3_WS_ENDPOINT | The WS endpoint to the ETH1 client. Must be specified if ` WEB3_HTTP_ENDPOINT ` endpoint is not provided. | No | - |
73+ | WEB3_WS_ENDPOINT_TIMEOUT | The WS endpoint timeout in seconds. | No | 60 |
7374| WEB3_HTTP_ENDPOINT | The HTTP endpoint to the ETH1 client. Must be specified if ` WEB3_WS_ENDPOINT ` endpoint is not provided. | No | - |
7475| BEACON_CHAIN_RPC_ENDPOINT | The Beacon Chain RPC HTTP endpoint. | Yes | - |
7576| INJECT_POA_MIDDLEWARE | Whether to inject POA middleware into Web3 client (see [ POA middleware] ( https://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority ) ). | No | False |
@@ -104,7 +105,7 @@ BALANCE_WARNING_THRESHOLD=0.05
104105BALANCE_ERROR_THRESHOLD=0.008
105106APPLY_GAS_PRICE_STRATEGY=True
106107MAX_TX_WAIT_SECONDS=180
107- TRANSACTION_TIMEOUT=3600
108+ TRANSACTION_TIMEOUT=10800
108109PROCESS_INTERVAL=30
109110ORACLES_CONTRACT_ADDRESS=0x2f1C5E86B13a74f5A6E7B4b35DD77fe29Aa47514
110111POOL_CONTRACT_ADDRESS=0xC874b064f465bdD6411D45734b56fac750Cda29A
Original file line number Diff line number Diff line change 77from src .reward_token import RewardToken
88from src .settings import (
99 WEB3_WS_ENDPOINT ,
10+ WEB3_WS_ENDPOINT_TIMEOUT ,
1011 WEB3_HTTP_ENDPOINT ,
1112 INJECT_POA_MIDDLEWARE ,
1213 INJECT_STALE_CHECK_MIDDLEWARE ,
@@ -49,6 +50,7 @@ def main() -> None:
4950 web3_client = get_web3_client (
5051 http_endpoint = WEB3_HTTP_ENDPOINT ,
5152 ws_endpoint = WEB3_WS_ENDPOINT ,
53+ ws_endpoint_timeout = WEB3_WS_ENDPOINT_TIMEOUT ,
5254 apply_gas_price_strategy = APPLY_GAS_PRICE_STRATEGY ,
5355 max_tx_wait_seconds = MAX_TX_WAIT_SECONDS ,
5456 inject_retry_request = INJECT_RETRY_REQUEST_MIDDLEWARE ,
Original file line number Diff line number Diff line change 1111# connections
1212# use either WS or HTTP for Web3
1313WEB3_WS_ENDPOINT : str = environ .get ("WEB3_WS_ENDPOINT" , "" )
14+ WEB3_WS_ENDPOINT_TIMEOUT : int = int (environ .get ("WEB3_WS_ENDPOINT_TIMEOUT" , "60" ))
1415WEB3_HTTP_ENDPOINT : str = "" if WEB3_WS_ENDPOINT else environ ["WEB3_HTTP_ENDPOINT" ]
1516BEACON_CHAIN_RPC_ENDPOINT : str = environ ["BEACON_CHAIN_RPC_ENDPOINT" ]
1617
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ def ws_retry_request_middleware(
7878def get_web3_client (
7979 http_endpoint : str = "" ,
8080 ws_endpoint : str = "" ,
81+ ws_endpoint_timeout : int = 60 ,
8182 apply_gas_price_strategy : bool = False ,
8283 max_tx_wait_seconds : int = 120 ,
8384 inject_retry_request : bool = False ,
@@ -89,7 +90,9 @@ def get_web3_client(
8990 """Returns instance of the Web3 client."""
9091 # Either http or ws endpoint must be provided (prefer ws over http)
9192 if ws_endpoint :
92- w3 = Web3 (Web3 .WebsocketProvider (ws_endpoint ))
93+ w3 = Web3 (
94+ Web3 .WebsocketProvider (ws_endpoint , websocket_timeout = ws_endpoint_timeout )
95+ )
9396 logger .info (f"Using Web3 websocket endpoint { ws_endpoint } " )
9497
9598 if inject_retry_request :
You can’t perform that action at this time.
0 commit comments