bittensor.core.chain_data.ip_info#

Classes#

IPInfo

Dataclass representing IP information.

Module Contents#

class bittensor.core.chain_data.ip_info.IPInfo#

Dataclass representing IP information.

Variables:
  • ip (str) – The IP address as a string.

  • ip_type (int) – The type of the IP address (e.g., IPv4, IPv6).

  • protocol (int) – The protocol associated with the IP (e.g., TCP, UDP).

encode()#

Returns a dictionary of the IPInfo object that can be encoded.

Return type:

dict[str, Any]

classmethod fix_decoded_values(decoded)#

Returns a SubnetInfo object from a decoded IPInfo dictionary.

Parameters:

decoded (dict)

Return type:

IPInfo

classmethod from_parameter_dict(parameter_dict)#

Creates a IPInfo instance from a parameter dictionary.

Parameters:

parameter_dict (Union[dict[str, Any], bittensor.utils.registration.torch.nn.ParameterDict])

Return type:

IPInfo

classmethod from_vec_u8(vec_u8)#

Returns a IPInfo object from a vec_u8.

Parameters:

vec_u8 (list[int])

Return type:

Optional[IPInfo]

ip: str#
ip_type: int#
classmethod list_from_vec_u8(vec_u8)#

Returns a list of IPInfo objects from a vec_u8.

Parameters:

vec_u8 (list[int])

Return type:

list[IPInfo]

protocol: int#
to_parameter_dict()#

Returns a torch tensor or dict of the subnet IP info.

Return type:

Union[dict[str, Union[str, int]], bittensor.utils.registration.torch.nn.ParameterDict]