StakingColdkeysByIndex

Storage Map v334 → current

Index mapping for iterating staking coldkeys.

Explore chain
Queried by: analyticsdevelopers

The Big Picture

Supporting index for efficient iteration over all coldkeys that have stake. Used internally for enumeration operations and analytics.

Use Cases

  • Enumerate all stakers efficiently
  • Build comprehensive staking analytics
  • Export staker lists

Purpose & Usage

Purpose

Efficient enumeration of all coldkeys with stake.

Common Query Patterns

  • Iterate by index

Query Keys

#NameTypeDescription
1
key1
u64 key1 (u64)

Stored Value

value (AccountId)

hex -> SS58

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query StakingColdkeysByIndex storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("StakingColdkeysByIndex")](
  key1
);

console.log("StakingColdkeysByIndex:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v334
Current Version
v393