1

I use this tutorial for run BSC node:

https://docs.bnbchain.org/docs/beaconchain/light-client

But with web3 I get error:

Uncaught (in promise) Error: CONNECTION ERROR: Couldn't connect to node

My code:

const web3 = new Web3();
web3.setProvider(new Web3.providers.HttpProvider('http://my-ip:27147'));
web3.eth.isSyncing().then(console.log);
1
  • Do you try other eth command ?
    – forexmp45
    Mar 5, 2023 at 23:37

1 Answer 1

1

It seems like your node is not deployed. To save you some time, you can use the following code to check if the node is up and running.

curl -X POST "http://localhost:27147" \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}'

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.