offchain_localStorageSet - Bittensor RPC Method
Write a value to the node's offchain local storage on Bittensor. Administrative method.
Writes a key-value pair to the node's offchain local storage. Offchain local storage is a node-local key-value store used by offchain workers and is not shared across the network or stored on-chain. This is an administrative method that requires the node to be running with --rpc-methods unsafe.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | Storage kind: "PERSISTENT" (survives restarts) or "LOCAL" (cleared on restart). |
key | string | Yes | Hex-encoded key to write. |
value | string | Yes | Hex-encoded value to store. |
Response
| Field | Type | Description |
|---|---|---|
result | null | Confirms the value has been written. |
Code Examples
Response Body
ResponseUse Cases
- Offchain worker configuration -- Pre-load configuration or seed data for offchain workers on a self-hosted Bittensor node.
- Testing and development -- Inject test data into offchain storage for developing and debugging offchain worker logic.
- External data caching -- Store external API responses or oracle data that offchain workers can use in subsequent runs.
Notes
- This is an unsafe/administrative method. It is disabled on public RPC endpoints including Dwellir's shared Bittensor nodes.
- In live checks on Dwellir-hosted public Bittensor endpoints, the call returns
-32601 RPC call is unsafe to be called externally. - Offchain storage is local to each node and is not replicated across the network.
- The
PERSISTENTkind survives node restarts;LOCALkind is cleared when the node restarts. - Both key and value must be hex-encoded with a
0xprefix.
Related Methods
offchain_localStorageGet-- Read a value from offchain local storageoffchain_localStorageClear-- Remove a key from offchain local storage