Marketplace has launched, further enabling blockchain developers! Learn more

Contents

net_peerCount RPC method

Parameters:

  1. None

Returns:

  1. Result - Integer of the number of connected peers encoded as a hexadecimal.

Code Examples:

// HTTP version
(async () => {
  const provider = new ethers.providers.JsonRpcProvider(
    "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc"
  );
  const peers = await provider.send("net_peerCount");
  console.log(peers);
})();
Ready to get started? Create a free account