mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
3c50838dc3
* change (CI): markdown link checker * Fix some invalid doc links (re-run of cargo-unleash gen-readme w/ fixes). * Fix some invalid doc links * Fix some invalid doc links * Fix some links * Fix some links * Apply @bkchr suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Fix more links * Fix more links * typo * Fix more links * Fix more links * Ignore valid link .. check wrongly sees it as invalid * Fix style issue * Fix style issue * change (CI): update style guide link * change (lib): suggestions Co-authored-by: Dan Forbes <dan@danforbes.dev> Co-authored-by: Steve Degosserie <steve@parity.io> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
27 lines
1.1 KiB
Markdown
27 lines
1.1 KiB
Markdown
<!-- markdown-link-check-disable -->
|
|
# Offchain Worker Example Module
|
|
|
|
The Offchain Worker Example: A simple pallet demonstrating
|
|
concepts, APIs and structures common to most offchain workers.
|
|
|
|
Run `cargo doc --package pallet-example-offchain-worker --open` to view this module's
|
|
documentation.
|
|
|
|
- [`pallet_example_offchain_worker::Trait`](./trait.Trait.html)
|
|
- [`Call`](./enum.Call.html)
|
|
- [`Module`](./struct.Module.html)
|
|
|
|
|
|
## Overview
|
|
|
|
In this example we are going to build a very simplistic, naive and definitely NOT
|
|
production-ready oracle for BTC/USD price.
|
|
Offchain Worker (OCW) will be triggered after every block, fetch the current price
|
|
and prepare either signed or unsigned transaction to feed the result back on chain.
|
|
The on-chain logic will simply aggregate the results and store last `64` values to compute
|
|
the average price.
|
|
Additional logic in OCW is put in place to prevent spamming the network with both signed
|
|
and unsigned transactions, and custom `UnsignedValidator` makes sure that there is only
|
|
one unsigned transaction floating in the network.
|
|
|
|
License: Unlicense |