caver.rpc.governance
Last updated
Last updated
caver.rpc.governance
provides JSON-RPC call with the governance
name space.
Submits a new vote. If the node has the right to vote based on the governance mode, the vote can be submitted. If not, an error will occur and the vote will be ignored.
Parameters
Name | Type | Description |
---|---|---|
For more details about the key
and value
for caver.rpc.governance.vote
, please refer to governance_vote.
Return Value
Promise
returns string
Type | Description |
---|---|
Example
Provides the current tally of governance votes. It shows the aggregate approval rate in percentage. The suggested change shall pass when the rate is over 50%.
Parameters
Return Value
Promise
returns Array
Example
Provides the sum of all voting power that CNs have. Each CN has 1.0 ~ 2.0 voting power. In the "none" and "single" governance modes, totalVotingPower doesn't provide any information.
Parameters
Return Value
Promise
returns number
Example
Provides the voting power of the node. The voting power can be anywhere between 1.0 ~ 2.0. In the "none" and "single" governance modes, totalVotingPower doesn't provide any information.
Parameters
Return Value
Promise
returns number
Example
Provides my vote information in the epoch. Each vote is stored in a block when the user's node generates a new block. After current epoch ends, this information is cleared.
Parameters
Return Value
Promise
returns Array
Example
Provides the initial chain configuration. Because it just stores the initial configuration, if there were changes in the governance made by voting, the result of chainConfig will differ from the current states. To see the current information, please use itemsAt.
Parameters
Return Value
Promise
returns object
Example
Provides the address of the node that a user is using. It is derived from the nodekey and used to sign consensus messages. And the value of "governingnode" has to be one of validator's node address.
Parameters
Return Value
Promise
returns string
Example
Returns governance items at a specific block. It is the result of previous voting of the block and used as configuration for chain at the given block number.
Parameters
Return Value
Promise
returns object
Example
Returns the list of items that have received enough number of votes but not yet finalized. At the end of the current epoch, these changes will be finalized and the result will be in effect from the epoch after next epoch.
Parameters
Return Value
Promise
returns object
Example
Returns an array of current idxCache in the memory cache. idxCache contains the block numbers where governance change happened. The cache can have up to 1000 block numbers in memory by default.
Parameters
Return Value
Promise
returns object
Example
Returns an array that contains all block numbers at which any governance changes ever took place. The result of idxCacheFromDb is the same or longer than that of idxCache.
Parameters
Return Value
Promise
returns object
Example
Returns the governance information stored on the given block. If no changes are stored on the given block, the function returns null.
Parameters
Parameters
Return Value
Promise
returns object
Example
Returns the votes from all nodes in the epoch. These votes are gathered from the header of each block.
Parameters
Return Value
Promise
returns object
Example
Returns the staking information at a specific block.
Parameters
Return Value
Promise
returns object
Example
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
key
string
Name of the configuration setting to be changed. Key has the form "domain.field".
value
string | number | boolean
Various types of value for each key.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
string
Result of vote submission.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
Array
An array containing the vote's value and the approval rate in percentage.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
number
Total Voting Power.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
number
Node's Voting Power.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
Array
Node's Voting status in the epoch.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
object
The initial chain configuration
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
string
The address of a node.
blockNumberOrTag
number | string
(optional) A block number, or the string latest
or earliest
. If omitted, latest
will be used.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
object
The governance items.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
object
Currently pending changes composed of keys and values.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
Array
Block numbers where governance change happened.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
Array
Block numbers where governance change happened.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
blockNumber
number | string
A block number, or the hex number string to query the governance change made on the block.
object
Stored governance information at a given block.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
Array
Current votes composed of keys, values and node addresses.
blockNumberOrTag
number | string
(optional) A block number, or the string latest
or earliest
. If omitted, latest
will be used.
callback
function
(optional) Optional callback, which returns an error object as the first parameter and the result as the second.
object
Staking information. Refer to governance_getStakingInfo for a description of the return result.