NetworksAdded

Storage Map v101 → v490 · 1 shape change

Whether a subnet with given netuid exists.

Explore chain
Queried by: developersminersvalidatorssubnet ownersanalytics

The Big Picture

Subnets come and go. Before interacting with a subnet, you need to know if it exists. This storage is the canonical source for subnet existence - true means active, false (or missing) means dissolved or never created.

Why This Matters

Trying to register on subnet 47? First check if it exists. This prevents wasted transactions and helps you build robust applications that handle subnet lifecycle.

Example Scenario

Query NetworksAdded(netuid=1) returns true - subnet 1 exists. Query NetworksAdded(netuid=999) returns false - no such subnet. Iterate all netuids to get a list of active subnets.

Common Questions

What happens when a subnet is dissolved?
The entry becomes false. The netuid may be reused for a new subnet later.
How do I get a list of all active subnets?
Iterate NetworksAdded from 0 to TotalNetworks and collect where value is true.

Use Cases

  • Validate netuid before attempting registration
  • Enumerate all active subnets on the network
  • Build subnet discovery and listing tools
  • Check if a subnet still exists before querying its data

From Chain Metadata

MAP ( netuid ) --> network_is_added

Purpose & Usage

Purpose

Check if a subnet ID is valid and active.

Common Query Patterns

  • Check if a netuid is valid before registration
  • List all active subnets by iterating
Part of: Block EmissionSubnet Management

Migration Notes

v424 v432 Breaking

key type changed from u16 to NetUid

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Query Keys

#NameTypeDescription
1
netuid
NetUid u16Subnet ID

Stored Value

Whether the subnet has been added (the chain stores this as a bool)

Default Value

false 0x00

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

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 NetworksAdded storage
const netuid = 1;

const result = await api.query.SubtensorModule.NetworksAdded.getValue(netuid);
console.log("NetworksAdded:", result);

On-Chain Activity

Write Frequency
●●○○○○ Minimal <10K est. writes

Fewer than 10K writes

#261 most written storage item

Write Source Calls + Hooks

Modified by both user extrinsics and runtime hooks

As of block 9,385,000

Version History

v101 block 1 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : u16 → NetUid

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Current Version
v490