Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.13 KB

README.md

File metadata and controls

51 lines (37 loc) · 2.13 KB

Open Runtime Module Library (ORML) Workshop

Sub0 Workshop Link: https://www.crowdcast.io/e/axvfinsv/19

This is a workshop project for learning about blockchain runtime development with Substrate, FRAME and the Open Runtime Module Library. This project implements a simple exchange protocol that is built on top of the ORML Currencies and Tokens pallets. After completing this workshop, participants should have a better understanding of how to design and implement a FRAME pallet.

It is recommanded to read commit by commit to understand each individual steps.

Add ORML Pallets

Find the implementations for the Currencies and Tokens pallets in the runtime. Notice that the Tokens pallet is configured with a CurrencyId set that specifies a native token; the Currencies pallet is configured to depend on the Tokens pallet.

Define an Exchange Protocol

The Exchange pallet defines a simple interface that depends on the ORML pallets that were configured in the previous step:

  • submit_order(from_id, from_amt, to_id, to_amt)
  • take_order(order_id)
  • cancel_order(order_id)

Build & Run

If you need to, set up your Substrate development environment. Then, build and run a development chain:

$ cargo run -- --dev --tmp

Once the node is running, use this link to open the Polkadot JS Apps UI and connect to the Substrate node: https://polkadot.js.org/apps/#/settings/developer?rpc=ws://127.0.0.1:9944. Use the Settings > Developer app and the contents of the types.json file to add the necessary types to the UI.

Upstream

This project was forked from the Substrate Developer Hub Node Template.