This repository is built based on Substrate Node Template v3.0.0+monthly-2021-10
.
The purpose is to demonstrate what off-chain worker could do, and how one would go about using it.
-
First, complete the basic Rust setup instructions.
-
To run it, use Rust's native
cargo
command to build and launch the template node:
cargo run --release -- --dev --tmp
- To build it, the
cargo run
command will perform an initial build. Use the following command to build the node without launching it:
cargo build --release
Since this repository is based on Substrate Node Template, it's README applies to this repository as well.
-
The core of OCW features are demonstrated in
pallets-ocw
, andpallets-example-offchain-worker
.Note that in order for the offchain worker to run, we have injected Alice key in
node/service.rs
-
Goto docs/README.md to learn more about off-chain worker (extracted from Substrate Recipes, based on Substrate v3).
-
Review the code of Offchain Worker Example Pallet within Substrate and its rustdoc. This pallet is also added in this repository.