-
Notifications
You must be signed in to change notification settings - Fork 15
Mainnet Validator & Staking Tutorial v0.18.13
This tutorial will provide key information about becoming a Validator on the Mainnet
The minimal staking amount is 0.5 Million OLT, which means a user need to stake at least 0.5 Million OLT to become a potential validator.
The blockchain network will only choose top 64 potential validators with highest staking amount and recognize them as active validators, the rest will be inactive validators.
Whenever the staking amount of an active validator drops below top 64 of staking amount or below 0.5 Million OLT, this validator will become inactive and no longer be able to participate in voting. Also this Validator will not be eligible for rewards at this point.
Every validator can only have one stake address at one time, you need to unstake and withdraw all the OLT first in order to change the stake address. It takes 80000 blocks “maturity time” (roughly two weeks) to let one be able to withdraw OLT after unstaking. This will be elaborated later in this document.
Depending on the setup of fullnode, if there is any permission issue please add "sudo" to the command, otherwise it's not needed.
- Have a full node running (Please check Mainnet-Fullnode-Set-Up-Instructions-v0.18.11)
- Create an account in the secure wallet using
olclient
command (Please check Account & Transfer) - Send at least 0.5 Million OLT to this account
- You can use Chrome OneWallet extension to do this if the account you are sending from is in OneWallet
- Or you can use
olclient
command to do this if the account you are sending from is in another node's secure wallet(Please check Account & Transfer)
- This account will be referred as "staking account" in the rest of this tutorial
Before staking, we need to check the current validator set in Mainnet network, and find the proper staking amount we need.
- If there are fewer than 64 active validators in the network then we need to stake at least 0.5 Million OLT to become a validator.
- If there are already 64 active validators in the network then we need to stake more than at least one of them to become a validator.
In this document we will assume that there are fewer than 64 validators in the network, so a minimal staking amount of 0.5 Million OLT will be enough.
cd $OLDATA
Command to check the validator set:
olclient validatorset
The result should be similar to the below:
Actual info in Mainnet may be different, this is just for the tutorial purpose
Active true
Frozen false
Address 0lt0f41d1724c2bbafae10455e6dbdf1f89ab1621d2
StakeAddress 0ltf675d27234bb8dca1ed99f15c296fd03977768eb
Power 4000000
Name 0
Staking 4000000
Active true
Frozen false
Address 0lt1e0d71c854ef2fda564f8fc03e23ed0d7b6c1a2a
StakeAddress 0ltb593b6cf540f083e208b8db73f24f289eaeedd92
Power 4000000
Name 1
Staking 4000000
Active true
Frozen false
Address 0lt27af5488ef034cafd1072442eae7e5a61ccb5421
StakeAddress 0lt0b2361445590347f888a4e14632ec5194ddebceb
Power 4000000
Name 2
Staking 4000000
Active true
Frozen false
Address 0ltcc8aef0465e5b4843dbd3fd4b5bc801762926b05
StakeAddress 0lt3d2bf8d59ed5980226d8bc608f543b1b70b4dc36
Power 4000000
Name 3
Staking 4000000
Height 15505
In order to participate in voting, and to get rewards, one needs to stake OLT and become a validator.
Checking the transaction result...
, depending on the network condition, this message may persist for no more than 20 seconds.
During such time, if the transaction is committed, a new message saying Transaction is committed!
will popup. If the transaction has not been committed in 20 seconds, another message saying Transaction failed to be committed in time! Please check later with command: [olclient check_commit] with tx hash
will popup.
One can always manually check for the committing status by this command: olclient check_commit --hash YourTransactionHash
Below are instructions to stake, unstake and withdraw.
Command to stake:
olclient delegation stake --amount 500000 --address YourStakingAccountWithout0ltPrefix
Please enter your password
After the transaction is passed, we wait for 30 seconds to let the network update info.
And we can check the result in validator set:
olclient validatorset
The result should be similar to the below:
Active true
Frozen false
Address 0lt0f41d1724c2bbafae10455e6dbdf1f89ab1621d2
StakeAddress 0ltf675d27234bb8dca1ed99f15c296fd03977768eb
Power 600000
Name 0
Staking 600000
Active true
Frozen false
Address 0lt1e0d71c854ef2fda564f8fc03e23ed0d7b6c1a2a
StakeAddress 0ltb593b6cf540f083e208b8db73f24f289eaeedd92
Power 600000
Name 1
Staking 600000
Active true
Frozen false
Address 0lt27af5488ef034cafd1072442eae7e5a61ccb5421
StakeAddress 0lt0b2361445590347f888a4e14632ec5194ddebceb
Power 600000
Name 2
Staking 600000
Active true
Frozen false
Address 0ltcc8aef0465e5b4843dbd3fd4b5bc801762926b05
StakeAddress 0lt3d2bf8d59ed5980226d8bc608f543b1b70b4dc36
Power 600000
Name 3
Staking 600000
Active true
Frozen false
Address YourNodeAddressWith0ltPrefix
StakeAddress YourStakingAccountWithout0ltPrefix
Power 500000
Name YourNodeName
Staking 500000
Height 15599
This result shows that we are currently recognized as a validator in the network.
Command:
olclient delegation status --address YourStakingAccountWithout0ltPrefix
Please enter your password
The result should be similar to the below
I[2020-07-16T13:16:13Z] olclient: Balance: 0.99996874 OLT
I[2020-07-16T13:16:13Z] olclient: Effective delegation amount:500000
I[2020-07-16T13:16:13Z] olclient: Withdrawable amount: 0
I[2020-07-16T13:16:13Z] olclient: Pending matured amount: empty
Explanation:
- The first line is balance of staking account after this staking transaction(some fee is deducted from this address)
- The second line is the staking amount
- The rest lines will be explained in the following steps.
Let’s first unstake 0.1 Million OLT, after this we will no longer be an active validator.
Command:
olclient delegation unstake --amount 100000 --address YourStakingAccountWithout0ltPrefix
After the transaction is passed, we wait for 30 seconds to let the network update info.
And we can check the result in validator set:
olclient validatorset
The result structure should be similar to the below
Active true
Frozen false
Address 0lt0f41d1724c2bbafae10455e6dbdf1f89ab1621d2
StakeAddress 0ltf675d27234bb8dca1ed99f15c296fd03977768eb
Power 600000
Name 0
Staking 600000
Active true
Frozen false
Address 0lt1e0d71c854ef2fda564f8fc03e23ed0d7b6c1a2a
StakeAddress 0ltb593b6cf540f083e208b8db73f24f289eaeedd92
Power 600000
Name 1
Staking 600000
Active true
Frozen false
Address 0lt27af5488ef034cafd1072442eae7e5a61ccb5421
StakeAddress 0lt0b2361445590347f888a4e14632ec5194ddebceb
Power 600000
Name 2
Staking 600000
Active true
Frozen false
Address 0ltcc8aef0465e5b4843dbd3fd4b5bc801762926b05
StakeAddress 0lt3d2bf8d59ed5980226d8bc608f543b1b70b4dc36
Power 600000
Name 3
Staking 600000
Active false
Address YourNodeAddressWith0ltPrefix
StakeAddress YourStakingAccountWithout0ltPrefix
Power 400000
Name YourNodeName
Staking 400000
Height 15888
From the result we can see that due to the staking amount change, we are no longer an active validator.
And we can check the status
olclient delegation status --address YourStakingAccountWithout0ltPrefix
The result should be similar to the below:
I[2020-07-16T14:16:13Z] olclient: Balance: 0.99994346 OLT
I[2020-07-16T14:16:13Z] olclient: Effective delegation amount: 400000
I[2020-07-16T14:16:13Z] olclient: Withdrawable amount: 0
I[2020-07-16T14:16:13Z] olclient: Pending matured amount:
I[2020-07-16T14:16:13Z] olclient: --- At height: 20885, pending amount: 100000
-
It can be seen from the second line in result that our staking amount is dropped by 0.1 Million, which is exactly what we have unstaked.
-
When we unstake some amount of OLT, there is a period of time referred to as “maturity time”. One can only withdraw the unstaked amount after this maturity time, since the unstake transaction. This maturity time is 80000 blocks, roughly two weeks.
-
So the withdrawable amount from the third line in result is still 0 at this time. Which means we cannot withdraw the unstaked OLT now.
-
The pending matured amount in the result is a list that contains all the pending amounts that will mature at the corresponding block heights.
Let’s unstake again, this time we unstake all the rest of OLT that we have staked.
Command:
olclient delegation unstake --amount 400000 --address YourStakingAccountWithout0ltPrefix
Please enter your password
After the transaction is passed, we wait for 30 seconds to let the network update info.
And we can check the result in validator set:
olclient validatorset
The result should be similar to the below:
Active true
Frozen false
Address 0lt0f41d1724c2bbafae10455e6dbdf1f89ab1621d2
StakeAddress 0ltf675d27234bb8dca1ed99f15c296fd03977768eb
Power 600000
Name 0
Staking 600000
Active true
Frozen false
Address 0lt1e0d71c854ef2fda564f8fc03e23ed0d7b6c1a2a
StakeAddress 0ltb593b6cf540f083e208b8db73f24f289eaeedd92
Power 600000
Name 1
Staking 600000
Active true
Frozen false
Address 0lt27af5488ef034cafd1072442eae7e5a61ccb5421
StakeAddress 0lt0b2361445590347f888a4e14632ec5194ddebceb
Power 600000
Name 2
Staking 600000
Active true
Frozen false
Address 0ltcc8aef0465e5b4843dbd3fd4b5bc801762926b05
StakeAddress 0lt3d2bf8d59ed5980226d8bc608f543b1b70b4dc36
Power 600000
Name 3
Staking 600000
Height 15899
As shown above, our node is no longer in the list since we have unstaked all the OLT we staked at the beginning.
And we can check the status
olclient delegation status --address YourStakingAccountWithout0ltPrefix
The result should be similar to the below:
I[2020-07-16T14:20:13Z] olclient: Balance: 0.99991818 OLT
I[2020-07-16T14:20:13Z] olclient: Effective delegation amount: 400000
I[2020-07-16T14:20:13Z] olclient: Withdrawable amount: 0
I[2020-07-16T14:20:13Z] olclient: Pending matured amount:
I[2020-07-16T14:20:13Z] olclient: --- At height: 20885, pending amount: 100000
I[2020-07-16T14:20:13Z] olclient: --- At height: 20895, pending amount: 400000
Now we have another entry in the pending matured amount list that shows the 0.4 Million OLT we just unstaked.
As introduced in the unstake part, a Validator can only withdraw the unstaked amount after maturity time. Before withdrawal, make sure there is a withdrawable amount that is available.
And we can check the status
olclient delegation status --address YourStakingAccountWithout0ltPrefix
The result should be similar to the below:
I[2020-07-17T13:16:13Z] olclient: Balance: 0.99991818 OLT
I[2020-07-17T13:16:13Z] olclient: Effective delegation amount: 0
I[2020-07-17T13:16:13Z] olclient: Withdrawable amount: 500000
I[2020-07-17T13:16:13Z] olclient: Pending matured amount: empty
And we can run withdraw command:
olclient delegation withdraw --amount 500000 --address YourStakingAccountWithout0ltPrefix
Please enter your password
After the transaction is passed, we wait for 30 seconds to let the network update info.
And we can check the status
olclient delegation status --address YourStakingAccountWithout0ltPrefix
The result should be similar to the below:
I[2020-07-17T13:17:13Z] olclient: Balance: 500000.9998929 OLT
I[2020-07-17T13:17:13Z] olclient: Effective delegation amount: 0
I[2020-07-17T13:17:13Z] olclient: Withdrawable amount: 0
I[2020-07-17T13:17:13Z] olclient: Pending matured amount: empty
We can also check our accounts balance:
olclient list
And you should see result similar to below:
Accounts from Secure Wallet:
Address: YourStakingAccountWithout0ltPrefix Balance: 500000.9998929 OLT
The amount is back to the address.
After you become validator, please follow this for Rewards info
© OneLedger 2018-2020 Contact Information