Contents

eth_blockNumber RPC method

Parameters:

  1. None

Returns:

  1. Result - Integer value of latest block number encoded as a hexadecimal.

Code Examples:

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  const blockNum = await provider.getBlockNumber();
  console.log(blockNum);
})();
Ready to try QuickNode? Start your 7-day free trial