0

This question already has an answer here:

I can read events as they happen with:

const eventsWatch = myContract.allEvents();
    eventsWatch.watch((err, res) => {
      if (err) return;
      console.log("Event:", res.event, res.args);
    });

This even shows the last event after I refresh the page, but I would like a list of all the past events.

Anyone know how to get this?

I've tried changing watch to get but then i get undefined objects back...

Thanks!

marked as duplicate by niksmac, Achala Dissanayake, Ismael, eth Feb 1 '18 at 6:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Create your filter by:

const eventsWatch = myContract.allEvents({fromBlock: 0, toBlock: 'latest'});

Not the answer you're looking for? Browse other questions tagged or ask your own question.