15 releases (3 stable)

3.0.0 Feb 10, 2021
2.0.1 Jan 11, 2021
2.0.0 Sep 22, 2020
2.0.0-rc5 Jul 24, 2020
2.0.0-alpha.5 Mar 24, 2020

#1370 in Magic Beans

Download history 1706/week @ 2021-04-04 1652/week @ 2021-04-11 1462/week @ 2021-04-18 1766/week @ 2021-04-25 1327/week @ 2021-05-02 1613/week @ 2021-05-09 1517/week @ 2021-05-16 1545/week @ 2021-05-23 1620/week @ 2021-05-30 2860/week @ 2021-06-06 1552/week @ 2021-06-13 1491/week @ 2021-06-20 1442/week @ 2021-06-27 1618/week @ 2021-07-04 1441/week @ 2021-07-11 1283/week @ 2021-07-18

7,282 downloads per month
Used in 16 crates (via sc-service)

GPL-3.0-or-later WITH Classpath-exception-2.0

1.5MB
30K SLoC

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:

  1. Challenge period for incorrect computations
  2. Majority voting for results
  3. etc

License: GPL-3.0-or-later WITH Classpath-exception-2.0


lib.rs:

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:

  1. Challenge period for incorrect computations
  2. Majority voting for results
  3. etc

Dependencies

~20–27MB
~541K SLoC