set_storage

Call v101 → current #4

Set arbitrary storage values (root only).

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

Direct storage manipulation. Nuclear option for data fixes. Extremely dangerous.

Use Cases

  • Emergency data fixes
  • Migration support
  • Recovery from corruption

From Chain Metadata

Set some items of storage.

Input Parameters

#NameTypeDescription
0
items
Vec<(Vec<u8>, Vec<u8>)> Vec Vec<KeyValue>items (Vec<(Vec<u8>, Vec<u8>)>)

Permissions

Origin
Unknown
Required Role

Requirements

  • Caller is root/sudo
  • Valid storage key-value pairs

Effects

Postconditions

  • Storage values set directly
  • Bypasses all pallet logic

Side Effects

  • Can corrupt chain state
  • Bypasses validation and events

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);

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

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

Runtime Info

Pallet Index
0
Call Index
4
First Version
v101
Current Version
v411