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#
Module Contents#
- class bittensor.core.chain_data.axon_info.AxonInfo[source]#
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).
- to_string()[source]#
Converts the
AxonInfo
object to a string representation using JSON.- Return type:
- classmethod from_string(json_string)[source]#
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 defaultAxonInfo
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.