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

GetConnectedPeersInfoModel

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

GetStatusModel

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.

start_collecting_peerstatistics(**kwargs) str

Start collecting peer statistics.

Parameters

**kwargs – Extra keyword arguments.

Returns

The status of the feature.

Return type

str

Raises

APIError – Error thrown by node API. See message for details.

stop_collecting_peerstatistics(**kwargs) str

Stop collecting peer statistics.

Parameters

**kwargs – Extra keyword arguments.

Returns

The status of the feature.

Return type

str

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

class GetStatusModel(*, peerStatistics: str)

A pydantic model for status of diagnostics collection service.

peer_statistics: str

The status of the service.

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.