middleware

Documentation for eth_defi.middleware module.

Web3 middleware.

Most for dealing with JSON-RPC unreliability issues with retries.

  • Taken from exception_retry_request.py from Web3.py

  • Modified to support sleep and throttling

  • Logs warnings to Python logging subsystem in the case there is need to retry

Functions

exception_retry_middleware(make_request, ...)

Creates middleware that retries failed HTTP requests.

http_retry_request_with_sleep_middleware(...)

A HTTP retry middleware with sleep and backoff.