I don't think this is possible but is it?
I have data that comes from an API that ultimately needs to be stored onchain which I don't want to risk having done through a Pays::No
fn in case the call takes longer than the block.
This seems like one of the only solutions I can find to do this; by creating logic that only specified stored accounts through a Pays::No
fn can call on a per interim basis.
But this solution can possibly take longer than the block time since it uses an API call.
There are basically two ways I think I want to do this, either have a user who the blockchain knows who it is to make the http call (possible using Pays:No), or through initialize (same issue in case http takes too long), or have the offchain worker call it but this requires public functions.
Is there any way to have a offchain worker store data without exposing the Call
to the public?
Or...Such as, storing the offchain API call in local storage, then allowing anyone to submit that data using an unsigned tx after a certain amount of time? But how safe is storing the data to local storage?
How would you solve this