Questions tagged [offchain-worker]

Oracle-like capabilities for Substrate chains.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Is it expected that Offchain Workers do not have access to the DispatchResultWithPostInfo return when calling extrinsics?

I have an offchain worker which does various things offline and then calls an online extrinsic. Here's the line where I call the extrinsic from the offchain worker: let result = signer....
user avatar
0 votes
0 answers
28 views

How to get on-chain data on pallet?

I want to get some 'trustful' on-chain data on the pallet, for example, get transaction data by transaction hash. I found Offchain Workers might do that job but is it really trustful because the API ...
user avatar
0 votes
0 answers
17 views

offchain http issue

I have integrated offchain http cal to fetch ibfo from infura as below ''' fn fetch_block(block: &str) -> Result<BlockHeader, http::Error> { // debug::native::debug!("INFURA: ...
user avatar
  • 121
3 votes
0 answers
49 views

Calling CLI subcommand through different terminal after running the node

I'm trying to set some off-chain storage through a different terminal using a custom subcommand after starting up the node. Question here is: Is there any way to call the custom CLI subcommand in the ...
user avatar
1 vote
1 answer
33 views

How to ensure call was made by Offchain Worker

Feels like a very newbie question but, whilst I've found hints of how to implement this, I can't find the recommended solution. I have an offchain worker that does some validation of remote data and ...
user avatar
0 votes
0 answers
4 views

To run subprocess from substrate-node ocw-context

I am trying to execute shell script which will check for some custom required process if it is not running then it will restart the process. For that I have below snippet code(Inside fn ...
user avatar
  • 121
1 vote
1 answer
36 views

How to get the Peer count in an Off Chain Worker?

I have an Off Chain Worker that validates some data in IPFS and then calls a function on chain to set the status to valid or invalid. That's all working fine. However, I do not need all nodes to ...
user avatar
2 votes
0 answers
69 views

Accessing On-Chain Data In an Off-Chain Worker

I am looking to aggregate On-Chain data in an Off-Chain Worker, e.g. summing transaction fees included in blocks from the last 24 hrs. This is listed as one of the main use cases for Off-Chain Workers....
user avatar
  • 21
7 votes
2 answers
603 views

When does an off-chain worker get executed?

I have a scenario where I want to execute a scheduled call via the scheduler pallet at block number n. This call will change certain storage items of pallet. So before this storage changes, I want to ...
user avatar
3 votes
2 answers
49 views

How can a OCW determine if a node is fully synced?

Is there a status-call/api that a OCW could invoke in order to establish if the actual running node instance is fully synced? Maybe listening to a frame_system event? Or knowing the total blocks ...
user avatar
4 votes
1 answer
76 views

Is it possible to query an OCW's Off-chain storage via RPC from an external service?

I'm off-chain indexing some pallet events into my off-chain local storage using an OCW. Now, I want to be able to retrieve this data via RPC from an external service. Is this possible? Does it require ...
user avatar
3 votes
2 answers
45 views

Persistent Offchain Worker Storage

Offchain workers storage comes in two flavors: Persistent and Local. pub enum StorageKind { /// Persistent storage is non-revertible and not fork-aware. It means that any value /// set by the ...
user avatar
2 votes
2 answers
50 views

How to avoid multiple OCWs duplicating work?

We are running 2 OCWs each in separate instances and we have an extrinsic which mutates a storage in runtime which is done twice from the 2 OCWs but we want only one OCW to sign. How to do that? For ...
user avatar
3 votes
2 answers
68 views

How to create a transaction that calls an offchain worker?

Is it possible to create a transaction that calls an offchain worker to write data to the offchain worker?
user avatar
1 vote
1 answer
37 views

Process ethereum transactions in an offchain worker

I need to process Ethereum transactions in a substrate offchain worker. I already include EVM and Ethereum pallets, but I also need to do some communications with runtime code running as solidity ...
user avatar
  • 113
2 votes
2 answers
71 views

Can I call external APIs inside my pallet?

How can I call external APIs from the chain then use that data to implement further logic
user avatar