Crate sc_offchain
source ·Expand description
Substrate offchain workers.
The offchain workers is a special function of the runtime that gets executed after block is imported. During execution it’s able to asynchronously submit extrinsics that will either be propagated to other nodes or added to the next block produced by the node as unsigned transactions.
Offchain workers can be used for computation-heavy tasks that are not feasible for execution during regular block processing. It can either be tasks that no consensus is required for, or some form of consensus over the data can be built on-chain for instance via:
- Challenge period for incorrect computations
- Majority voting for results
- etc
Structs§
- Offchain DB that implements [
DbExternalities
] for [OffchainStorage
]. - Options for
OffchainWorkers
- An offchain workers manager.
Enums§
- Special type that implements
OffchainStorage
.
Constants§
- Persistent storage prefix used by the Offchain Worker API when creating a DB key.
Traits§
- NetworkProvider provides
OffchainWorkers
with all necessary hooks into the underlying Substrate networking. - The offchain worker api.