bittensor.utils.subtensor#
Module providing common helper functions for working with Subtensor.
Attributes#
Functions#
|
Extracts and returns error information from the given pallet metadata. |
|
Saves error details and unique version identifier to a JSON file. |
Retrieves and returns the cached error information from a JSON file, if it exists. |
|
|
Fetches or retrieves cached Subtensor error definitions using metadata. |
|
Formats raw parent data into a list of tuples. |
|
Formats raw children data into a list of tuples. |
Module Contents#
- bittensor.utils.subtensor._logger#
- bittensor.utils.subtensor._USER_HOME_DIR#
- bittensor.utils.subtensor._BT_DIR#
- bittensor.utils.subtensor._ERRORS_FILE_PATH#
- bittensor.utils.subtensor._ST_BUILD_ID = 'subtensor_build_id'#
- bittensor.utils.subtensor._get_errors_from_pallet(pallet)[source]#
Extracts and returns error information from the given pallet metadata.
- Parameters:
pallet (PalletMetadataV14) – The pallet metadata containing error definitions.
- Returns:
A dictionary of errors indexed by their IDs.
- Return type:
- Raises:
ValueError – If the pallet does not contain error definitions or the list is empty.
- bittensor.utils.subtensor._save_errors_to_cache(uniq_version, errors)[source]#
Saves error details and unique version identifier to a JSON file.
- bittensor.utils.subtensor._get_errors_from_cache()[source]#
Retrieves and returns the cached error information from a JSON file, if it exists.
- bittensor.utils.subtensor.get_subtensor_errors(substrate)[source]#
Fetches or retrieves cached Subtensor error definitions using metadata.