[][src]Crate srml_session

Session Module

The Session module allows validators to manage their session keys, provides a function for changing the session length, and handles session rotation.

Overview

Terminology

Goals

The Session module in Substrate is designed to make the following possible:

Interface

Dispatchable Functions

Public Functions

Usage

Example from the SRML

The Staking module uses the Session module to get the validator set.

use srml_session as session;

let validators = <session::Module<T>>::validators();

Modules

historical

An opt-in utility for tracking historical sessions in SRML-session.

Structs

FindAccountFromAuthorIndex

Wraps the author-scraping logic for consensus engines that can recover the canonical index of an author. This then transforms it into the registering account-ID of that session key index.

GenesisConfig
Module
PeriodicSessions

Ends the session after a fixed period of blocks.

Enums

Call
Event

Events for this module.

Traits

OnSessionEnding

An event handler for when the session is ending. TODO [slashing] consider renaming to OnSessionStarting

OneSessionHandler

A session handler for specific key type.

SelectInitialValidators

Handler for selecting the genesis validator set.

SessionHandler

Handler for session lifecycle events.

ShouldEndSession

Decides whether the session should be ended.

Trait