aeternity / ae_mdw

Aeternity Middleware in Elixir
26 stars 11 forks source link

Add counting of transactions for specific account with scoping #1943

Closed vatanasov closed 1 month ago

vatanasov commented 2 months ago

Aescan requires information about count of transactions for specific account with scoping by height. /transactions/count can't take two filters and /accounts/{id}/transactions/count doesn't support filtering by height. Probably making the second one work would be more appropriate.

janmichek commented 2 months ago

For the feature I build for aescan, I would ideally filter by time. I would use 24hours window, actually.

yaboiishere commented 2 months ago

Would something similar to the way stats endpoint be ok for this?

janmichek commented 2 months ago

Would something similar to the way stats endpoint be ok for this?

Yeah, is the 24h window also possible like this per account? That would be ideal

yaboiishere commented 2 months ago

I think so, but the database might become way bigger. I'll try to implement it and see how it performs

yaboiishere commented 2 months ago

I'm doing the logic that counts the transactions, right now it only counts the transaction for an account when the account is the one that initiated the tx i.e the origin account. Valentin raised a good point that it might be better to count the transaction for each participating account. Which would you prefer?

yaboiishere commented 1 month ago

@janmichek ping

janmichek commented 1 month ago

Hey, just got back from vacation. Will think about it and decide, thanks for the suggestion.

janmichek commented 1 month ago

This is what I want to achieve. How and which miners were active lately

https://www.aeknow.org/miner

image
yaboiishere commented 1 month ago

Hmm, this sounds like we would need to modify the stats/miners endpoint to function like the other ones where you would be able to filter by time intervals. How do you plan to use the transactions stats endpoint to get all the miners?

janmichek commented 1 month ago

Yeah, I should state whats my intention behind that at the beginning. Sorry, at least we have it now .] The solution would not be perfect ad would require some data transformation on frontend. As much as you are able to pre process data for me for this chart above, the happier I will be .]]] I guess your last suggestion ( modify the stats/miners) seems good.

yaboiishere commented 1 month ago

In that case I think it would be best to leave this feature as it is and create a new issue about modifying the stats/miners or creating a new endpoint to provide the data as you need it

janmichek commented 1 month ago

you can close this one