Module Menu

The official Substrate documentation provides a comprehensive overview of the Substrate runtime module libraries. Although modules are designed to be stand-alone, the modules in the Substrate Runtime Module Library provide useful code patterns that are applicable to many applications leveraging the framework.

Unlike in smart contract development, the way to emulate these patterns is not to directly utilize these modules. Instead, the best approach either implements the same logic in the new context or utilizes a trait from srml/support to guide the new implementation. By abstracting shared behavior from the runtime modules into srml/support, Substrate makes it easy to extract and enforce best practices in the unique runtime. You can find the trait documentation here.

Module Tour

  • Aura - manages offline reporting for Aura consensus
  • Balances - handles accounts and balances
  • Consensus - manages the authority set for the native code
  • Contracts - functionality for the runtime to deploy and execute WebAssembly smart contracts
  • Council - handles voting and maintenance of council members
  • Democracy - handles administration of general stakeholder voting
  • Executive - dispatches incoming extrinsic calls to the respective modules in the runtime
  • Grandpa - manages the GRANDPA authority set ready for the native code
  • Indices - an index is a short form of an address; this module handles allocation of indices for a newly created accounts
  • Session - allows validators to manage their session keys, provides a function for changing the session length, and handles session rotation
  • Staking - manage funds at stake by network maintainers
  • Sudo - allows a single account to execute dispatchable functions
  • System - low-level access to core types and cross-cutting utilities
  • Timestamp - get and set the on-chain time
  • Treasury - keeps account of currency in a pot and manages the subsequent deployment of these funds