Hot answers tagged

5

This web3 version is a few years old you should probably use a new one. Make sure to update!


2

I think this is what you are looking for: const Web3 = require('web3'); const web3 = new Web3('wss://ropsten.infura.io/ws/v3/<yourID>'); const abi = "placeYourABI"; const address = 'yourContractAddress'; const contract = new web3.eth.Contract(abi, address); contract.getPastEvents('allEvents', { fromBlock: 0, toBlock: 'latest' }).then(...


2

I always use myContract.func.call(). Actuall I have never heard that myContract.func(). After all this is the recommended way of doing it!! Furthermore, the performance is better (I think). Maybe that's your perception? Read the official web3 documentation. I read every page of it. Here is the link to the correct article. I don't use truffle and it works ...


2

Geth is an ethereum client but it is not a high performance RPC server. To resolve some calls like getPastEvents it has to traverse a lots of history. It was never designed to respond to thousands of queries per second. If you want to achieve such performance it is better to store the events you are interested in a suitable database.


Only top voted, non community-wiki answers of a minimum length are eligible