I'm trying to access data that I'm storing through the RPC off-chain endpoint.
Is there any way to get the instance of off-chain storage in service.rs through which we can extract that has been stored using the front-end?
On the client-side we can get the off-chain storage instance from shared backend instance (which is of type Arc < FullBanckend >). This instance can be find inside new_full().
After getting the Bankend's shared instance, we can access our off-chain storage like this:
// The relevant ocw storage instance.
let ocw_storage = backend.offchain_storage();
// Prefix for accessing values for our application.
let prefix = &sp_offchain::STORAGE_PREFIX;
// Get our value
ocw_storage.get(prefix, key);
set
RPC here, notget
, which is wrong.localStorageSet
endpoint as displayed, and now not getting anything back when tryingOffchainStorage::get()
in code. Not sure if this changes your answer.