Accessing an offchain worker's local storage from outside the offchain worker's context

Viewed 67

Is it possible to access an offchain worker's local storage from outside the offchain worker's context? I have an offchain worker that computes sth and stores it in its local storage. I've tried to add an api to my pallet which reads the value from the storage but I got an error that the local storage may be accessed only from an offchain worker context. How could I access the variable from some client code?

A potential solution would be to let the offchain worker encrypt the value, post it on blockchain, and the client code would decrypt it. This seems, however, as unoptimal solution, as it wastes precious chain storage when offchain worker and client execute on the same machine and has access to the same key pairs.

0 Answers
Related