Validator
关于 validator 的注册、注销等介绍。
register
Register a new validator. Through this command, we will transfer your Commission, ecdsaPublicKey, blsPublicKey, blsG1PublicKey, and BLSProof to the management contract to manage and secure your assets. Your ecdsaPublicKey, blsPublicKey, and BLSProof will be obtained through the specified keystore. The ECDSA public key that the validator is using for consensus should match the validator signer and be 64 bytes in length. The BLS public key that the validator is using for consensus should pass proof of possession and be 129 bytes in length. The BLS G1 public key that the validator is using for consensus should be 129 bytes in length. The BLS public key proof-of-possession consists of a signature on the account address and is 129 bytes in length.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.commission
: The commission rate for the validator's rewards. The commission parameter is set relative to 1000000, with a range from 0 to 1000000. If you want to set the commission rate to 15%, you need to set this parameter to 150000 (150000/1000000=15%). This attribute is one of the reference objects used by voters when voting.
quicklyRegister
To quickly register a new validator, you can use the quicklyRegister
command, which integrates the createAccount
, lockedMAP
, and register
commands.
Please note that you can only use this command once. Regardless of the success or failure of the command, it includes the operations corresponding to the createAccount
and lockedMAP
commands and does not have the feature of being reusable.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.commission
: The commission rate for the validator's rewards. The commission parameter is set relative to 1000000, with a range from 0 to 1000000. If you want to set the commission rate to 15%, you need to set this parameter to 150000 (150000/1000000=15%). This attribute is one of the reference objects used by voters when voting.lockedNum
: The amount of MAPO tokens to be locked in order to register as a validator.signerPriv
: The private key of the signer account.
deregister
The deregister
command is used to unregister a validator. You must be a validator to use this command.
The contract has a minimum time requirement to become a validator (default is 60 days). To deregister a validator, you must have exceeded this time.
To prevent malicious resource occupation during the deregistration process, we will put your deregistration request in a pending state and execute batch deregistration at the last block of the epoch.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.
revertRegister
If you deregistered your account in a specific epoch, you can use the revertRegister
command within the same epoch to restore your validator status.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.
authorizeValidatorSigner
Call this method before becoming a validator.
If you need to authorize another account to perform on-chain consensus operations instead of using the validator account, you can call this method to grant authorization. This allows another account to perform on-chain consensus operations.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.signerPriv
: The private key of the signer account.
makeECDSASignatureFromSigner
Generate an ECDSA signature signed by the signer account, which has signed the validator account.
Parameter description:
signerPriv
: The private key of the signer account.target
: The address of the validator account you want to sign.
makeBLSProofOfPossessionFromSigner
Generate a BLSProofOfPossession signed by the signer account for the validator account.
Parameter description:
signerPriv
: The private key of the signer account.target
: The address of the validator account you want to sign.
signerToAccount
Query the validator account that has authorized the target signer account.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path to the keystore file.target
: The address of the signer account.
generateSignerProof
Generate a proof using the signer private key.
Parameter description:
validator
: The address of the validator account.signerPriv
: The private key of the signer account.
authorizeValidatorSignerBySignature
Call this method before becoming a validator.
If you need to authorize another account to perform on-chain consensus operations instead of using the validator account, you can call this method to grant authorization. This allows another account to perform on-chain consensus operations.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path of the keystore file.signer
: The address of the signer account.signature
: The ECDSA signature generated using the makeECDSASignatureFromSigner command.
registerByProof
Register a validator using the proof generated by generateSignerProof
.
Parameter description:
rpcaddr
: The address of the RPC service, which can be either the provided RPC service address or your own RPC service address.keystore
: The path of the keystore file.proof
: The proof generated using the generateSignerProof command.commission
: The commission rate for the validator, expressed as a ratio relative to 1000000. The range of the commission parameter is from 0 to 1000000. If you want to set the commission rate to 15%, you would set this parameter to 150000 (150000/1000000=15%). This is one of the parameters that voters consider when voting.
Last updated