This is the command I am using to run the node (a private testnet)

geth --networkid 420 --nodiscover --rpc --rpcaddr "" --rpcport 8545 --rpcapi="db,eth,net,web3,personal,web3" --rpccorsdomain "*" console

This is the code I am using to connect to the node on the server side of my app

Meteor.startup(() => {
  web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"))

If I try web3.isConnected() on the server side it returns false

I also tried console.log(web3.net.listening) as recommended by the comments but this gave the error:

TypeError: XMLHttpRequest is not a function

I can connect fine on the client side and web3.isConnected() returns true

I am running the app locally on my computer


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.