-
Notifications
You must be signed in to change notification settings - Fork 20
Adding a New Pallet
Matthew Orris edited this page Apr 23, 2025
·
8 revisions
Help for adding a new pallet
Frequency
├── Cargo.toml <-- Workspace defined here: add imports.
├── runtime
│ ├── common
│ │ ├── Cargo.toml. <-- Imported pallets may need to be added here.
│ │ └── src
│ │ ├── constants.rs
│ │ ├── extensions
│ │ ├── fee.rs
│ │ ├── lib.rs <-- Most changes in this file: Initialize Runtime for new pallet.
│ │ ├── proxy.rs
│ │ ├── signature.rs
│ │ └── weights
│ ├── frequency
│ │ ├── build.rs
│ │ ├── Cargo.toml. <-- Reference imported pallets from workspace, pass feature flags
│ │ │ (e.g. `std`) to dependencies and define new features, if needed.
│ │ └── src
│ │ ├── ethereum.rs
│ │ ├── genesis
│ │ └── lib.rs
│ └── system-runtime-api
│ ├── Cargo.toml
│ └── src
│ └── lib.rs
|
├── pallets <-- New custom pallet package goes here
├── node
│ ├── build.rs
│ ├── Cargo.toml
│ ├── cli
│ │ ├── build.rs
│ │ ├── Cargo.toml
│ │ └── src
│ │ ├── benchmarking.rs
│ │ ├── cli.rs
│ │ ├── command.rs
│ │ ├── export_metadata_cmd.rs
│ │ ├── lib.rs
│ │ ├── run_as_localchain.rs
│ │ ├── run_as_parachain.rs
│ │ └── runtime_version_cmd.rs
│ ├── cli-opt
│ │ ├── Cargo.toml
│ │ └── src
│ │ └── lib.rs
│ ├── service
│ │ ├── Cargo.toml
│ │ └── src
│ │ ├── block_sealing.rs
│ │ ├── chain_spec
│ │ ├── chain_spec.rs
│ │ ├── common.rs
│ │ ├── lib.rs
│ │ ├── rpc
│ │ └── service.rs
│ └── src
│ └── main.rs
- Setup feature flags if any and map them through the dependency chain
- Weights setup
- Benchmarks: Add it to
scripts/run_benchmarks.sh
- Map
try-runtime
feature through - Map
std
feature through - Update spec version
- Additional notes and documentation templates in `pallets/README.md
- Update Makefile with new feature flags
- Benchmarks: Add a new make benchmark-[pallet name]
- All configuration setup
- Mainnet
- Paseo