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.
Calls 11
Post data on-chain without executing any logic.
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
remark | Vec<u8> | Array of Integer (0-255) | remark (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 remark call (typed, named args)
const remark = Binary.fromOpaque(new Uint8Array(0));
const tx = api.tx.System.remark({
remark,
});Set the number of WASM heap pages (root only).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
pages | u64 | Integer | pages (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 the new runtime code with safety checks (root only).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
code | Vec<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 runtime code without validation (root only, dangerous).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
code | Vec<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 arbitrary storage values (root only).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
items | Vec<(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,
});Remove storage values by key (root only).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
keys | Vec<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,
});Remove all storage items with a given prefix (root only).
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
prefix | Vec<u8> | Array of Integer (0-255) | prefix (Vec<u8>) |
subkeys | u32 | Integer | subkeys (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,
});Post data on-chain and emit a Remarked event.
Parameters
| Name | Type | Format | Description |
|---|---|---|---|
remark | Vec<u8> | Array of Integer (0-255) | remark (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 remark_with_event call (typed, named args)
const remark = Binary.fromOpaque(new Uint8Array(0));
const tx = api.tx.System.remark_with_event({
remark,
});Events 8
Emitted when an extrinsic completes successfully.
When it fires
- Extrinsic dispatched without errors
- All state changes applied successfully
Fields
| Name | Type | Format | Description |
|---|---|---|---|
dispatch_info | DispatchEventInfo | Dispatch Event Information | Information 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);
}
});Emitted when an extrinsic fails during execution.
When it fires
- Extrinsic encountered an error during dispatch
Fields
| Name | Type | Format | Description |
|---|---|---|---|
dispatch_error | DispatchError | Dispatch Error | The error that caused the extrinsic to fail |
dispatch_info | DispatchEventInfo | Dispatch Event Information | Information 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);
}
});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);
}
});Emitted when a new account is created on-chain.
When it fires
- Account did not previously exist
- Existential deposit requirement met
Fields
| Name | Type | Format | Description |
|---|---|---|---|
account | AccountId | SS58 Address | Newly 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);
}
});Emitted when an account is reaped (removed from state).
When it fires
- Account balance fell below existential deposit
- No locks preventing account removal
Fields
| Name | Type | Format | Description |
|---|---|---|---|
account | AccountId | SS58 Address | Account 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);
}
});Emitted when a remark is stored on-chain.
When it fires
- Remark data provided
- Transaction fee paid
Fields
| Name | Type | Format | Description |
|---|---|---|---|
sender | AccountId | SS58 Address | Account that sent the remark |
hash | H256 | 256-bit Hash | Blake2-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);
}
});Emitted when a runtime upgrade is authorized for future application.
When it fires
- Caller is root/sudo
- Valid code hash provided
Fields
| Name | Type | Format | Description |
|---|---|---|---|
code_hash | H256 | 256-bit Hash | Blake2-256 hash of the authorized runtime code |
check_version | bool | Boolean (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);
}
});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
| Name | Type | Format | Description |
|---|---|---|---|
code_hash | H256 | 256-bit Hash | Blake2-256 hash of the rejected code |
error | DispatchError | Dispatch Error | The 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
Core account data including nonce, providers, and consumers.
AccountInfo Keys
| Name | Type | Format | Description |
|---|---|---|---|
key1 | AccountId | SS58 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);Total length in bytes of all extrinsics in current block.
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);Pending authorized upgrade code hash.
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);Maps block numbers to their hashes.
H256 (256-bit Hash)Keys
| Name | Type | Format | Description |
|---|---|---|---|
key1 | 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 BlockHash storage
const key1 = 0;
const result = await api.query.System.BlockHash.getValue(key1);
console.log("BlockHash:", result);Current weight consumption for the block being built.
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 items for the current block.
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);Number of events in the current block.
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 deposited during current block execution.
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);Map of event topics to event indices.
Vec<(u32, u32)> (Array of (u32, u32))Keys
| Name | Type | Format | Description |
|---|---|---|---|
key1 | 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 EventTopics storage
const key1 = "0x0000000000000000000000000000000000000000000000000000000000000000";
const result = await api.query.System.EventTopics.getValue(key1);
console.log("EventTopics:", result);Current execution phase of block processing.
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);Total extrinsics count for the current block.
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);Raw extrinsic data for current block by index.
Vec<u8> (Array of Integer (0-255))Keys
| Name | Type | Format | Description |
|---|---|---|---|
key1 | 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 ExtrinsicData storage
const key1 = 0;
const result = await api.query.System.ExtrinsicData.getValue(key1);
console.log("ExtrinsicData:", result);Weight reclaimed from current extrinsic.
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);Whether all inherents have been applied in current block.
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);Information about the last runtime upgrade.
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);Current block number being processed.
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);Hash of the previous block.
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);Migration flag for triple reference count upgrade.
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);Migration flag for u32 reference count upgrade.
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
Maximum number of block hashes to keep in storage.
u322400import { 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);Maximum length of a block in bytes.
BlockLength0x000078000000a0000000a000import { 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);Weight limits and base weights for blocks.
BlockWeights"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);Database read/write operation weights.
RuntimeDbWeight"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);SS58 address prefix for this chain.
u1642import { 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);Runtime version information including spec name, version, and APIs.
RuntimeVersion0x386e6f64652d73756274656e736f72386e6f64652d73756274656e736f7201000000d80100000100000064df6acb689907609b0500000037e397fc7c91f5e40200000040fe3ad401f8959a06000000fbc577b9d747efd601000000d2bc9897eed08f1503000000f78b278be53f454c02000000dd718d5cc53262d401000000ab3c0572291feb8b01000000ed99c5acb25eedf503000000bc9d89904f5b923f0100000037c8bb1350a9a2a804000000f3ff14d5ab52705903000000582211f65bb14b8906000000e65b00e46cedd0aa0200000068b66ba122c93fa70200000042e62be4a39e5b6001000000806df4ccaa9ed485010000008375104b299b74c5020000005d1fbfbe852f280701000000c6886e2f8e598b0a0100000043580abff6baab4505000000c0de4984d112f3b401000000cbca25e39f14238702000000a8b093e6508d9e9c010000001c4585bd5c707202010000000100000001import { 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
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
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
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
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
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
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
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
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