Private network API methods
- This reference contains API methods that apply to only private networks. For API methods that apply to both private and public networks, see the public network API reference.
- All JSON-RPC HTTP examples use the default host and port endpoint
http://127.0.0.1:8545
. If using the --rpc-http-host or --rpc-http-port options, update the endpoint.
CLIQUE
methods
The CLIQUE
API methods provide access to the Clique consensus engine.
The CLIQUE
API methods are not enabled by default for JSON-RPC. To enable the CLIQUE
API methods use the --rpc-http-api
or --rpc-ws-api
options.
clique_discard
Discards a proposal to add or remove a signer with the specified address.
Parameters
address
: string - 20-byte address of proposed signer
Returns
result
: boolean - indicates if the proposal is discarded
- curl HTTP request
- wscat WS request
- JSON result
curl -X POST --data '{"jsonrpc":"2.0","method":"clique_discard","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73"], "id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","method":"clique_discard","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73"], "id":1}
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
clique_getSigners
Lists signers for the specified block.
Parameters
blockNumber
: string - hexadecimal or decimal integer representing a block number, or one of the
string tags latest
, earliest
, pending
, finalized
, or safe
, as described in
block parameter
pending
returns the same value as latest
.
Returns
result
: array of string - list of 20-byte addresses of signers
- curl HTTP request
- wscat WS request
- JSON result
curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSigners","params":["latest"], "id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","method":"clique_getSigners","params":["latest"], "id":1}
{
"jsonrpc" : "2.0",
"id" : 1,
"result" : [ "0x42eb768f2244c8811c63729a21a3569731535f06", "0x7ffc57839b00206d1ad20c69a1981b489f772031", "0xb279182d99e65703f0076e4812653aab85fca0f0" ]
}
clique_getSignerMetrics
Provides the following validator metrics for the specified range:
-
Number of blocks from each validator
-
Block number of the last block proposed by each validator (if any proposed in the specified range)
-
All validators present in the last block