Validators module: Endpoint reference

This page summarizes all available API endpoints of the Validators module.

Endpoints can be invoked as explained in the Connecting via endpoints guide.

validators_validateBKLYey

This function checks the BLS key. If there is no BLS key in the store it would return as true. If the blsKey and the proofOfPossession input is invalid, or the blsKey already exists, the response will be false.

  • Specification

  • Node CLI

  • cURL

Table 1. Parameters
Name Type Description Sample

proofOfPossession

string

Proof that the owner of a key pair actually has the private key associated with the public key.

b92b11d66348e197c62d14af1453620d550c21d59ce572d95a03f0eaa0d0d195efbb2f2fd1577dc1a04ecdb453065d9d168ce7648bc5328e5ea47bb07d3ce6fd75f35ee51064a9903da8b90f7dc8ab4f2549b834cb5911b883097133f

blsKey

string

blsKey in hex format.

83d4f8300dda93e62b375264e8e47bc224cbb8f2ecf4c2e848ac9758d6d8fd263c22ef2d9be18b066b8efcab80d6bdaa

klayr-core endpoint:invoke validators_validateBKLYey '{ "blsKey": "83d4f8300dda93e62b375264e8e47bc224cbb8f2ecf4c2e848ac9758d6d8fd263c22ef2d9be18b066b8efcab80d6bdaa", "proofOfPossession": "b92b11d66348e197c62d14af1453620d550c21d59ce572d95a03f0eaa0d0d195efbb2f2fd1577dc1a04ecdb453065d9d168ce7648bc5328e5ea47bb07d3ce6fd75f35ee51064a9903da8b90f7dc8ab4f2549b834cb5911b883097133f" }' --pretty
curl --location --request POST 'http://localhost:7887/rpc' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "validators_validateBKLYey",
    "params": {
         "blsKey":  "83d4f8300dda93e62b375264e8e47bc224cbb8f2ecf4c2e848ac9758d6d8fd263c22ef2d9be18b066b8efcab80d6bdaa",
         "proofOfPossession": "b92b11d66348e197c62d14af1453620d550c21d59ce572d95a03f0eaa0d0d195efbb2f2fd1577dc1a04ecdb453065d9d168ce7648bc5328e5ea47bb07d3ce6fd75f35ee51064a9903da8b90f7dc8ab4f2549b834cb5911b883097133f" }' --pretty
    }
}'
Response
Example output
{
  "valid": true
}

validators_getValidator

Returns the generatorKey and the blsKey of a validator from the validators module.

  • Specification

  • Node CLI

  • cURL

Table 2. Parameters
Name Type Description Sample

address

string

The Klayr32 address to query.

klye5sqed53fdcs4m9et28f2k7u9fk6hno9bauday

klayr-core endpoint:invoke validators_getValidator '{"address":"klye5sqed53fdcs4m9et28f2k7u9fk6hno9bauday"}' --pretty
curl --location --request POST 'http://localhost:7887/rpc' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "validators_getValidator",
    "params": {
         "address":  "klye5sqed53fdcs4m9et28f2k7u9fk6hno9bauday"
}'
Response
Example output
{
    "generatorKey": "67995503520459acdc44446ea0a57c8c35d4c84c349fca9ecc0f4fe1fa45c06c",
    "blsKey": "b301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81"
}