1

Is it possible to connect the nodes that are listed on ethernodes.org

I chose one of the listed nodes and try to connect with web3 but I get connection not open on send() error.

const Web3 = require("web3")
const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://185.117.74.46:48346"))

const getBlockNumber = async() => {
    try{
        const r = await web3.eth.getBlockNumber()
        console.log(r)
    }catch(error) {
        console.log(error)
    }
}
getBlockNumber()

Is there any way to connect a public node?

4
  • 1
    Have you heard of infura? Does it fit for you? Commented Feb 6, 2020 at 9:33
  • Yes I know infura, etherscan but I don't want to use them.
    – metmirr
    Commented Feb 6, 2020 at 11:19
  • 1
    The list contains p2p clients they likely do not have rpc nor ws enabled.
    – Ismael
    Commented Feb 6, 2020 at 14:15
  • So that means without running a node or using a third-party service like infura is not possible to communicate with ethereum network?
    – metmirr
    Commented Feb 7, 2020 at 11:47

1 Answer 1

-1

Click on the identifier at Ethernodes to get enode information about a node :

enode://00204ddd71303b097e54d8f4e3b45dfd8e31b3ff68ef5973089ae5f9c33ae5787cfc28bfa4fb094a34f563b960adb709efecce0f0cedabe22611bc039b73f799@185.117.74.46:48346

Version 2 of Web3 provides an addPeer method

https://web3js.readthedocs.io/en/v2.0.0-alpha/web3-eth-admin.html#addpeer

1
  • 1
    I think he is using web3 as a client, not in a node. Commented Feb 6, 2020 at 10:51

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.