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>)> Vecitems (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 { 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 });

// Build set_storage call
const items = 0;

const call = api.tx[stringCamelCase("System")][stringCamelCase("set_storage")](
  items
);

Runtime Info

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