All pallets

System docs

Look up any call, event, or storage item with code examples. Runtime v472 · Block #9,197,056

Developer documentation for the System pallet of the Subtensor blockchain, part of the Bittensor decentralized AI network. This page is designed for developers integrating with the chain: look up any call, event, or storage item, copy code examples in TypeScript, Python, or Rust, and filter by your role. For in-depth explanations, version history, and relationships between items, see the Reference section.

System

Make some on-chain remark.

Index: 0 53 items

Calls 11

remark

call details

Post data on-chain without executing any logic.

Parameters

NameTypeFormatDescription
remarkVec<u8>Array of Integer (0-255)remark (Vec<u8>)
Emits: Remarked
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);

// Build remark call (typed, named args)
const remark = Binary.fromOpaque(new Uint8Array(0));

const tx = api.tx.System.remark({
  remark,
});

set_heap_pages

call details

Set the number of WASM heap pages (root only).

Parameters

NameTypeFormatDescription
pagesu64Integerpages (u64)
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);

// Build set_heap_pages call (typed, named args)
const pages = 0n;

const tx = api.tx.System.set_heap_pages({
  pages,
});

set_code

call details

Set the new runtime code with safety checks (root only).

Parameters

NameTypeFormatDescription
codeVec<u8>Array of Integer (0-255)code (Vec<u8>)
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);

// Build set_code call (typed, named args)
const code = Binary.fromOpaque(new Uint8Array(0));

const tx = api.tx.System.set_code({
  code,
});

set_code_without_checks

call details

Set runtime code without validation (root only, dangerous).

Parameters

NameTypeFormatDescription
codeVec<u8>Array of Integer (0-255)code (Vec<u8>)
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);

// Build set_code_without_checks call (typed, named args)
const code = Binary.fromOpaque(new Uint8Array(0));

const tx = api.tx.System.set_code_without_checks({
  code,
});

set_storage

call details

Set arbitrary storage values (root only).

Parameters

NameTypeFormatDescription
itemsVec<(Vec<u8>, Vec<u8>)>Array of (Vec<u8>, Vec<u8>)items (Vec<(Vec<u8>, Vec<u8>)>)
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);

// Build set_storage call (typed, named args)
const items = [] as [];

const tx = api.tx.System.set_storage({
  items,
});

kill_storage

call details

Remove storage values by key (root only).

Parameters

NameTypeFormatDescription
keysVec<Vec<u8>>Array of Array of Integer (0-255)keys (Vec<Vec<u8>>)
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);

// Build kill_storage call (typed, named args)
const keys = [] as [];

const tx = api.tx.System.kill_storage({
  keys,
});

kill_prefix

call details

Remove all storage items with a given prefix (root only).

Parameters

NameTypeFormatDescription
prefixVec<u8>Array of Integer (0-255)prefix (Vec<u8>)
subkeysu32Integersubkeys (u32)
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);

// Build kill_prefix call (typed, named args)
const prefix = Binary.fromOpaque(new Uint8Array(0));
const subkeys = 0;

const tx = api.tx.System.kill_prefix({
  prefix,
  subkeys,
});

remark_with_event

call details

Post data on-chain and emit a Remarked event.

Parameters

NameTypeFormatDescription
remarkVec<u8>Array of Integer (0-255)remark (Vec<u8>)
Emits: Remarked
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);

// Build remark_with_event call (typed, named args)
const remark = Binary.fromOpaque(new Uint8Array(0));

const tx = api.tx.System.remark_with_event({
  remark,
});

authorize_upgrade

call details

Authorize a future runtime upgrade by code hash (root only).

Parameters

NameTypeFormatDescription
code_hashH256256-bit Hashcode_hash: Cryptographic hash (32 bytes)
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);

// Build authorize_upgrade call (typed, named args)
const code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000";

const tx = api.tx.System.authorize_upgrade({
  code_hash,
});

authorize_upgrade_without_checks

call details

Authorize upgrade without version validation (root only, dangerous).

Parameters

NameTypeFormatDescription
code_hashH256256-bit Hashcode_hash: Cryptographic hash (32 bytes)
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);

// Build authorize_upgrade_without_checks call (typed, named args)
const code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000";

const tx = api.tx.System.authorize_upgrade_without_checks({
  code_hash,
});

apply_authorized_upgrade

call details

Apply a previously authorized runtime upgrade (any origin).

Parameters

NameTypeFormatDescription
codeVec<u8>Array of Integer (0-255)code (Vec<u8>)
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);

// Build apply_authorized_upgrade call (typed, named args)
const code = Binary.fromOpaque(new Uint8Array(0));

const tx = api.tx.System.apply_authorized_upgrade({
  code,
});

Events 8

ExtrinsicSuccess

event details

Emitted when an extrinsic completes successfully.

When it fires

  • Extrinsic dispatched without errors
  • All state changes applied successfully

Fields

NameTypeFormatDescription
dispatch_infoDispatchEventInfoDispatch Event InformationInformation about the extrinsic dispatch (weight, class, pays_fee)
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);

// Subscribe to ExtrinsicSuccess events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.ExtrinsicSuccess.get(block.hash);
  for (const evt of events) {
    console.log("ExtrinsicSuccess:", evt.payload);
  }
});

ExtrinsicFailed

event details

Emitted when an extrinsic fails during execution.

When it fires

  • Extrinsic encountered an error during dispatch

Fields

NameTypeFormatDescription
dispatch_errorDispatchErrorDispatch ErrorThe error that caused the extrinsic to fail
dispatch_infoDispatchEventInfoDispatch Event InformationInformation about the extrinsic dispatch
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);

// Subscribe to ExtrinsicFailed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.ExtrinsicFailed.get(block.hash);
  for (const evt of events) {
    console.log("ExtrinsicFailed:", evt.payload);
  }
});

CodeUpdated

event details

Emitted when the runtime code is updated.

When it fires

  • Valid runtime upgrade authorized
  • New code is valid WASM
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);

// Subscribe to CodeUpdated events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.CodeUpdated.get(block.hash);
  for (const evt of events) {
    console.log("CodeUpdated:", evt.payload);
  }
});

NewAccount

event details

Emitted when a new account is created on-chain.

When it fires

  • Account did not previously exist
  • Existential deposit requirement met

Fields

NameTypeFormatDescription
accountAccountIdSS58 AddressNewly created account address
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);

// Subscribe to NewAccount events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.NewAccount.get(block.hash);
  for (const evt of events) {
    console.log("NewAccount:", evt.payload);
  }
});

KilledAccount

event details

Emitted when an account is reaped (removed from state).

When it fires

  • Account balance fell below existential deposit
  • No locks preventing account removal

Fields

NameTypeFormatDescription
accountAccountIdSS58 AddressAccount that was reaped (balance went to zero)
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);

// Subscribe to KilledAccount events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.KilledAccount.get(block.hash);
  for (const evt of events) {
    console.log("KilledAccount:", evt.payload);
  }
});

Remarked

event details

Emitted when a remark is stored on-chain.

When it fires

  • Remark data provided
  • Transaction fee paid

Fields

NameTypeFormatDescription
senderAccountIdSS58 AddressAccount that sent the remark
hashH256256-bit HashBlake2-256 hash of the remark content
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);

// Subscribe to Remarked events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.Remarked.get(block.hash);
  for (const evt of events) {
    console.log("Remarked:", evt.payload);
  }
});

UpgradeAuthorized

event details

Emitted when a runtime upgrade is authorized for future application.

When it fires

  • Caller is root/sudo
  • Valid code hash provided

Fields

NameTypeFormatDescription
code_hashH256256-bit HashBlake2-256 hash of the authorized runtime code
check_versionboolBoolean (true/false)Whether version checks will be performed on application
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);

// Subscribe to UpgradeAuthorized events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.UpgradeAuthorized.get(block.hash);
  for (const evt of events) {
    console.log("UpgradeAuthorized:", evt.payload);
  }
});

RejectedInvalidAuthorizedUpgrade

event details

Emitted when an authorized upgrade fails validation during application.

When it fires

  • Upgrade was previously authorized
  • apply_authorized_upgrade was called
  • Code failed validation (wrong spec name, version didn't increase, etc.)

Fields

NameTypeFormatDescription
code_hashH256256-bit HashBlake2-256 hash of the rejected code
errorDispatchErrorDispatch ErrorThe validation error that caused rejection
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);

// Subscribe to RejectedInvalidAuthorizedUpgrade events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.System.RejectedInvalidAuthorizedUpgrade.get(block.hash);
  for (const evt of events) {
    console.log("RejectedInvalidAuthorizedUpgrade:", evt.payload);
  }
});

Storage 19

Account

storage details

Core account data including nonce, providers, and consumers.

Modifier: Default Keys: 1 Returns: AccountInfo

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
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 Account storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.System.Account.getValue(key1);
console.log("Account:", result);

AllExtrinsicsLen

storage details

Total length in bytes of all extrinsics in current block.

Modifier: Optional Keys: 0 Returns: u32 (Integer)
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 AllExtrinsicsLen storage (no keys - plain value)
const result = await api.query.System.AllExtrinsicsLen.getValue();
console.log("AllExtrinsicsLen:", result);

AuthorizedUpgrade

storage details

Pending authorized upgrade code hash.

Modifier: Optional Keys: 0 Returns: CodeUpgradeAuthorization
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 AuthorizedUpgrade storage (no keys - plain value)
const result = await api.query.System.AuthorizedUpgrade.getValue();
console.log("AuthorizedUpgrade:", result);

BlockHash

storage details

Maps block numbers to their hashes.

Modifier: Default Keys: 1 Returns: H256 (256-bit Hash)

Keys

NameTypeFormatDescription
key1u32Integer—
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 BlockHash storage
const key1 = 0;

const result = await api.query.System.BlockHash.getValue(key1);
console.log("BlockHash:", result);

BlockWeight

storage details

Current weight consumption for the block being built.

Modifier: Default Keys: 0 Returns: PerDispatchClass
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 BlockWeight storage (no keys - plain value)
const result = await api.query.System.BlockWeight.getValue();
console.log("BlockWeight:", result);

Digest

storage details

Digest items for the current block.

Modifier: Default Keys: 0 Returns: Digest
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 Digest storage (no keys - plain value)
const result = await api.query.System.Digest.getValue();
console.log("Digest:", result);

EventCount

storage details

Number of events in the current block.

Modifier: Default Keys: 0 Returns: u32 (Integer)
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 EventCount storage (no keys - plain value)
const result = await api.query.System.EventCount.getValue();
console.log("EventCount:", result);

Events

storage details

Events deposited during current block execution.

Modifier: Default Keys: 0 Returns: Vec<EventRecord> (Array of EventRecord)
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 Events storage (no keys - plain value)
const result = await api.query.System.Events.getValue();
console.log("Events:", result);

EventTopics

storage details

Map of event topics to event indices.

Modifier: Default Keys: 1 Returns: Vec<(u32, u32)> (Array of (u32, u32))

Keys

NameTypeFormatDescription
key1H256256-bit Hash—
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 EventTopics storage
const key1 = "0x0000000000000000000000000000000000000000000000000000000000000000";

const result = await api.query.System.EventTopics.getValue(key1);
console.log("EventTopics:", result);

ExecutionPhase

storage details

Current execution phase of block processing.

Modifier: Optional Keys: 0 Returns: Phase
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 ExecutionPhase storage (no keys - plain value)
const result = await api.query.System.ExecutionPhase.getValue();
console.log("ExecutionPhase:", result);

ExtrinsicCount

storage details

Total extrinsics count for the current block.

Modifier: Optional Keys: 0 Returns: u32 (Integer)
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 ExtrinsicCount storage (no keys - plain value)
const result = await api.query.System.ExtrinsicCount.getValue();
console.log("ExtrinsicCount:", result);

ExtrinsicData

storage details

Raw extrinsic data for current block by index.

Modifier: Default Keys: 1 Returns: Vec<u8> (Array of Integer (0-255))

Keys

NameTypeFormatDescription
key1u32Integer—
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 ExtrinsicData storage
const key1 = 0;

const result = await api.query.System.ExtrinsicData.getValue(key1);
console.log("ExtrinsicData:", result);

ExtrinsicWeightReclaimed

storage details

Weight reclaimed from current extrinsic.

Modifier: Default Keys: 0 Returns: Weight (Execution Weight)
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 ExtrinsicWeightReclaimed storage (no keys - plain value)
const result = await api.query.System.ExtrinsicWeightReclaimed.getValue();
console.log("ExtrinsicWeightReclaimed:", result);

InherentsApplied

storage details

Whether all inherents have been applied in current block.

Modifier: Default Keys: 0 Returns: bool (Boolean (true/false))
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 InherentsApplied storage (no keys - plain value)
const result = await api.query.System.InherentsApplied.getValue();
console.log("InherentsApplied:", result);

LastRuntimeUpgrade

storage details

Information about the last runtime upgrade.

Modifier: Optional Keys: 0 Returns: LastRuntimeUpgradeInfo
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 LastRuntimeUpgrade storage (no keys - plain value)
const result = await api.query.System.LastRuntimeUpgrade.getValue();
console.log("LastRuntimeUpgrade:", result);

Number

storage details

Current block number being processed.

Modifier: Default Keys: 0 Returns: u32 (Integer)
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 Number storage (no keys - plain value)
const result = await api.query.System.Number.getValue();
console.log("Number:", result);

ParentHash

storage details

Hash of the previous block.

Modifier: Default Keys: 0 Returns: H256 (256-bit Hash)
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 ParentHash storage (no keys - plain value)
const result = await api.query.System.ParentHash.getValue();
console.log("ParentHash:", result);

UpgradedToTripleRefCount

storage details

Migration flag for triple reference count upgrade.

Modifier: Default Keys: 0 Returns: bool (Boolean (true/false))
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 UpgradedToTripleRefCount storage (no keys - plain value)
const result = await api.query.System.UpgradedToTripleRefCount.getValue();
console.log("UpgradedToTripleRefCount:", result);

UpgradedToU32RefCount

storage details

Migration flag for u32 reference count upgrade.

Modifier: Default Keys: 0 Returns: bool (Boolean (true/false))
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 UpgradedToU32RefCount storage (no keys - plain value)
const result = await api.query.System.UpgradedToU32RefCount.getValue();
console.log("UpgradedToU32RefCount:", result);

Constants 6

BlockHashCount

constant details

Maximum number of block hashes to keep in storage.

Type: u32
Value: 2400
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 BlockHashCount constant
const value = await api.constants.System.BlockHashCount();
console.log("BlockHashCount:", value);

BlockLength

constant details

Maximum length of a block in bytes.

Type: BlockLength
Value (hex): 0x000078000000a0000000a000
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 BlockLength constant
const value = await api.constants.System.BlockLength();
console.log("BlockLength:", value);

BlockWeights

constant details

Weight limits and base weights for blocks.

Type: BlockWeights
Value: "4611698114781749442"
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 BlockWeights constant
const value = await api.constants.System.BlockWeights();
console.log("BlockWeights:", value);

DbWeight

constant details

Database read/write operation weights.

Type: RuntimeDbWeight
Value: "25000000"
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 DbWeight constant
const value = await api.constants.System.DbWeight();
console.log("DbWeight:", value);

SS58Prefix

constant details

SS58 address prefix for this chain.

Type: u16
Value: 42
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 SS58Prefix constant
const value = await api.constants.System.SS58Prefix();
console.log("SS58Prefix:", value);

Version

constant details

Runtime version information including spec name, version, and APIs.

Type: RuntimeVersion
Value (hex): 0x386e6f64652d73756274656e736f72386e6f64652d73756274656e736f7201000000d80100000100000064df6acb689907609b0500000037e397fc7c91f5e40200000040fe3ad401f8959a06000000fbc577b9d747efd601000000d2bc9897eed08f1503000000f78b278be53f454c02000000dd718d5cc53262d401000000ab3c0572291feb8b01000000ed99c5acb25eedf503000000bc9d89904f5b923f0100000037c8bb1350a9a2a804000000f3ff14d5ab52705903000000582211f65bb14b8906000000e65b00e46cedd0aa0200000068b66ba122c93fa70200000042e62be4a39e5b6001000000806df4ccaa9ed485010000008375104b299b74c5020000005d1fbfbe852f280701000000c6886e2f8e598b0a0100000043580abff6baab4505000000c0de4984d112f3b401000000cbca25e39f14238702000000a8b093e6508d9e9c010000001c4585bd5c707202010000000100000001
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 Version constant
const value = await api.constants.System.Version();
console.log("Version:", value);

Errors 9

InvalidSpecName

error details #0

The runtime upgrade has a different spec name than the current runtime.

Common Causes

  • Trying to deploy a runtime built for a different chain
  • Wrong runtime binary selected for upgrade
  • Accidental chain mismatch during upgrade process

How to Fix

Verify you have the correct runtime binary for Subtensor,Check that spec_name in the new runtime matches 'node-subtensor',Use the runtime from the official release for this chain

SpecVersionNeedsToIncrease

error details #1

The new runtime's spec version is not higher than the current version.

Common Causes

  • Trying to deploy an older runtime version
  • Forgetting to increment spec_version in the new runtime
  • Accidentally using a stale build

How to Fix

Verify the new runtime has a higher spec_version,Build the correct version with incremented version number,Use set_code_without_checks only if you absolutely need to bypass this

FailedToExtractRuntimeVersion

error details #2

The chain couldn't read version information from the new runtime code.

Common Causes

  • Corrupted WASM binary
  • Invalid or malformed runtime code
  • Missing Core_version runtime API

How to Fix

Verify the WASM binary is not corrupted,Rebuild the runtime from source,Ensure the runtime implements required APIs

NonDefaultComposite

error details #3

Can't kill an account that has non-default composite data.

Common Causes

  • Account has outstanding references (providers, consumers, sufficients)
  • Account has data in other pallets that hasn't been cleaned up

How to Fix

Clean up all references to the account first,Remove all locks, reserves, and other holds,Clear any pallet-specific data associated with the account

NonZeroRefCount

error details #4

There are still references preventing the account from being purged.

Common Causes

  • Account still has stake, locks, or other holds
  • Other pallets still reference this account
  • Reference count hasn't been properly decremented

How to Fix

Remove all stake and delegation,Clear all locks and reserves,Wait for all dependent operations to complete

CallFiltered

error details #5

This call is not allowed by the current call filter.

Common Causes

  • Call is disabled during safe mode
  • Chain configuration blocks this call type
  • Origin filter prevents this caller from making this call

How to Fix

Wait until the call filter is lifted,Use a different origin if applicable,Contact governance if the call should be enabled

MultiBlockMigrationsOngoing

error details #6

A multi-block migration is in progress and prevents code replacement.

Common Causes

  • Previous upgrade started a migration that spans multiple blocks
  • Migration hasn't completed yet

How to Fix

Wait for the current migration to complete,Check migration progress in logs or storage

NothingAuthorized

error details #7

No upgrade has been authorized for application.

Common Causes

  • Trying to apply an upgrade before authorizing it
  • Authorization was already used or revoked
  • Governance hasn't approved the upgrade yet

How to Fix

First authorize the upgrade using authorize_upgrade,Check AuthorizedUpgrade storage to see if authorization exists,Wait for governance to authorize the upgrade

Unauthorized

error details #8

The provided code doesn't match the authorized upgrade.

Common Causes

  • Code hash doesn't match what was authorized
  • Wrong runtime binary provided
  • Code was modified after authorization

How to Fix

Verify you have the exact code that was authorized,Check AuthorizedUpgrade storage for the expected hash,Request new authorization if the code has changed