Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Listen for transactions for a specific account #80

Closed
dosper7 opened this issue May 10, 2018 · 9 comments
Closed

Listen for transactions for a specific account #80

dosper7 opened this issue May 10, 2018 · 9 comments
Labels

Comments

@dosper7
Copy link

dosper7 commented May 10, 2018

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?

@chris-allnutt
Copy link
Contributor

@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.

@jcalfee jcalfee added the help label May 10, 2018
@jcalfee
Copy link
Contributor

jcalfee commented May 10, 2018

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.

@dosper7
Copy link
Author

dosper7 commented May 10, 2018

@chris-allnutt thanks, that makes sense.
The "problem" for me with your solution it's on "we built a node service".... This implies that the dapp it's not 100% decentralized in the sense that needs "help" from outside the EOS structure to do it's thing. I'm having the same problem on storing data (imagine JSON data) and querying, I'll "have" to use a database that provides the storage with querying capabilities and in this sense I can't say that my app it's a DApp, it's somewhere in middle. Can you understand what i'm trying to say?

@chris-allnutt
Copy link
Contributor

@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.

@jcalfee jcalfee closed this as completed May 22, 2018
@MarcelBlockchain
Copy link

any updates? Any library or API call to listen for transactions or getting past transactions for a specific account?

@jcalfee
Copy link
Contributor

jcalfee commented Aug 4, 2018

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.

@jcalfee
Copy link
Contributor

jcalfee commented Aug 8, 2018

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.

@csares
Copy link

csares commented Nov 15, 2018

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?

@nidhaloff
Copy link

@dosper7 @csares any updates on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants