stellar / go

Stellar's public monorepo of go code
https://stellar.org/developers
Apache License 2.0
1.3k stars 499 forks source link

Feature request : get transactions based on an account address and a specific memo #1882

Open madetaille opened 5 years ago

madetaille commented 5 years ago

Hi,

I am currently developing an app based on the Stellar Blockchain.

To implement this app, one of my goal is to download the transactions of a specific address, including a specific memo.

I tried to look for a method to do it but there is no argument to do it using the method provided on this documentation page : https://www.stellar.org/developers/horizon/reference/endpoints/transactions-all.html

My problem is that the only alternative is to download all transactions for a specific address and filter locally for the transactions including the specific memo. This becomes quite long and painful when I have to download more than 400,000 transactions, especially when I can download pages of maximum 200 transactions at a time.

My question is : would it be possible to implement a feature that provides the transactions of a specific account having a specific memo?

This would prevent me from downloading the whole transactions of a specific account when I just need one or two specific transactions of the account. I think it could also reduce dramatically the number of requests my app (and other app?) make to the stellar blockchain.

Thanks in advance.

ire-and-curses commented 5 years ago

Just to be clear: your link was for all transactions. You can download transactions for a specific account: https://www.stellar.org/developers/horizon/reference/endpoints/transactions-for-account.html

Are you saying that you have more than 400,000 transactions for a single account? That sounds like a lot. Presumably that is historical so would only be parsed once?

For a use case like this we would usually suggest streaming the endpoint (e.g. here's how you do it using the Go SDK) to pick up new transactions as they occur.

In general we try and avoid adding new filters to Horizon unless there is a strong need from the community, because there are many potential combinations of endpoints and filters. We are planning to introduce a plug-in system for Horizon ingestion which would allow easy customisation of Horizon instances (and allow plug-ins to be contributed by the community). A filter like this would be ideal for that system.

madetaille commented 5 years ago

Thanks for your answer.

Yes, you are right, my link was wrong. I was referencing the link you just gave.

Concerning the 400,000 transactions, I know it is a lot but there will be an account through which all transactions will go and a lot of transactions will be associated to this account. The purpose is to trace "live" the transactions having a specific memo and that are going through this account.

My goal is not to store transactions from an account to go through it locally but to have the information of the tracing coming from the blockchain directly. So, streaming the transactions won't work in my case. That is why I was asking to have this method to filter the transactions by memo directly from horizon.

The plug-in you are talking about seems interesting. Do you have an idea when it will be available?

In any case, do you think it might be possible for you guys to implement this method?

Thank you.

ire-and-curses commented 5 years ago

We're still finalising our 2020 goals, but we hope to have the plugin system in Q1 or Q2 of 2020.

For the last few weeks of this year we're working through some critical work (rearchitecting Horizon's ingest system). Unfortunately it's unlikely we'd prioritise this unless there is significant community demand beyond your project. I appreciate you'd rather not store data locally. However given the constraints that may be your best option in the short term.