bittensor.utils.networking#
Utils for handling local network with ip and ports.
Exceptions#
| Raised if we cannot attain your external ip from CURL/URLLIB/IPIFY/AWS | 
Functions#
| 
 | Maps an integer to a unique ip-string | 
| 
 | Maps an ip-string to a unique integer. | 
| 
 | Returns the ip version (IPV4 or IPV6). | 
| 
 | Return a formatted ip string | 
| Checks CURL/URLLIB/IPIFY/AWS for your external ip. | |
| 
 | Returns a formatted websocket endpoint url. | 
| 
 | Decorator ensuring the function executes with an active substrate connection. | 
Module Contents#
- bittensor.utils.networking.int_to_ip(int_val)[source]#
- Maps an integer to a unique ip-string :param int_val: The integer representation of an ip. Must be in the range (0, 3.4028237e+38). :type int_val: int 
- bittensor.utils.networking.ip_to_int(str_val)[source]#
- Maps an ip-string to a unique integer. arg: - str_val (:tyep:`str`, `required):
- The string representation of an ip. Of form ..*.* for ipv4 or :::::* for ipv6 
 
- bittensor.utils.networking.ip_version(str_val)[source]#
- Returns the ip version (IPV4 or IPV6). arg: - str_val (:tyep:`str`, `required):
- The string representation of an ip. Of form ..*.* for ipv4 or :::::* for ipv6 
 
- exception bittensor.utils.networking.ExternalIPNotFound[source]#
- Bases: - Exception- Raised if we cannot attain your external ip from CURL/URLLIB/IPIFY/AWS - Initialize self. See help(type(self)) for accurate signature. 
- bittensor.utils.networking.get_external_ip()[source]#
- Checks CURL/URLLIB/IPIFY/AWS for your external ip. :returns: Your routers external facing ip as a string. :rtype: external_ip ( - strrequired)- Raises:
- ExternalIPNotFound (Exception) – Raised if all external ip attempts fail. 
- Return type: