bittensor
bittensor copied to clipboard
Retrieving error types from the metadata of the Substrate palette "SubtensorModule" for the btcli console
Is your feature request related to a problem? Please describe.
The feature related with following issues:
- subtensor: UI and python client get the error types and error docs from metadata
- subtensor: Improve error granularity
Describe the solution you'd like
With functionality of substrateinterface lib, we retrieve the metadata from Subtensor.
This allows us to:
- Avoid hardcoding the error description.
- Always have up-to-date information about all errors on the server.
- Automatically receive updates to the list of errors and their descriptions.
Acceptance Criteria
- [x] Research: Exploring the logic of how the
substrateinterfacepackage interacts with metadata. - [x] Research: Exploring structure of metadata by the provided data.
- [x] Implementation: Retrieving metadata from
SubtensorModule. - [x] Implementation: Caching a JSON object with a list of errors in the user's directory.
- [x] Implementation: Logic to control the relevancy of cached data relative to server metadata.
- [x] Implementation: Covering new code with unit tests.
- [ ] Implementation: a wrapper for presenting the error in a human-readable view.
- [ ] Testing new logic on a local network.
Describe alternatives you've considered
Previously, the team considered the possibility of implementing an API endpoint that would return data about the list of errors. After starting the implementation, the decision was canceled in favor of using the capabilities of the substrateinterface package.