- HTTP provider is deprecated in Web3.js 1.0.
- Websocket provider needs to be used instead of HTTP provider.
- Infura HTTP provider URL: https://mainnet.infura.io
- Infura Websocket URL: wss://mainnet.infura.io/ws
In Web3.js 1.0, Web3 needs to be initialized as below.
var web3 = new Web3('wss://mainnet.infura.io/ws');
If you find this article is helpful, it would be greatly appreciated if you could tip Ether to the address below. Thank you!