Skip to main content

Session

Calls

purgeKeys

Removes any session key(s) of the function caller.

This doesn't take effect until the next session.

The dispatch origin of this function must be Signed and the account must be either be convertible to a validator ID using the chain's typical addressing system (this usually means being a controller account) or directly convertible into a validator ID (which usually means being a stash account).

Namespace

api.tx.session.purgeKeys

Type

function purgeKeys(

)

setKeys

Sets the session key(s) of the function caller to keys. Allows an account to set its session key prior to becoming a validator. This doesn't take effect until the next session.

The dispatch origin of this function must be signed.

Namespace

api.tx.session.setKeys

Type

function setKeys(
keys: SeedRuntimeSessionKeys,
proof: Bytes
)

Storage

currentIndex

Current index of the session.

Namespace

api.query.session.currentIndex

Type

function currentIndex(

): u32

disabledValidators

Indices of disabled validators.

The vec is always kept sorted so that we can find whether a given validator is disabled using binary search. It gets cleared when on_session_ending returns a new set of identities.

Namespace

api.query.session.disabledValidators

Type

function disabledValidators(

): Vec<u32>

keyOwner

The owner of a key. The key is the KeyTypeId + the encoded key.

Namespace

api.query.session.keyOwner

Type

function keyOwner(
(SpCoreCryptoKeyTypeId,Bytes)
): Option<SeedPrimitivesSignatureAccountId20>

nextKeys

The next session keys for a validator.

Namespace

api.query.session.nextKeys

Type

function nextKeys(
SeedPrimitivesSignatureAccountId20
): Option<SeedRuntimeSessionKeys>

queuedChanged

True if the underlying economic identities or weighting behind the validators has changed in the queued validator set.

Namespace

api.query.session.queuedChanged

Type

function queuedChanged(

): bool

queuedKeys

The queued keys for the next session. When the next session begins, these keys will be used to determine the validator's session keys.

Namespace

api.query.session.queuedKeys

Type

function queuedKeys(

): Vec<(SeedPrimitivesSignatureAccountId20,SeedRuntimeSessionKeys)>

validators

The current set of validators.

Namespace

api.query.session.validators

Type

function validators(

): Vec<SeedPrimitivesSignatureAccountId20>

Events

NewSession

New session has happened. Note that the argument is the session index, not the block number as the type might suggest.

Namespace

api.events.session.NewSession

Type

type NewSession = {
session_index: u32
}

Errors

DuplicatedKey

Registered duplicate key.

Namespace

api.errors.session.DuplicatedKey

InvalidProof

Invalid ownership proof.

Namespace

api.errors.session.InvalidProof

NoAccount

Key setting account is not live, so it's impossible to associate keys.

Namespace

api.errors.session.NoAccount

NoAssociatedValidatorId

No associated validator ID for account.

Namespace

api.errors.session.NoAssociatedValidatorId

NoKeys

No keys are associated with this account.

Namespace

api.errors.session.NoKeys

undefined