Network¶
Network¶
- class Network(**kwargs)¶
Implements the network api endpoints.
- disconnect(peer_address: str, **kwargs) None ¶
Disconnect from a node.
- Parameters:
peer_address (str) – The peer endpoint.
**kwargs – Extra keyword arguments.
- Returns:
None
- Raises:
APIError – Error thrown by node API. See message for details.
- set_ban(ban_command: str, ban_duration_seconds: int, peer_address: str, **kwargs) None ¶
Set a banned node.
- Parameters:
ban_command (str) – Allowed commands [add, remove].
ban_duration_seconds (int) – The ban duration in seconds.
peer_address (str) – The peer address to ban/unban.
**kwargs – Extra keyword arguments.
- Returns:
None
- Raises:
APIError – Error thrown by node API. See message for details.
- get_bans(**kwargs) List[BannedPeerModel] ¶
Get a list of banned peers.
- Parameters:
**kwargs – Extra keyword arguments.
- Returns:
A list of banned peers with information on duration and reason for ban.
- Return type:
List[BannedPeerModel]
- Raises:
APIError – Error thrown by node API. See message for details.