Publish Custom Pallets
Suggests how you can publish custom pallets and crates to make them available to the broader community.
Last updated
Suggests how you can publish custom pallets and crates to make them available to the broader community.
Last updated
As a blockchain builder or parachain developer, you have access to a large library of specialized pallets that you can assemble to customize your runtime to suite your specific project goals. To get a general sense of the number of the predefined pallets currently available, explore the Substrate . The selection of pallets available and the use cases they address is continuously evolving, including with many contributions from community members.
As you begin writing your own custom pallets to execute application-specific logic, you might find that your custom logic would benefit other teams or the broader ecosystem as a whole. If you have custom pallets that you want to share with the community, you can publish them in a publicly-accessible forum such as GitHub or crates.io.
This tutorial summarizes the steps for publishing your custom pallets and making them available as open source projects for other developers to use.
To publish your pallet on GitHub:
.
Select Public for the repository visibility.
for your pallet to the remote repository.
Add a file that describes the functions and usage for your pallet.
Add a LICENSE, CODE-OF-CONDUCT, CONTRIBUTING, or other files to the repository, as needed.
After you publish the pallet, other developers can import it into their runtime by including it in the Cargo.toml
file as follows:
Open a terminal shell and change to the root directory for the node template.
Open the runtime/Cargo.toml
configuration file in a text editor.
Locate the [dependencies] section.
Add a line similar to the following:
If you want developers to use a specific tag or commit for importing the pallet, you should include this information in the README.
After you publish the pallet, other developers can import it into their runtime by including it in the Cargo.toml
file as follows:
Open a terminal shell and change to the root directory for the node template.
Open the runtime/Cargo.toml
configuration file in a text editor.
Locate the [dependencies] section.
Add a line similar to the following:
If you publish the pallet on crates.io, developers don't need to specify a target destination. By default, cargo searches for the specified package in the crates.io registry.
The Rust community maintains the website to allow permissionless publishing of any Rust module. You could learn the procedure by following their guide on how to .
.