mana-ethereum/ethereumex

watch for new blocks (filter)

Closed this issue · 1 comments

Hello, is there a way I can watch for new blocks? Similar to the Javascript web3 API:

const filter = web3.eth.filter('latest');
filter.watch((e,r) => {
  console.log('got new block = ', r);
});

How can I achieve something similar using Ethereumex? I have checked the documentation here, but I think it isn't updated yet.

This is how I did it in my library https://github.com/hswick/exw3#events

Simply call get_filter_changes in a loop. If you want the async of filter.watch then put the loop in a Task.