The following seems to poll my Ethereum node every second:
web3.eth.contract(contractAbi).at(contractAddress).allEvents(callback);
Is there a way to decrease the polling interval?
The following seems to poll my Ethereum node every second:
web3.eth.contract(contractAbi).at(contractAddress).allEvents(callback);
Is there a way to decrease the polling interval?
Indeed you need to use WebsocketProvider, it gives you opportunity to receive notification instantly after node synchronization.
var web3 = new Web3(new Web3.providers.WebsocketProvider('wss://ropsten.infura.io/ws'));
var myContract = new web3.eth.Contract(<abi>, <address>);
myContract.events.allEvents({ fromBlock: 'latest' }, console.log);