Queries

metagraph

The full metagraph for a subnet in one call (stakes, ranks, emissions, axons, ...).

View as Markdown

name and symbol are decoded to text (the wire carries them as compact-u16 vectors of utf-8 bytes, unlike every other text field). On runtimes with miner collateral (spec >= 435), each neuron also carries collateral_locked, collateral_min, and collateral_earned (alpha balances; None on older nodes).

Category: Subnets

Parameters

ParameterTypeDescription
netuidintegerSubnet whose metagraph to fetch.

CLI

btcli query metagraph --netuid <integer> --json

Python

import bittensor as bt

sub = bt.Subtensor()
result = sub.read("metagraph", netuid=1)

On-chain implementation

Every file is browsable under /code exactly as built into the runtime.