AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!The eth_blockNumber EVM method is only supported on the Avalanche C-Chain.
Parameters:
Returns:
Code Examples:
To use the eth_blockNumber EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider( "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc" ); const blockNum = await provider.getBlockNumber(); console.log(blockNum); })();
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc')) print (w3.eth.blockNumber)
require 'ethereum.rb' client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc') blockNumber = client.eth_block_number puts blockNumber["result"].to_i(16)