โš ๏ธBlast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today โ†’
Skip to main content

offchain_localStorageSet - JSON-RPC Method

Descriptionโ€‹

Stores a value in the node's offchain worker local storage. This RPC is primarily for debugging custom offchain logic and is typically restricted to validator operators running trusted infrastructure.

Parametersโ€‹

ParameterTypeRequiredDescription
kindstringYesStorage kind ("PERSISTENT" or "LOCAL")
keystringYesHex-encoded key
valuestringYesHex-encoded SCALE-encoded value

Request Exampleโ€‹

{
"jsonrpc": "2.0",
"method": "offchain_localStorageSet",
"params": [
"PERSISTENT",
"0x6d795f6f6666636861696e5f6b6579",
"0x01020304"
],
"id": 1
}

Response Exampleโ€‹

{
"jsonrpc": "2.0",
"result": null,
"id": 1
}

The call returns null on success. Read back the value using offchain_localStorageGet.

Notesโ€‹

  • Only use this RPC on trusted nodes; writing arbitrary offchain values can influence custom logic executed by the node.
  • Storage writes are not persisted across nodesโ€”each node maintains its own offchain database.
  • Combine with offchain worker metrics to validate job execution during staging deployments.