Voting
Introduction
You can use your validator account to vote for yourself, or let other validators or voters vote for you. Below we demonstrate voting for yourself using your own validator account, as this is the easiest approach.
The number of votes corresponds 1:1 with the number of MAP you pledge.
Before voting, you must first become a validator. If you are not a validator, please see Become a Validator.
Step 1: Create Account
If you have done this step before, please skip it.
In this step, you need to transfer your identification information to the corresponding management contract, which will manage your account, keys, and metadata.
The purpose of this step is to keep your locked MAP more secure by authorizing alternative keys to be used for signing attestations, voting, and validating. By doing so, you can continue to participate in the protocol while keeping the key with access to your locked MAP in storage.
You need createAccount command to perform the above operations. For more details about createAccount command please see Marker Common Commands.
Example:
./marker createAccount --rpcaddr http://127.0.0.1:7445 --name "validator" --keystore ./UTC--2022-07-01T04-02-22.985282926Z--078f684c7d3bf78bdbe8bef93e56998442dc8099
INFO [07-01|05:54:37.048] Create account func=createAccount address=0x078F684c7d3bf78BDbe8bEf93E56998442dc8099 name=validator
INFO [07-01|05:54:37.048] === create Account ===
INFO [07-01|05:54:37.056] TxInfo func=sendContractTransaction TX data nonce =0 gasLimit =4,500,000 gasPrice =101,000,000,000 chainID =29088
INFO [07-01|05:54:37.057] Please waiting func=getResult txHash =0xbd9603b438fa5b98b894431111c6298605d47a12c8b508458482aa865f2d707c
INFO [07-01|05:54:42.082] Transaction Success func=queryTx block Number=360,085
INFO [07-01|05:54:42.083] === setName name ===
INFO [07-01|05:54:42.090] TxInfo func=sendContractTransaction TX data nonce =1 gasLimit =4,500,000 gasPrice =101,000,000,000 chainID =29088
INFO [07-01|05:54:42.091] Please waiting func=getResult txHash =0x8c68f99e1c7216a12d3e2ea12d293d150d94c2e0d0136504860e0f86c87cf77c
INFO [07-01|05:54:47.117] Transaction Success func=queryTx block Number=360,086
INFO [07-01|05:54:47.117] === setAccountDataEncryptionKey ===
INFO [07-01|05:54:47.125] TxInfo func=sendContractTransaction TX data nonce =2 gasLimit =4,500,000 gasPrice =101,000,000,000 chainID =29088
INFO [07-01|05:54:47.126] Please waiting func=getResult txHash =0xed401e84bf7759f2559ba8d97bcee09bb2128cbfb798f3751a427a640944f60d
INFO [07-01|05:54:52.152] Transaction Success func=queryTx block Number=360,087Step 2: Lock MAP
If you have locked enough MAP for voting, please skip this step.
The purpose of this step is to deduct the part of the corresponding vote from the money you locked to the validator you want to vote. You need to lock your MAP into the corresponding management contract in advance.
You need lockedMAP command to perform the above operations. For more details about lockedMAP command please see Marker Common Commands.
Example:
Step 3: Vote
When you get to this step, you can vote for your favorite validator. You can use the getTotalVotesForEligibleValidators subcommand to view all current validators and their votes.
Example:
Vote example:
When you finish voting, your votes will be in pending status. At the end of epoch block, the elected validator will automatically activate the votes in pending related to them. You can also use activate command to activate your votes yourself. This activate operation needs to be greater than your pending vote epoch.
For more details about vote commands, see Marker Vote Commands.
Additional Notes
When You Vote for a Validator Who Is Not Yet Elected
Your pending votes will not be automatically activated until the validator is elected. Once the validator is elected, they will automatically activate your votes at the next epoch. If you don't activate your vote manually, your votes will get benefits after the second epoch when the validator is elected.
Last updated