Marketplace has launched, further enabling blockchain developers! Learn more

Contents

platform.sampleValidators RPC method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. size - int - the number of validators to sample.
  2. subnetID - string - (optional) the Subnet to sample from. If omitted, defaults to the Primary Network.

Returns:

  1. validators - []string - IDs of validator.

Code Examples:

const ethers = require("ethers");

(async () => {
  const provider = new ethers.providers.JsonRpcProvider(
    "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/P"
  );
  const params = {
    "size": 2,
  };
  const result = await provider.send("platform.sampleValidators", params);
  console.log(result);
})();
Ready to get started? Create a free account