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.purgeKeysType
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.setKeysType
function setKeys(
keys: SeedRuntimeSessionKeys,
proof: Bytes
)Storage
currentIndex
Current index of the session.
Namespace
api.query.session.currentIndexType
function currentIndex(
): u32disabledValidators
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.disabledValidatorsType
function disabledValidators(
): Vec<u32>keyOwner
The owner of a key. The key is the KeyTypeId + the encoded key.
Namespace
api.query.session.keyOwnerType
function keyOwner(
(SpCoreCryptoKeyTypeId,Bytes)
): Option<SeedPrimitivesSignatureAccountId20>nextKeys
The next session keys for a validator.
Namespace
api.query.session.nextKeysType
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.queuedChangedType
function queuedChanged(
): boolqueuedKeys
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.queuedKeysType
function queuedKeys(
): Vec<(SeedPrimitivesSignatureAccountId20,SeedRuntimeSessionKeys)>validators
The current set of validators.
Namespace
api.query.session.validatorsType
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.NewSessionType
type NewSession = {
session_index: u32
}Errors
DuplicatedKey
Registered duplicate key.
Namespace
api.errors.session.DuplicatedKeyInvalidProof
Invalid ownership proof.
Namespace
api.errors.session.InvalidProofNoAccount
Key setting account is not live, so it's impossible to associate keys.
Namespace
api.errors.session.NoAccountNoAssociatedValidatorId
No associated validator ID for account.
Namespace
api.errors.session.NoAssociatedValidatorIdNoKeys
No keys are associated with this account.
Namespace
api.errors.session.NoKeysundefined