platform.sampleValidators

Sample validators from the specified Subnet.

Signature​

platform.sampleValidators(
    {
        size: int,
        subnetID: string, //optional
    }
) ->
{
    validators: []string
}
  • size is the number of validators to sample.

  • subnetID is the Subnet to sampled from. If omitted, defaults to the Primary Network.

  • Each element of validators is the ID of a validator.

Example

Request

curl -X POST --data '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"platform.sampleValidators",
    "params" :{
        "size":2
    }
}' -H 'content-type:application/json;' https://ava-mainnet.blastapi.io/<project-id>/ext/P

Result

{
    "jsonrpc": "2.0",
    "result": {
        "validators": ["NodeID-KZnxZckzgz9eQWzB3iuvM5GC2QdJLE5yv", "NodeID-Ns1eDN3K9HTnavgiBQhtpzRxUCxJ55Xhc"]
    },
    "id": 1
}

Last updated