Docs

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

ParameterTypeRequiredDescription
kindstringYesStorage kind: "PERSISTENT" (survives restarts) or "LOCAL" (cleared on restart).
keystringYesHex-encoded key to write.
valuestringYesHex-encoded value to store.

Response

FieldTypeDescription
resultnullConfirms the value has been written.

Code Examples

Response Body

Response

Use 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 PERSISTENT kind survives node restarts; LOCAL kind is cleared when the node restarts.
  • Both key and value must be hex-encoded with a 0x prefix.