1

My elementary understanding is that a Crate is a collection of modules or pallets, and a Package is a collection of Crates. But I came across this "pallet" in crates.io and am now unsure why it is self-referred to as a pallet instead of a crate.

Can someone please help me better understand with respect to this example?

1
  • Pallets are a special kind of crates, to be used in Substrate-based chains. Sep 27, 2022 at 14:31

1 Answer 1

3

I will do my best to explain it because in the beginning of my journey I was also confused with of all that terms.

Crate - the term comes from directly of Rust language and is the smallest amount of code that the Rust compiler considers at a time.

Package - the term also comes from directly of Rust language and is a bundle of one or more crates that provides concrete functionalities. A package contains a Cargo.toml file that describes how included crates should be build. Package is a feature of Cargo that lets you just build, test and share crates.

Module - the term also comes from directly of Rust language and is a place for your code where you can control scope of your implementation and logic of source code.

Pallet - the term comes from Substrate terminology and provides some set of functionalities within Substrate chain, below you can see set of pallets:

enter image description here

Additionally, you can be confused with meaning of Frame - Frame is like dialect of Rust language used in Substrate, but Frame is NOT Rust language term, Frame is the term used in Substrate framework.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.