Hello hope are good ?

  • I have my own full node with a ssh tunnel

My code is :

async function test (){

 const url = 'ws://localhost:8546';
  const web3 = new Web3(new Web3.providers.WebsocketProvider(url));
   const a = await web3.eth.getBlockNumber();


Return :

the method eth_blockNumber does not exist/is not available

All is synced and working is there a pb ?

1 Answer 1


This could be because the Ethereum node you are connecting to is not running the JSON-RPC interface on the same port, or that the Ethereum node is not fully synced yet. Make sure that you are connecting to the correct port and that the node is fully synced. Also check if the geth version you are using support the eth_blockNumber method.

  • Node is synced when i call eth.blockNumber geth return me the good block i have port 8546 open on Server
    – forexmp45
    Commented Jan 27, 2023 at 17:37
  • It is possible that the version of the Web3.js library you are using does not support the WebSocket provider or that there is a compatibility issue with the version of Geth you are running. You may try updating the Web3.js library to the latest version and see if that resolves the issue. Also you can try using a different Web3 library like web3.js v1.x.x or Ethers.js.
    – VX3
    Commented Jan 27, 2023 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.