Files
pezkuwi-sdk/bizinikiwi/pezframe/examples/offchain-worker
pezkuwichain b6d35f6faf chore: add Dijital Kurdistan Tech Institute to copyright headers
Updated 4763 files with dual copyright:
- Parity Technologies (UK) Ltd.
- Dijital Kurdistan Tech Institute
2025-12-27 21:28:36 +03:00
..

Offchain Worker Example Pezpallet

The Offchain Worker Example: A simple pezpallet demonstrating concepts, APIs and structures common to most offchain workers.

Run cargo doc --package pezpallet-example-offchain-worker --open to view this module's documentation.

This pezpallet serves as an example showcasing Bizinikiwi off-chain worker and is not meant to be used in production.

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: MIT-0