-
Notifications
You must be signed in to change notification settings - Fork 5
document metagraph + upgrade glossary #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying developer-docs with
|
Latest commit: |
b5accf6
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1a963af3.developer-docs-6uq.pages.dev |
Branch Preview URL: | https://metagraph.developer-docs-6uq.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes/suggestions but LGTM!
|
||
```python | ||
# Save metagraph for later use | ||
metagraph.save() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe this is related to the m = Metagraph(...)
definition line from earlier. I'd suggest using m.save()
and m.load()
in these code examples for consistency
|
||
This section provides practical examples of working with the Bittensor metagraph using the Python SDK. Each example demonstrates different aspects of metagraph analysis and data extraction. | ||
|
||
Code examples can be found [here](https://github.com/latent-to/developer-docs/tree/main/static/code-examples/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link opens an empty GH page.
asyncio.run(main()) | ||
``` | ||
|
||
### Complete Neuron Information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this example returns an error:
Neuron 0:
UID: 0
Hotkey: 5H6vi9RFCQafW9ZXr6R7LDNMt38CTNBzG4grEEdKGGdhBHYp
Coldkey: 5CoRXrWzSQKrRzibFoLF39fKRUmvF2mMZKDvDexfWNR4ikQQ
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[39], line 31
28 print(f" ---")
30 if __name__ == "__main__":
---> 31 main()
Cell In[39], line 15, in main()
13 print(f" Hotkey: {neuron.hotkey}")
14 print(f" Coldkey: {neuron.coldkey}")
---> 15 print(f" Stake: τ{neuron.stake:.9f}")
16 print(f" Rank: {neuron.rank}")
17 print(f" Trust: {neuron.trust}")
TypeError: unsupported format string passed to Balance.__format__
## Source Code References | ||
|
||
### Core Implementation | ||
- **Metagraph Class**: [`bittensor/bittensor/core/metagraph.py`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link returns an empty page
- **Metagraph Class**: [`bittensor/bittensor/core/metagraph.py`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py) | |
- **Metagraph Class**: [`bittensor/bittensor/core/metagraph.py`](https://github.com/opentensor/bittensor/blob/master/bittensor/core/metagraph.py) |
|
||
### Core Implementation | ||
- **Metagraph Class**: [`bittensor/bittensor/core/metagraph.py`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py) | ||
- **Chain Data**: [`bittensor/bittensor/core/chain_data/metagraph_info.py`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/chain_data/metagraph_info.py) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Chain Data**: [`bittensor/bittensor/core/chain_data/metagraph_info.py`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/chain_data/metagraph_info.py) | |
- **Chain Data**: [`bittensor/bittensor/core/chain_data/metagraph_info.py`](https://github.com/opentensor/bittensor/blob/master/bittensor/core/chain_data/metagraph_info.py) |
- **Mathematical Operations**: [`subtensor/pallets/subtensor/src/epoch/math.rs`](https://github.com/opentensor/subtensor/blob/main/pallets/subtensor/src/epoch/math.rs) | ||
|
||
### Key Constants | ||
- **TAO Stake Weight**: [`bittensor/bittensor/core/settings.py:7`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/settings.py#L7) - `ROOT_TAO_STAKE_WEIGHT = 0.18` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **TAO Stake Weight**: [`bittensor/bittensor/core/settings.py:7`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/settings.py#L7) - `ROOT_TAO_STAKE_WEIGHT = 0.18` | |
- **TAO Stake Weight**: [`bittensor/bittensor/core/settings.py:7`](https://github.com/opentensor/bittensor/blob/master/bittensor/core/settings.py#L8) - `ROOT_TAO_STAKE_WEIGHT = 0.18` |
:::info Cache Location | ||
Metagraph files are saved to `~/.bittensor/metagraphs/network-{network}/netuid-{netuid}/block-{block_number}.pt` by default. The files are persistent and not temporary. | ||
|
||
**Source**: [`bittensor/bittensor/core/metagraph.py:96-115`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py#L96-L115) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Source**: [`bittensor/bittensor/core/metagraph.py:96-115`](https://github.com/opentensor/bittensor/blob/main/bittensor/core/metagraph.py#L96-L115) | |
**Source**: [`bittensor/bittensor/core/metagraph.py:96-115`](https://github.com/opentensor/bittensor/blob/master/bittensor/core/metagraph.py#L96-L115) |
No description provided.