I'm trying to connect my small server web app in ExpressJS to the BSC blockchain, but without success.
As per my understanding, the Web3 library provides all the required stuff under the hood, and I can connect by calling
new Web3(new Web3.providers.HttpProvider(urlToRpcNode))
By following this, I put the following into my function, which serves as a Web3 object init:
return new Web3(new Web3.providers.HttpProvider(https://bsc-dataseed1.binance.org));
According to BscScan, the given argument is the URL to the RPC Node for BSC https://bscscan.com/apis#rpc.
Unfortunately, awaiting this call just gets stuck forever and doesn't return anything.
What am I doing wrong? Any help is appreciated.
Edit:
I found another link to Binance Docs, where it outlines the specific process for connecting to BSC. Here is how they do it:
const web3 = new Web3('https://bsc-dataseed1.binance.org:443');
https://docs.binance.org/smart-chain/developer/create-wallet.html#connect-to-bsc-network
Unfortunately, this gives me the same result.