Lookup

Storage Map v133 → current

Lookup from a name to the block number and index of the task.

Explore chain
Queried by: developersanalytics

The Big Picture

Index from task names to their location in the Agenda. Essential for cancel_named and related operations.

Use Cases

  • Find named tasks
  • Check if a name is in use
  • Manage named schedules

From Chain Metadata

Lookup from a name to the block number and index of the task. For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4 identities.

Purpose & Usage

Purpose

Enables named task management - find tasks by name instead of (block, index).

Common Query Patterns

  • Query by 32-byte name/id to find task location

Query Keys

#NameTypeDescription
1
key1
[u8; 32] [32]key1 ([u8; 32])

Stored Value

value ((u32, u32))

Relationships

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 Lookup storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("Scheduler")]
  [stringCamelCase("Lookup")](
  key1
);

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

Runtime Info

Pallet
Scheduler
Storage Kind
Map
First Version
v133
Current Version
v393