curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeader"
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeader"
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": "GBQ2GvTzmjXMu97dr7WUnLKYTNim1aoZsYS53KYXAAAA",
"id": 1
}
HTTP methods
getSlotLeader
Returns the validator currently producing blocks as Solana’s slot leader, identified by its 32-byte public key.
curl --fail-with-body "$THORNODE_RPC_URL" \
--header 'content-type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeader"
}'
const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeader"
};
const response = await fetch(process.env.THORNODE_RPC_URL, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(body),
});
const { result, error } = await response.json();
console.log(result ?? error);
{
"jsonrpc": "2.0",
"result": "GBQ2GvTzmjXMu97dr7WUnLKYTNim1aoZsYS53KYXAAAA",
"id": 1
}
Returns the validator currently producing blocks as Solana’s slot leader, identified by its 32-byte public key.