-
Notifications
You must be signed in to change notification settings - Fork 462
Listen for transactions for a specific account #80
Comments
@dosper7 on my team we built a node service that polls the most recent block and then filters thru the included transactions for the specific account->actions we care about. We then store the data we care about into a database and query that. Eosjs doesn't have anything internal to poll nodes and would more than likely be out of scope for its intended usage. |
Addressing this outside of eosjs would allow for a more robus soluitions (catching up on past transactions, making sure a transaction was not missed in rare cases, last irriversable status, and pending transactions). A backend service with a database and a GraphQL connection to the UI was discussed at some point. If you write a for loop you should probably start by delay the blocks you poll so that you only poll last irriversable blocks. |
@chris-allnutt thanks, that makes sense. |
@dosper7 all use activity should be using a smart contract deployed to eos, that's what makes your application a dapp. You can query the table of a contract directly scoped by the users account if your looking for what the blockchain state is. |
any updates? Any library or API call to listen for transactions or getting past transactions for a specific account? |
I don't know of any fancy library for that.. I think you can just use simple polling and watch the account and it will work well. Networks are still designed for polling and so that works at least without any bugs. |
Looks like https://github.com/EOSIO/eosio-project-demux-example is an example app using demux-js to do its polling. It launches its own chain and monitors that. It is not exactly light weight but it does suggest that a dapp provider one day would support this setup. |
Wouldnt it be possible that API nodes simply provide a mq / websocket interface one can subscribe to, to receive transactions in realtime? Doesnt ethereum + web3.js do sth like that? |
I'm trying to do build a web app that checks for transactions for a specific account, but I'm unable to find any documentation on how to listen event transactions with EOS.js. It should be something that i must do it myself with a loop for "n" time do check for new transactions or EOS.js have/will have something like this?
The text was updated successfully, but these errors were encountered: