Diagnostic
Diagnostic
- class Diagnostic(**kwargs)
Implements the diagnostic api endpoints.
- get_connectedpeers_info(**kwargs) GetConnectedPeersInfoModel
Get connected peers info.
- Parameters
**kwargs – Extra keyword arguments.
- Returns
Information on connected peers.
- Return type
- Raises
APIError – Error thrown by node API. See message for details.
- get_status(**kwargs) GetStatusModel
Get the diagnostic feature status.
- Parameters
**kwargs – Extra keyword arguments.
- Returns
The feature status.
- Return type
- Raises
APIError – Error thrown by node API. See message for details.
- get_peer_statistics(connected_only: bool, **kwargs) List[PeerStatisticsModel]
Gets statistics for connected peers.
- Parameters
connected_only (bool) – To show data for only connected nodes.
**kwargs – Extra keyword arguments.
- Returns
A list of statistics on the connected peers.
- Return type
List[PeerStatisticsModel]
- Raises
APIError – Error thrown by node API. See message for details.
ConnectedPeerInfoModel
- class ConnectedPeerInfoModel(*, isConnected: bool, disconnectReason: str = None, state: int, endPoint: str)
A pydantic model representing connected peer information.
- is_connected: bool
True if the peer is connected
- disconnect_reason: Optional[str]
The reason for disconnection.
- state: int
The connection state.
- endpoint: str
The peer’s endpoint.
GetConnectedPeersInfoModel
- class GetConnectedPeersInfoModel(*, peersByPeerId: List[ConnectedPeerInfoModel], connectedPeers: List[ConnectedPeerInfoModel], connectedPeersNotInPeersByPeerId: List[ConnectedPeerInfoModel])
A pydantic model for connected peer information.
- peers_by_peer_id: List[ConnectedPeerInfoModel]
A list of peers by id.
- connected_peers: List[ConnectedPeerInfoModel]
A list of connected peers.
- connected_peers_not_in_peers_by_peer_id: List[ConnectedPeerInfoModel]
A list of known peer ls not connected to.
GetStatusModel
PeerStatisticsModel
- class PeerStatisticsModel(*, peerEndPoint: str, connected: bool, inbound: bool, bytesSent: int, bytesReceived: int, receivedMessages: int, sentMessages: int, latestEvents: List[str])
A pydantic model for peer statistics.
- peer_endpoint: str
The peer endpoint.
- connected: bool
If true, peer is connected.
- inbound: bool
If true, peer is inbound connection.
- bytes_sent: int
Bytes sent to peer.
- bytes_received: int
Bytes received from peer.
- received_messages: int
The number of received messages from peer.
- send_messages: int
The number of sent messages to peer.
- latest_events: List[str]
A list of peer events.