nucypher.blockchain.middleware

Submodules

class RetryRequestMiddleware(make_request: Callable[[NewType.<locals>.new_type, Any], web3.types.RPCResponse], w3: web3.main.Web3, retries: int = 3, exponential_backoff: bool = True)

Bases: object

Automatically retries rpc requests whenever a 429 status code is returned.

is_request_result_retry(result: Union[web3.types.RPCResponse, Exception])bool
class AlchemyRetryRequestMiddleware(make_request: Callable[[NewType.<locals>.new_type, Any], web3.types.RPCResponse], w3: web3.main.Web3, retries: int = 3, exponential_backoff: bool = True)

Bases: nucypher.blockchain.middleware.retry.RetryRequestMiddleware

Automatically retries rpc requests whenever a 429 status code or Alchemy-specific error message is returned.

is_request_result_retry(result: Union[web3.types.RPCResponse, Exception])bool

Check Alchemy request result for Alchemy-specific retry message.

class InfuraRetryRequestMiddleware(make_request: Callable[[NewType.<locals>.new_type, Any], web3.types.RPCResponse], w3: web3.main.Web3, retries: int = 3, exponential_backoff: bool = True)

Bases: nucypher.blockchain.middleware.retry.RetryRequestMiddleware

Automatically retries rpc requests whenever a 429 status code or Infura-specific error message is returned.

is_request_result_retry(result: Union[web3.types.RPCResponse, Exception])bool

Check Infura request result for Infura-specific retry message.