I am using web3js, I've set up an ethereum node in my network in a laptop via mist, now I'd like to run a web3js script that uses that node as provider;

var PROVIDER = "" // I've also tried 30303
var web3 = new Web3(new Web3.providers.HttpProvider(PROVIDER))

This throws error

CONNECTION ERROR: Couldn't connect to node

Port 30303 shows as open, while 8545 shows as filtered. Is there any configuration step I'm missing? I'm supposed to use port 8545 right?

Also, I have a question:

  • Can I use the node if it's not fully synced? By use I mean get balance of an account and do transactions

Thank you

1 Answer 1


You should allways use localhost or when conecting to local nodes.

You should be able to use a node while syncing, but the result will be outdated.

  • Thanks for the answer. Can you elaborate why I should connect to localhost? it should be almost the same right?
    – Victor
    Feb 6, 2018 at 20:40
  • No, localhost/ doesn't exit the machine, so it won't matter which ports are open to the outside Feb 6, 2018 at 21:24

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.