# getSlotLeader

Solana API method that returns the current slot leader.

Parameters:

  • <object> — (optional) the configuration object containing the following fields:
    • commitment: <string> — (optional) the commitment.
    • minContextSlot: <number> — (optional) the minimum slot that the request can be evaluated at.

Returns:

  • string — the node identity public key as a base58 encoded string.

Example:

  • Solana web3.js
  • Solana.py
  • cURL
import { Connection } from "@solana/web3.js"

const nodeUrl = "CHAINSTACK_NODE_URL"
const connect = new Connection(nodeUrl);

(async () => {  
  console.log(await connect.getSlotLeader());
})();