offchain_localStorageGet - JSON-RPC Method
Description
Reads a value from the offchain worker local storage of the queried node. Offchain workers can persist data in either persistent or temporary storage; this RPC lets operators debug that state. Because it exposes node-local data, the method is typically available only on trusted endpoints.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
kind | string | Yes | Storage kind ("PERSISTENT" or "LOCAL" ) |
key | string | Yes | Hex-encoded key |
Request Example
{
"jsonrpc": "2.0",
"method": "offchain_localStorageGet",
"params": [
"PERSISTENT",
"0x6d795f6f6666636861696e5f6b6579"
],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"result": null,
"id": 1
}
A non-null result is a hex-encoded SCALE value written by an offchain worker.
Notes
- This RPC surfaces node-local data; public API providers often disable it for security.
- Use
"LOCAL"
to read ephemeral values stored for the current block. - Pair with
offchain_localStorageSet
on validator tooling for smoke tests.