infrablockchain-docs
en
en
  • InfraBlockchain
    • Learn
      • Architecture
        • Architecture
        • Network Participants
        • Parachain
          • System Parachains
      • Protocol
        • System Token
        • Transaction Fee
        • Proof of Transaction
      • Substrate
        • Learn
          • Basic
            • Cryptography
            • Blockchain Basics
            • Consensus
            • Networks and Nodes
            • Blockchain Transaction
            • Transaction Life Cycle
            • Offchain Operations
            • Light Client
            • Rust for Substrate
            • Introduction to Library
            • Architecture and Rust Libraries
            • File Architecture
            • Accounts, Addresses, and Keys
            • Transaction Format
            • Blockchain Randomness
          • FRAME
            • FRAME Pallets
            • FRAME Macros
            • Custom Pallets
            • Pallet Coupling
            • Origin
            • Events and Erros
            • Runtime Storage
            • State Transitions and Storage
            • SCALE Encoding
            • Weight and Fee
            • Runtime API
            • Runtime Development
          • Account
          • Address Format
          • Glossary
          • CLI
            • Archive
            • Memory Profiler
            • Node Template
            • sidecar
            • srtool
            • Subkey
            • subxt
            • try-runtime
            • tx-wrapper
          • Runtime Development
            • Basics
              • Configure Genesis State
              • Configure Runtime Constants
              • Customize a Chain Spec
              • Import a Pallet
              • Use Helper Function
            • Consensus Model
              • PoW
              • Create a Hybrid Node
            • Offchain Worker
              • Request Offchain HTTP
              • Offchain Indexing
              • Offchain Local Storage
            • Pallet Design
              • Create a Storage Structure
              • Implement Lockable Currency
              • Incorporate Randomness
              • Loose Coupling
              • Tight Coupling
            • Parachain Development
              • Add HRMP Channel
              • Add Paranodes
              • Connect to a Local Relay Chain
              • Convert a Solo Chain
              • Prepare to Launch
              • Select Collator
              • Upgrade a Parachain
            • Storage Migration
              • Basics
              • Trigger Migration
            • Test
              • Basics
              • Test a Transfer Transaction
            • Tools
              • Create a TxWrapper
              • Use Sidecar
              • try-runtime
              • Verify WASM
            • Weigths
              • Benchmark
              • Calculate Fees
              • Use Conditional Weights
              • Use Custom Weights
        • Build
          • Decide What to Build
          • Build Process
          • Determinisitc Runtime
          • Chain Spec
          • Genesis Configuration
          • Application Development
          • RPC
          • Troubleshoot Your Code
        • Tutorials
          • Install
            • Developer Tools
            • Linux
            • macOS
            • Rust Toolchain
            • Issues
            • Windows
          • Quick Start
            • Explore the Code
            • Modify Runtime
            • Start a Node
            • Substrate Basics
          • Build a Blockchain
            • Add Trusted Nodes
            • Authorize Specific Nodes
            • Build a Local Blockchain
            • Simulate Network
            • Upgrade a Running Network
          • Build Application Logic
            • Add a Pallet
            • Add Offchasin Workers
            • Publish Custom Pallets
            • Specify Origin for a Call
            • Use Macros in a Custom Pallet
          • Integrate with Tools
            • Access EVM Accounts
            • EVM Integration
            • Explore Sidecar Endpoints
            • Integrate a Light Client Node
          • Smart Contracts
            • Strategy
            • Build a Token Contract
            • Develop a Smart Contract
            • Prepare Your First Contract
            • Troubleshoot Smart Contracts
            • Use Maps for Storing Values
      • XCM
        • XCM
        • XCM Format
    • Service Chains
      • InfraDID
      • InfraEVM
      • URAuth(Universal Resource Auth)
    • DevOps
      • Build
      • Deploy
      • Monitoring
      • Runtime Upgrade
    • Tutorials
      • Basic
        • How to Interact with System Token
        • How To Pay Transaction Fee
        • How To Vote with TaaV
        • Hot to Get Validator Reward
      • Build
        • Build InfraRelayChain
        • Build Parachain
        • Open Message Passing Channels
        • Transfer Assets with XCM
      • Test
        • Benchmark
        • Check Runtime
        • Debug
        • Simulate Parachains
        • Unit Testing
      • Service Chains
        • Play with InfraDID
          • Build
          • Add Keys
          • Add Service Endpoint
          • Create InfraDID
        • Play with InfraEVM
          • Build
          • Deposit and Withdraw Token
          • Deploy ERC20 Contract
          • Deploy ERC721 Contract
          • Deploy ERC1155 Contract
  • Newnal Data Market
Powered by GitBook
On this page
  • Publishing on GitHub
  • Publishing on crates.io
  • Where to go next
  1. InfraBlockchain
  2. Learn
  3. Substrate
  4. Tutorials
  5. Build Application Logic

Publish Custom Pallets

Suggests how you can publish custom pallets and crates to make them available to the broader community.

PreviousAdd Offchasin WorkersNextSpecify Origin for a Call

Last updated 1 year ago

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.

Publishing on GitHub

To publish your pallet on GitHub:

  1. .

    Select Public for the repository visibility.

  2. for your pallet to the remote repository.

  3. Add a file that describes the functions and usage for your pallet.

  4. 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:

  1. Open a terminal shell and change to the root directory for the node template.

  2. Open the runtime/Cargo.toml configuration file in a text editor.

  3. Locate the [dependencies] section.

  4. Add a line similar to the following:

    your-pallet-name = { version = "1.0.0", default-features = false, git = "https://github.com/<your-organization-name>/<your-pallet-repo-name>", branch = "<default-or-specific-branch-name" }

    If you want developers to use a specific tag or commit for importing the pallet, you should include this information in the README.

Publishing on crates.io

After you publish the pallet, other developers can import it into their runtime by including it in the Cargo.toml file as follows:

  1. Open a terminal shell and change to the root directory for the node template.

  2. Open the runtime/Cargo.toml configuration file in a text editor.

  3. Locate the [dependencies] section.

  4. Add a line similar to the following:

    your-pallet-name = { version = "<compatible-version>", default-features = false }

    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.

Where to go next

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 .

.

FRAME repository
Create a GitHub repository
Push all of the source code
README
crates.io
publish on crates.io
Runtime development
Use macros in a custom pallet
How-to: Import a pallet