clique
Last updated
Last updated
The clique
API provides access to the state of the clique consensus engine. This API can be used to manage signer votes and to check the health of a private network.
Retrieves a snapshot of all clique state at a given block.
CLIENT | METHOD INVOCATION |
---|---|
Example:
Retrieves the state snapshot at a given block.
Returns the signer for a specific clique block. Can be called with either a blocknumber, blockhash or an rlp encoded blob. The RLP encoded blob can either be a block or a header.
Retrieves the list of authorized signers at the specified block number.
Retrieves the list of authorized signers at the specified block hash.
Returns the current proposals the node is voting on.
Adds a new authorization proposal that the signer will attempt to push through. If the auth parameter is true, the local signer votes for the given address to be included in the set of authorized signers. With auth set to false, the vote is against the address.
This method drops a currently running proposal. The signer will not cast further votes (either for or against) the address.
This is a debugging method which returns statistics about signer activity for the last 64 blocks. The returned object contains the following fields:
inturnPercent: percentage of blocks signed in-turn
sealerActivity: object containing signer addresses and the number of blocks signed by them
numBlocks: number of blocks analyzed
Example:
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
CLIENT | METHOD INVOCATION |
---|---|
Console
clique.getSnapshot(blockNumber)
RPC
{"method": "clique_getSnapshot", "params": [blockNumber]}
Console
clique.getSnapshotAtHash(blockHash)
RPC
{"method": "clique_getSnapshotAtHash", "params": [blockHash]}
Console
clique.getSigner(blockNrOrHashOrRlp)
RPC
{"method": "clique_getSigner", "params": [string]}
Console
clique.getSigners(blockNumber)
RPC
{"method": "clique_getSigners", "params": [blockNumber]}
Console
clique.getSignersAtHash(blockHash)
RPC
{"method": "clique_getSignersAtHash", "params": [string]}
Console
clique.proposals()
RPC
{"method": "clique_proposals", "params": []}
Console
clique.propose(address, auth)
RPC
{"method": "clique_propose", "params": [address, auth]}
Console
clique.discard(address)
RPC
{"method": "clique_discard", "params": [address]}
Console
clique.status()
RPC
{"method": "clique_status", "params": []}