Could not detect network

I’m trying to connect to my bsc testnet server using this code:

const provider = new ethers.providers.JsonRpcProvider(‘’)

console.log('Waiting for network')
const network = await provider.detectNetwork()

I get the error ‘could not detect network’
What am I doing wrong?

You need to use a speedy node for your provider, not your Moralis server.

you can find your speedy node url on this page:

Thank you everybody

1 Like