[][src]Function transaction_builder::encode_create_validator_account_script

pub fn encode_create_validator_account_script(
    sliding_nonce: u64,
    new_account_address: AccountAddress,
    auth_key_prefix: Vec<u8>,
    human_name: Vec<u8>
) -> Script


Creates a Validator account. This transaction can only be sent by the Libra Root account.

Technical Description

Creates an account with a Validator role at new_account_address, with authentication key auth_key_prefix | new_account_address. It publishes a ValidatorConfig::ValidatorConfig resource with empty config, and operator_account fields. The human_name field of the ValidatorConfig::ValidatorConfig is set to the passed in human_name. This script does not add the validator to the validator set or the system, but only creates the account.


lr_account&signerThe signer reference of the sending account of this transaction. Must be the Libra Root signer.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction.
new_account_addressaddressAddress of the to-be-created Validator account.
auth_key_prefixvector<u8>The authentication key prefix that will be used initially for the newly created account.
human_namevector<u8>ASCII-encoded human name for the validator.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under lr_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce is too old and it's impossible to determine if it's duplicated or not.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_NEWThe sliding_nonce is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce has been previously recorded.
Errors::REQUIRES_ADDRESSCoreAddresses::ELIBRA_ROOTThe sending account is not the Libra Root account.
Errors::REQUIRES_ROLERoles::ELIBRA_ROOTThe sending account is not the Libra Root account.
Errors::ALREADY_PUBLISHEDRoles::EROLE_IDThe new_account_address address is already taken.

Related Scripts