Users can use governance contract to apply to participate in the consensus node election, stake to vote for candidate nodes, exit the consensus node election, and so on. Staked ONT will generate rewards according to certain rules.
Function: Initializes the governance contract, only called during the creation of the genesis block (system method).
Method Name: "initConfig"
Parameters: None
Return Value: bool, error
RegisterCandidate
Function: Stakes a certain amount of ONT and consumes some extra ONG to apply to become a candidate node.
Method Name: "registerCandidate"
Parameters:
Public key index of the caller
Return Value: bool, error
RegisterCandidateTransferFrom
Function: Stakes a certain amount of ONT and consumes some extra ONG to apply to become a candidate node, used for contract invocation.
Method Name: "registerCandidateTransferFrom"
Parameters:
Public key index of the caller
Return Value: bool, error
Function: Node application to exit, entering the normal exit process. The wallet address must be the same as the one used for application.
Method Name: "quitNode"
Parameters:
Return Value: bool, error
AuthorizeForPeer
Function: Vote for a node by staking ONT.
Method Name: "authorizeForPeer"
Parameters:
List of nodes to vote for
Number of votes for each node
Return Value: bool, error
AuthorizeForPeerTransferFrom
Function: Vote for a node by staking ONT, used for contract invocation.
Method Name: "authorizeForPeerTransferFrom"
Parameters:
List of nodes to vote for
Number of votes for each node
Return Value: bool, error
UnAuthorizeForPeer
Function: Revoke the vote by redeeming the staked ONT.
Method Name: "unAuthorizeForPeer"
Parameters:
List of nodes to revoke votes from
Number of votes to revoke
Return Value: bool, error
Function: Withdraw staked ONT that is in an unfrozen state.
Method Name: "withdraw"
Parameters:
List of nodes to withdraw from
Return Value: bool, error
Function: Withdraw unbound ONG.
Method Name: "withdrawOng"
Parameters:
Return Value: bool, error
Function: Withdraw fee dividends.
Method Name: "withdrawFee"
Parameters:
Return Value: bool, error
Function: Consensus switch based on the current voting results, system method.
Method Name: "commitDpos"
Parameters: None
Return Value: bool, error
ChangeMaxAuthorization
Function: Node modifies the maximum amount of ONT it can accept for authorization.
Method Name: "changeMaxAuthorization"
Parameters:
Maximum amount authorized
Return Value: bool, error
SetFeePercentage
Function: Allows a node to set its exclusive incentive percentage.
Method Name: "setFeePercentage"
Parameters:
Exclusive incentive percentage for node
Exclusive incentive percentage for user
Returns: bool, error
Function: Increases the initial position (initPos) of the node, can only be called by the node owner.
Method Name: "addInitPos"
Parameters:
Amount to increase in initPos
Returns: bool, error
Function: Decreases the initial position (initPos) of the node. Can only be called by the node owner. The initPos cannot be lower than the committed value and must be at least one-tenth of the authorized amount.
Method Name: "reduceInitPos"
Parameters:
Amount to decrease in initPos
Returns: bool, error
Function: Retrieves detailed information about consensus nodes and candidate nodes.
Method Name: "getPeerPool"
Parameters: None
Returns: []byte, error
Serialized Return Values:
Function: Retrieves detailed information about a node based on its address.
Method Name: "getPeerInfo"
Parameters:
Returns: []byte, error
Serialized Return Values:
GetPeerPoolByAddress
Function: Retrieves a list of detailed information about nodes based on the staking address.
Method Name: "getPeerPoolByAddress"
Parameters:
Returns: []byte, error
Serialized Return Values:
GetAuthorizeInfo
Function: Retrieves authorization information for voting.
Method Name: "getAuthorizeInfo"
Parameters:
Returns: []byte, error
Serialized Return Values:
Function: Retrieves the reward amount for a user's address.
Method Name: "getAddressFee"
Parameters:
Returns: []byte, error
Serialized Return Values: