Substrate Framework

Reference Material

Substrate foundations

Parity company is developing massive component for Substrate: https://github.com/paritytech

Frame is: The Framework for Runtime Aggregation of Modularized Entities (FRAME) is a set of modules (called pallets) and support libraries that simplify runtime development. Pallets are individual modules within FRAME that host domain-specific logic, see https://substrate.dev/docs/en/knowledgebase/runtime/frame

Pallet: set of component/module, like small lib/component for runtime function in Frame. Pallet contains a set of types, storage items, and functions that define a set of features and functionality for a runtime.

The Contract Pallet: The Contracts pallet provides functionality for the runtime to deploy and execute WebAssembly smart-contracts.

The System library provides low-level types, storage, and functions for your blockchain. All other pallets depend on the System library as the basis of your Substrate runtime.

Rocksdb: This is the Database used on Substrate node. This has been invented by Facebook team: https://github.com/facebook/rocksdb/wiki/RocksDB-Basics , https://rocksdb.org/docs/getting-started.html, it is based on leveldb invented at Google (https://github.com/google/leveldb)

The FRAME Executive module acts as the orchestration layer for the runtime. It dispatches incoming extrinsic calls to the respective pallets in the runtime.

The FRAME Support library is a collection of Rust macros, types, traits, and functions that simplify the development of Substrate pallets.The support macros expand at compile time to generate code that is used by the runtime and reduce boilerplate code for the most common components of a pallet.

The runtime library brings together all these components and pallets. It defines which pallets are included with your runtime and configures them to work together to compose your final runtime. When calls are made to your runtime, it uses the Executive pallet to dispatch those calls to the individual pallets.

Consensus mechanisms used by Substrate:

  • Babe: BABE (Blind Assignment for Blockchain Extension) is the block production mechanism that runs between the validator nodes and determines the authors of new blocks.

  • GRANDPA (GHOST-based Recursive ANcestor Deriving Prefix Agreement) is the finality gadget that is implemented for the Polkadot Relay Chain.

Your First Substrate-Chain

Adding a Pallet to the FRAME runtime on Substrate

Details is explained here: https://substrate.dev/docs/en/tutorials/add-a-pallet/

Last updated

Was this helpful?