Understanding the architecture

We will use the Partiy minimal template for a Substrate blockchain to guide you through the concepts: https://github.com/paritytech/polkadot-sdk/tree/master/templates/minimal/
Alternative repository that you can consider reference from: https://github.com/paritytech/polkadot-sdk-solochain-template
Runtime
In Substrate, the terms "runtime" and "state transition function" are analogous. Both terms refer to the core logic of the blockchain that is responsible for validating blocks and executing the state changes they define. The Substrate project in this repository uses FRAME to construct a blockchain runtime. FRAME allows runtime developers to declare domain-specific logic in modules called "pallets". At the heart of FRAME is a helpful macro language that makes it easy to create pallets and flexibly compose them to create blockchains that can address a variety of needs.
Review the FRAME runtime implementation included in this template and note the following:
This file configures several pallets to include in the runtime. Each pallet configuration is defined by a code block that begins with
impl $PALLET_NAME::Config for Runtime
.The pallets are composed into a single runtime by way of the
construct_runtime!
macro, which is part of the core FRAME pallet library.
Node
Pallets

The runtime in this project is constructed using many FRAME pallets that ship with the Substrate repository and a template pallet that is defined in the pallets
directory.
A FRAME pallet is comprised of a number of blockchain primitives, including:
Storage: FRAME defines a rich set of powerful storage abstractions that makes it easy to use Substrate's efficient key-value database to manage the evolving state of a blockchain.
Dispatchables: FRAME pallets define special types of functions that can be invoked (dispatched) from outside of the runtime in order to update its state.
Events: Substrate uses events to notify users of significant state changes.
Errors: When a dispatchable fails, it returns an error.
Each pallet has its own Config
trait which serves as a configuration interface to generically define the types and parameters it depends on.
Code walkthrough
Specifying Runtime version: https://github.com/paritytech/polkadot-sdk/blob/master/templates/minimal/runtime/src/lib.rs#L88
Transaction signed extension: https://github.com/paritytech/polkadot-sdk/blob/master/templates/minimal/runtime/src/lib.rs#L106
Last updated