module_staking
staking
module
staking
moduleIntroduction
The staking
module handles Proof-of-Stake related logics, which plays a very import part to the underneath consensus protocol.
Overview
Planq Chain is based on Tendermint Core's consensus engine, it relies on a set of validators to participate in the proof of stake (PoS) consensus protocol, and they are responsible for committing new blocks in the blockchain.
unbonding_time
: The time duration of unbonding;max_validators
: The maximum number of validator;max_entries
: The max entries for either unbonding delegation or redelegation;historical_entries
: The number of historical entries to persist; andbond_denom
: Coin denomination for staking.
Validator
Validators are responsible for signing or proposing block at each consensus round. It is important that the validators maintain excellent availability and network connectivity to perform their tasks. To incentivise the validator nodes to run the network, rewards are distributed to the validators according to their performance and amount of staked token (see distribution and mint). On the other hand, a penalty should be imposed on validators' misbehavior (see slashing).
Delegator
The staking
module enables PLQ owners to delegate their tokens to active validators and share part of the reward obtained by the validator during the proof of stake protocol(see distribution module). Specifically, It allows token owners to take part in the consensus process without running a validator themselves.
It is important to point out that the delegator and the validator are on the same boat: They share the reward and the risk. In particular, part of their delegated token could be slashed due to validator's misbehaviour (see slashing). Therefore, It is very important to choose a reliable validator to delegate. Kindly refer to this link for detailed specification and state transitions of delegation.
Transactions and Queries
Transactions
tx staking create-validator
- Create new validator initialized with a self-delegation
First of all, we can create a validator with the create-validator
transaction, for example:
tx staking delegate [validator-addr] [amount]
- Delegate liquid tokens to a validator
As discussed in the delegator section, one can delegate their tokens to an active validator by:
tx staking unbond [validator-addr] [amount]
- Unbond shares from a validator
Delegator can unbond their staked tokens by
Remark: Note that funds will only be available after the unbonding_time
has passed.
tx staking redelegate [src-validator-addr] [dst-validator-addr] [amount]
- Redelegate illiquid tokens from one validator to another
We can also move our staked tokens from one validator to another by:
Queries
We will be covering most of the commonly used queries here. Meanwhile, you can use
to check all the supported sub-commands.
query staking delegation [delegator-addr] [validator-addr]
- Query a delegation based on address and validator address
With a given delegator address and the validator account that it is associated with, we can check the by:
query staking delegations-to [validator-addr]
- Query all delegations made to one validator
We can check all the delegations made to a specific validator:
query staking pool
- Query the current staking pool values
We can check the amount of bonded and unbonded amount in the staking pool:
query staking unbonding-delegation [delegator-addr] [validator-addr]
- Query an unbonding-delegation record based on delegator and validator address
query staking validator [validator-addr]
- Query a specific validator
We can query the details of a specific validator with its validator address (crocncl...) by:
query staking validators
- Query all validators
A full list of validators and their details can be found by this query.
query staking params
- Query the current staking parameters
Finally, we can query the current staking parameters by
REST endpoint
The parameters can also be checked by browsing to the following REST endpoint on Mainnet:
https://rest.planq.network/cosmos/staking/v1beta1/params
Appendix
staking
module: Network Parameters Configuration
The following tables show overall effects on different configurations of the staking related network parameters:
Last updated