Questions tagged [offchain-worker]
Oracle-like capabilities for Substrate chains.
80
questions
2
votes
1
answer
43
views
How to make a fn only callable by an offchain worker?
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 ...
0
votes
1
answer
15
views
Why Off-chain worker does not deduct DispatchError in Substrate?
I am trying Substrate official off-chain example. I am throwing a DispatchError in my extrinsic.
#[pallet::call_index(0)]
#[pallet::weight({0})]
pub fn submit_price(origin: OriginFor&...
0
votes
0
answers
12
views
Not able to submit multiple signed transactions through off-chain worker
I have to submit 2 signed extrinsics through off-chain worker. The code structure of my off-chain worker is like this:
fn offchain_worker(block_number: BlockNumberFor<T>) {
if !...
0
votes
0
answers
21
views
Is there e2e testing framework/example for Substrate solo chain?
I am working on a live solo chain. I have to test a scenario where I want to hit HTTP API through off chain-worker. Unfortunately it's not possible to test in mock environment.
We can take an example ...
1
vote
0
answers
10
views
Encrypting data offchain / decrypting data with offchain worker
I want to create a StorageMap which looks like so:
pub type EncryptedData<T: Config> = StorageMap<_, Blake2_128Concat, SomeId, SomeEncryptedValue, OptionQuery>;
I plan to encrypt the data ...
1
vote
1
answer
67
views
Iterating on a storage from Offchain Worker Concerns
I have a StorageMap named PublicKeyToMsaId which has around 300K inserted items and I want to iterate on all of those keys-values in offchain-worker to create a reverse map in offchain storage.
To ...
2
votes
1
answer
68
views
How to write a dispatch function which can only access from offchain worker with signed extrinsic/transaction?
I want to modify some on-chain storage from offchain worker by sending a signed transaction, so I write a dispatch function which handles the transaction. But the dispatch function also can be ...
3
votes
1
answer
40
views
Is there a way to use a crate that depends on the `std` in substrate OCW?
from what I've learned so far, the OCW is designed specifically for executing heavy and time-consuming computations outside of the runtime. As the OCW is not a part of runtime/wasm, I guess the OCW ...
1
vote
1
answer
57
views
Iterate storage maps inside an offchain worker
I need to iterate over the following double map inside an offchain worker:
How can I access this map outside the pallet assets? Can I use an RPC method to get all the values for that double map ...
0
votes
1
answer
44
views
execute_block, initialize_block, apply_extrinsic, finalize_block, offchain_worker exists for struct `Executive` but its trait bound were not satisfied
I developed substrate parachain with custom pallets. Actually I wanna add OCW functionality to one of my pallets. After I updated runtime code and added CreateSignedTransaction implementation I tried ...
1
vote
0
answers
30
views
How can we monetize heavy computation using substrate blockchain?
Suppose a reputation system is built, where bad nodes (open source docker instances running computations such as a search engine) are penalized, and good nodes are incentivized. What is the secure way ...
1
vote
1
answer
77
views
How to use Offchain Workers to create HTTP POST requests with JSON-RPC body?
Too my knowledge there are no guides on how to write HTTP POST requests to a JSON-RPC API with http utilities that are available to Substrate offchain workers. What I understand currently is that the ...
1
vote
1
answer
44
views
Set Off-chain worker with AccountId20
The examples in substrate use the sr25519 AccountId and Multisignature for creating offchain workers with signed transactions. Is there a way to use AccountId20 and EthereumSignature for a node using ...
1
vote
1
answer
35
views
Would it be possible to make HTTP request on chain through pallet extrinsic?
We can make HTTP Get and Post request through Offchain worker. Can we also do the same on chain through pallet extrinsic?
Is there any restriction?
0
votes
1
answer
42
views
Substrate Offchain Worker - failed to fetch sample price
I am trying to use Substrate Offchain Worker. I implemented as mentioned here https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/examples/offchain-worker.
I am using same sample
...