2

My use case is this: an Offchain Worker sends Http requests to certain endpoints.

These endpoints are hardcoded on chain under current implementation.

I would like to be able to configure those endpoints and some other parameters locally once the Node is up, so the configuration is local-specific.

So I wonder if there is a way to access the Local Storage from the Outer Node ?

I can compile StorageValueRef::persistent on the Outer Node after the essential tasks are spawned, however it panics because of calling out of Externalities context.

1 Answer 1

2

Yes, there is an RPC method.

offchain_localStorageSet

enter image description here


  1. you need to enable --offchian-indexing for your node
  2. you need to enable --rpc-methods unsafe for your node
  3. you'd better don't expose your RPC endpoint, just use this in private network, because anyone can call this to set the storage
2
  • Cool. This seems to fit exactly my use case. Thanks a lot ! Commented May 8, 2023 at 2:25
  • So, could you please mark this as the answer?
    – aurexav
    Commented May 8, 2023 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.