trufflesuite / trufflesuite.github.io

Staging Repo of Build Artifacts for Truffle Suite. Find the source at https://github.com/trufflesuite/trufflesuite.com
https://www.trufflesuite.com
34 stars 160 forks source link

Update contracts.md with another example #34

Closed darcius closed 6 years ago

darcius commented 7 years ago

Added another example to show filtering all events on a contract. Couldn't find much info on this for truffle when doing it myself, so this might help others too.

bmmpxf commented 6 years ago

Hi @darcius . Sorry it's taken us so long to get to this.

Thanks for the suggestion. This looks like a more advanced use case of events which we think should probably be placed somewhere other than in the Getting Started section of the documentation. Reason being, unless you're doing something like building an exchange, you probably don't want to be iterating through all of the blocks.

Nevertheless, if there's a specific use case you have in mind, we would be interested to see if we could turn it into a blog post or tutorial. We appreciate your ideas!

Also, for future suggestions, we've recently split up repositories to reduce confusion for our users, and so all of the website source code is now over here:

https://github.com/trufflesuite/trufflesuite.com

Please submit all future website suggestions/fixes in that repository. Thanks!

darcius commented 6 years ago

Thanks @bmmpxf! I'm just glad someone finally laid eyes on it, thought this merge was a lost cause. Hard to believe I put this in almost a year ago.

I actually use this method in my dApp Rocket Pool. We have smart nodes in our network that have NodeJS services that run in the background along side the main node software (Parity) and those services use these methods for listening for a variety of events on the blockchain and firing their corresponding internal events accordingly. All made using the truffle suite of course :)