bittensor.core.chain_data.axon_info#
This module defines the AxonInfo class, a data structure used to represent information about an axon endpoint in the bittensor network.
Classes#
The AxonInfo class represents information about an axon endpoint in the bittensor network. This includes |
Module Contents#
- class bittensor.core.chain_data.axon_info.AxonInfo#
The AxonInfo class represents information about an axon endpoint in the bittensor network. This includes properties such as IP address, ports, and relevant keys.
- Variables:
version (int) – The version of the axon endpoint.
ip (str) – The IP address of the axon endpoint.
port (int) – The port number the axon endpoint uses.
ip_type (int) – The type of IP protocol (e.g., IPv4 or IPv6).
hotkey (str) – The hotkey associated with the axon endpoint.
coldkey (str) – The coldkey associated with the axon endpoint.
protocol (int) – The protocol version (default is 4).
placeholder1 (int) – Reserved field (default is 0).
placeholder2 (int) – Reserved field (default is 0).
- __repr__()#
- __str__()#
- classmethod from_neuron_info(neuron_info)#
Converts a dictionary to an AxonInfo object.
- classmethod from_parameter_dict(parameter_dict)#
Returns an axon_info object from a torch parameter_dict or a parameter dict.
- classmethod from_string(json_string)#
Creates an AxonInfo object from its string representation using JSON.
- Parameters:
json_string (str) – The JSON string representation of the AxonInfo object.
- Returns:
An instance of AxonInfo created from the JSON string. If decoding fails, returns a default AxonInfo object with default values.
- Return type:
- Raises:
json.JSONDecodeError – If there is an error in decoding the JSON string.
TypeError – If there is a type error when creating the AxonInfo object.
ValueError – If there is a value error when creating the AxonInfo object.
- to_parameter_dict()#
Returns a torch tensor or dict of the subnet info, depending on the USE_TORCH flag set.