Understanding the architecture
Last updated
Last updated
We will use the Partiy minimal template for a Substrate blockchain to guide you through the concepts:
Alternative repository that you can consider reference from:
Runtime
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
.
Node
Pallets
A FRAME pallet is comprised of a number of blockchain primitives, including:
Dispatchables: FRAME pallets define special types of functions that can be invoked (dispatched) from outside of the runtime in order to update its state.
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.
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 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 that makes it easy to create pallets and flexibly compose them to create blockchains that can address .
Review the included in this template and note the following:
The pallets are composed into a single runtime by way of the macro, which is part of the .
The runtime in this project is constructed using many FRAME pallets that ship with and a template pallet that is directory.
Storage: FRAME defines a rich set of powerful that makes it easy to use Substrate's efficient key-value database to manage the evolving state of a blockchain.
Events: Substrate uses to notify users of significant state changes.
Node:
Pallet registry:
Pallet configuration:
Specifying Runtime version:
Transaction signed extension: