TotalNetworks

Storage Plain v101 → v411

Total number of subnets on the network.

Explore chain
Queried by: analyticsdeveloperssubnet owners

The Big Picture

This counter reflects Bittensor's growth as an ecosystem. Each subnet represents a unique AI task or market. More subnets = more diversity in the network's capabilities. This is a key health metric for the protocol.

Why This Matters

How many subnets exist? This single number tells you the scale of the Bittensor ecosystem. Also useful as an upper bound when iterating through netuids.

Example Scenario

Query TotalNetworks() returns 52. There are 52 subnets registered on the network. Use this with NetworksAdded to iterate: for netuid in 0..52, check NetworksAdded(netuid).

Common Questions

Does this include dissolved subnets?
This is the high-water mark - netuids go from 0 to TotalNetworks-1, but some may be dissolved. Check NetworksAdded for active status.
Is there a maximum?
Yes, there's a runtime limit on total subnets. Check SubnetLimit for the cap.

Use Cases

  • Display total subnet count on dashboards
  • Track network growth over time
  • Determine upper bound for netuid iteration
  • Monitor ecosystem expansion metrics

From Chain Metadata

ITEM( total_number_of_existing_networks )

Purpose & Usage

Purpose

Track network growth and subnet capacity.

Common Query Patterns

  • Single value query

Stored Value

total_number_of_existing_networks (u16)

Relationships

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query TotalNetworks storage (no keys - plain value)
const result = await api.query.SubtensorModule.TotalNetworks.getValue();
console.log("TotalNetworks:", result);

Version History

v101 block 1 Added
v123 block 720,235 Internal re-bind
v149 block 3,014,339 Internal re-bind
v166–v194 · runtime versions skipped on chain (never deployed)
v195 block 3,791,350 Internal re-bind
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind Current

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Plain
First Version
v101
Current Version
v411