hope all are good ? I have a pb with my FULL NODE i can't connect it with my nodeJs files I can use my node if file's url is localhost:8546, i'm able to run my script from my server only but i want use my servr with my PC
From my server folder :
root@x:/home/x/bsc/build/bin
For Geth i run command :
./geth console --config ./config.toml --datadir ./node --cache 8000 --maxpeers 500000000 --
rpc.allow-unprotected-txs --txlookuplimit 0 --syncmode full --ws --ws.addr *0.0.0.0**
ws.port 8546 --wsorigins '*' --wsapi web3,shh,txpool,debug
Geth is synced
My server have port open for : ssh 22 / port 8546 tcp and udp
I can connect with PUTTY
My files is:
const Web3 = require('web3');
const wsProvider = new Web3.providers.WebsocketProvider("ws://MyiPNodeAddress:8546")
const web3 = new Web3(wsProvider);
web3.eth.getBlockNumber().then((result) => {
console.log("Latest Ethereum Block is ",result);
});
and return this :
Error: connection not open on send()
I'm using my mobile phone network connected to my Windows and i'm trying to connect to my geth linux server node then. I can't connect with my node can someone explain me please why ?
Sincerely Mike
netstat -pant
asroot
and check if the port is open at the interface you are using to connect. most likely you are listening on loopback address (interfacelo
)