ConnectionManager

ConnectionManager

class ConnectionManager(**kwargs)

Implements the connectionmanager api endpoints.

addnode(ipaddr: str, command: str, **kwargs) → bool

Interface for the addnode command. Can continuously try to addnode, remove node, or onetry a node connection.

Parameters:
  • ipaddr (str) – The endpoint.
  • command (str) – Allowed commands [add, remove, onetry]
  • **kwargs – Extra keyword arguments.
Returns:

If command was successful.

Return type:

bool

Raises:

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

getpeerinfo(**kwargs) → List[pystratis.api.connectionmanager.responsemodels.peerinfomodel.PeerInfoModel]

Gets the peer info.

Parameters:**kwargs – Extra keyword arguments.
Returns:A list of connected peers.
Return type:List[PeerInfoModel]
Raises:APIError – Error thrown by node API. See message for details.

PeerInfoModel

class PeerInfoModel

A pydantic model with power information..