To become a validator, first you need to run a node in mining mode with an account unlocked. Then register this account as a candidate for validators. After registration, you need to earn enough staking power to become an active validator or a top candidate.
An account is needed to start mining. This account is used to produce new blocks and receive mining rewards by default. You can set a different account to receive mining rewards later.
You can import an existing account with the following command
build/bin/geneth account import <path/to/private_key_file>
Or generate a new account by running
build/bin/geneth account new
Mining can be enabled by executing the
genethclient with both
--unlockflag. Remember to specify the account address mentioned in step 1 after the
# For mainnet
build/bin/geneth --mine --unlock <your_miner_account>
# For Adenine testnet
build/bin/geneth --adenine --mine --unlock <your_miner_account>
Remember to type the password to unlock the account. You can also use a password file with
--passwordflag to unlock it.
Now after catching up with the latest block, you will have a node that is ready for producing blocks. The next step is to register your miner account as a validator candidate to receive staking.
A validator candidate is registered by calling the
registermethod of the Ribose system contract. You can find more information in the contract source code. Either a web3 client or the scan page can be used to complete the registration.
Note: You need to use the miner account to call the
registermethod as the caller account will be registered. Newly registered candidate will not enter the list of top 50 validator candidates until been staked more than 10,000 RNA, therefore they will not be able to appear on the staking page until then.
To better protect miners, we strongly recommend you to set a different account as block reward receiver.
setProfitTakermethod can be used to set an account as receiver of block rewards.
Note: Only current profit taker can call this method. No one else can make the change, even the miner account.
Block rewards are distributed into miner's pending profit at first. Pending profit might be punished to avoid misbehavior.
Only half of pending profit can be settled after 86400 blocks which is about 72 hours since last settlement.
Every time a miner produces a block, it's pending profit is checked and automatically settled into miner's miner profit if possible, which can be withdrew then. This is also done when making a withdraw.
getCandidateStatecan be used to check these values.
withdrawMinerProfitscan be used to withdraw settled profit.