Skip to content

Adding a New Pallet

Wil Wade edited this page Nov 2, 2022 · 3 revisions

Help for adding a new pallet (WIP)

Project Structure

Frequency
|
+-- runtime/frequency
|   |
|   +-- Cargo.toml   <-- One change in this file (import)
|   |
|   +-- build.rs
|   |
|   +-- src
|      |
|      +-- lib.rs   <-- Most changes in this file: to initialize Runtime for new pallet
|
+-- runtime/frequency-rococo
|   |
|   +-- Cargo.toml   <-- One change in this file (import)
|   |
|   +-- build.rs
|   |
|   +-- src
|      |
|      +-- lib.rs   <-- Most changes in this file: to initialize Runtime for new pallet
|
+-- pallets         <-- New pallet package goes here
|
+-- scripts
|
+-- node            <-- changes in this directory (client updates)
|
+-- ...

Common Checklist/Reminders

  • Setup feature flags if any and map them through the dependency chain
  • Weights setup
  • Benchmarks: Add it to scripts/run_all_benchmarks.sh
  • Map try-runtime feature through
  • Map std feature through
  • Update spec version
  • Additional notes and documentation templates in `pallets/README.md

Internal Pallet

  • Benchmarks: Add a new make benchmark-[pallet name]

External/Substrate Pallet

  • All configuration setup
    • Mainnet
    • Rococo