pallet_examples/lib.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! # FRAME Pallet Examples
19//!
20//! This crate contains a collection of simple examples of FRAME pallets, demonstrating useful
21//! features in action. It is not intended to be used in production.
22//!
23//! ## Pallets
24//!
25//! - [`pallet_example_basic`]: This pallet demonstrates concepts, APIs and structures common to
26//! most FRAME runtimes.
27//!
28//! - [`pallet_example_offchain_worker`]: This pallet demonstrates concepts, APIs and structures
29//! common to most offchain workers.
30//!
31//! - [`pallet_default_config_example`]: This pallet demonstrates different ways to implement the
32//! `Config` trait of pallets.
33//!
34//! - [`pallet_dev_mode`]: This pallet demonstrates the ease of requirements for a pallet in "dev
35//! mode".
36//!
37//! - [`pallet_example_kitchensink`]: This pallet demonstrates a catalog of all FRAME macros in use
38//! and their various syntax options.
39//!
40//! - [`pallet_example_split`]: A simple example of a FRAME pallet demonstrating the ability to
41//! split sections across multiple files.
42//!
43//! - [`pallet_example_frame_crate`]: Example pallet showcasing how one can be built using only the
44//! `frame` umbrella crate.
45//!
46//! - [`pallet_example_single_block_migrations`]: An example pallet demonstrating best-practices for
47//! writing storage migrations.
48//!
49//! - [`pallet_example_tasks`]: This pallet demonstrates the use of `Tasks` to execute service work.
50//!
51//! - [`pallet_example_view_functions`]: This pallet demonstrates the use of view functions to query
52//! pallet state.
53//!
54//! - [`pallet_example_authorization_tx_extension`]: An example `TransactionExtension` that
55//! authorizes a custom origin through signature validation, along with two support pallets to
56//! showcase the usage.
57//!
58//! **Tip**: Use `cargo doc --package <pallet-name> --open` to view each pallet's documentation.