Returns the size of the council at the specified block. If the parameter is not set, returns the size of the council at the latest block.
Supported on Klaytn (mainnet) only.
NOTE: klay_getValidators
is replaced with this method and is not supported anymore.
Parameters
Request
Name | Type | Description |
---|---|---|
QUANTITY | TAG | block number | (optional) Integer or hexadecimal block number, or the string "earliest" or "latest" |
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest"
and "latest"
are available.
Result
Integer
- The size of the council, or -1
when no council was found:
Type | Description |
---|---|
QUANTITY | The size of the council |
API Endpoint
The format of a Klaytn API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/klaytn/
Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/klaytn/
Example
// Request
curl https://open-platform.nodereal.io/{{apiKey}}/klaytn/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0", "method":"klay_getCouncilSize", "params":["0x1b4"],"id":73}'
// Result
{
"jsonrpc":"2.0",
"id":73,
"result": 4
}