nostr_tools.check_readability

async nostr_tools.check_readability(client)[source]

Check if the relay allows reading events and measure read response time.

This function subscribes to a simple filter and measures how long it takes to receive a response (either events or end-of-stored-events).

Parameters:

client (Client) – An instance of Client (must be connected)

Returns:

(rtt_read in ms or None, readable as bool)

Return type:

Tuple[Optional[int], bool]

Raises:

ClientConnectionError – If client is not connected