One trick that I use in production is not shown here.
Current code:
const outputs = await this.contract.getPastEvents("Transfer", {
fromBlock: 0,
toBlock: "latest",
topics: [
sha3("Transfer(address,address,uint256)"),
padLeft(owner, 64),
null
]
});
const inputs = await this.contract.getPastEvents("Transfer", {
fromBlock: 0,
toBlock: "latest",
topics: [
sha3("Transfer(address,address,uint256)"),
null,
padLeft(owner, 64)
]
});
If you change fromBlock to the contract deployment block then events come 2x–10x faster.
One trick that I use in production is not shown here.
Current code:
If you change
fromBlockto the contract deployment block then events come 2x–10x faster.