Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion backend/metrics_backend/metrics_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
contracts_precompiled_path,
get_contracts_deployment_info
)
from raiden_common.blockchain.middleware import http_retry_with_backoff_middleware
from requests.exceptions import ConnectionError
from web3 import HTTPProvider, Web3

Expand Down Expand Up @@ -109,7 +110,14 @@ def main(
log.info("Starting Raiden Metrics Server")
try:
log.info(f'Starting Web3 client for node at {eth_rpc}')
web3 = Web3(HTTPProvider(eth_rpc))
provider = HTTPProvider(eth_rpc)

# give web3 some time between retries before failing
provider.middlewares.replace( # type: ignore
"http_retry_request", http_retry_with_backoff_middleware
)

web3 = Web3(provider)
except ConnectionError:
log.error(
'Can not connect to the Ethereum client. Please check that it is running and that '
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
raiden-common == 0.1.4
raiden-common == 0.1.5

Click

Expand Down