Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Introduce Local Caching of Transaction Lists #894

Closed
doubled1c3 opened this issue Dec 30, 2018 · 14 comments
Closed

Introduce Local Caching of Transaction Lists #894

doubled1c3 opened this issue Dec 30, 2018 · 14 comments
Labels
Type: Feature The issue is a request for new functionality.
Milestone

Comments

@doubled1c3
Copy link

Problem

It seems like whenever I access a wallet to see it inside the wallet, the triple pulsing blue dots happen. Then when I go to a different screen and go back to the wallet in question, the dots immediately happen again. Are we calling transactions from peers every time we look at a transaction list? This is best case an annoyance as sometimes I have to wait 3-30 seconds every time I click a wallet, and sometimes it doesn't even load... worst case, we are congesting the peers who keep giving us the same transaction lists over and over. This is taking away from the fluidity of the user experience.

Solution

As it is a desktop wallet, we should be able to achieve instant viewing of transaction lists as we move between different addresses, through a local cache. Then new transactions should be pushed to the wallet via webhooks or manual refresh button. The wallet usage experience can become lightning fast and peers will be destrained.

Furthermore, when you are importing a wallet address, should have the option to download all transactions, which will result in a progress bar or log showing activity as the transactions are downloaded into the cache. After that point the peer is not needed again, unless a webhook event occurs or manual refresh button is pressed

Are there any factors regarding local caching that I'm missing?

@zillionn
Copy link
Contributor

I fully agree with you. What's the point of downloading all txs over and over again, they can't change, it's a BLOCKCHAIN! 🤣

IMO you should pull only the newest txs, using the timestamp of the latest cached:
http://95.179.134.209:4003/api/v2/wallets/DFWTC6qyGgWPFp3NvWtmtvZV1mKF9ASVMk/transactions?timestamp.from=123123123

Webhooks are turned off on most peers.

@doubled1c3
Copy link
Author

Copy that. Yeah, let's get it implemented to achieve a big leap in user experience!

@tpscrpt
Copy link
Contributor

tpscrpt commented Jan 2, 2019

@zillionn what's the correct API call for timestamp from? The above doesn't work.

@zillionn
Copy link
Contributor

zillionn commented Jan 2, 2019

I'm afraid it's not possible yet. Right @faustbrian ?

@zillionn
Copy link
Contributor

zillionn commented Jan 2, 2019

I saw the schema, but does it really work? I don't see anywhere in the code where it actually searches by timestamp.

@dated
Copy link
Contributor

dated commented Jan 2, 2019

Timestamp is supported by the search endpoint only.

@zillionn
Copy link
Contributor

zillionn commented Jan 2, 2019

Am I doing something wrong?

curl 'https://dexplorer.ark.io/api/transactions/search?limit=3' -H 'api-version: 2' -H "Content-Type: application/json" -d '{ "senderId": "DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395" }'

{"meta":{"count":3,"pageCount":14,"totalCount":40,"next":"/api/v2/transactions/search?limit=3&page=2","previous":null,"self":"/api/v2/transactions/search?limit=3&page=1","first":"/api/v2/transactions/search?limit=3&page=1","last":"/api/v2/transactions/search?limit=3&page=14"},"data":[{"id":"02addb0de66e4a534e5adc5fcefcb4f42697e9dfc44c6714b5d653294e11a973","blockId":"15132300509932138435","version":1,"type":3,"amount":0,"fee":100000000,"sender":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","recipient":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","signature":"3044022018d98958b8ac416a602541f722caf1e233797800f2b405c9d4487c8d6f33ddeb02207cddd2ae8abff7959458ba7e51e90c84f0023f43f5c3a56cb3b1db471aa0789c","asset":{"votes":["+02d2a18dcb0dd7abd0a91ca70cb79d04e1ff7a4e77d1d8beda3d6c0a51b55a5db1"]},"confirmations":357979,"timestamp":{"epoch":51916574,"unix":1542017774,"human":"2018-11-12T10:16:14.000Z"}},{"id":"353e0bd2f6d33f787ceb1920d18ce236c3f6b0316856d9d40e0a19a4c01fdb76","blockId":"6280039547660963824","version":1,"type":3,"amount":0,"fee":100000000,"sender":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","recipient":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","signature":"3045022100c497728205311018191a478a11398aeb97859ac8a9e9f066d069bcfa641f203a0220106f566f20f8a3cff01f8c677323f662169c987acd045de7456f0bef2b48ce26","asset":{"votes":["-0247a6d06f23c2a2fdeee44e83a6e76b6b71c64c79f15d7b56247335767a8ac5fe"]},"confirmations":357980,"timestamp":{"epoch":51916566,"unix":1542017766,"human":"2018-11-12T10:16:06.000Z"}},{"id":"c3c7090fa0ea9581369ccc5b89588c8657d119a2a3f9830227c066ab2b59c5b3","blockId":"10566090164238015622","version":1,"type":3,"amount":0,"fee":100000000,"sender":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","recipient":"DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395","signature":"3045022100de629c2d3eeeba790293906128373a4824b3e6f482d64a638559836fc162a650022053da00dbca0805d8ccf6287846a3e8980718e338f2b9990912c995937f4d1966","asset":{"votes":["+0247a6d06f23c2a2fdeee44e83a6e76b6b71c64c79f15d7b56247335767a8ac5fe"]},"confirmations":358196,"timestamp":{"epoch":51914712,"unix":1542015912,"human":"2018-11-12T09:45:12.000Z"}}]}

curl 'https://dexplorer.ark.io/api/transactions/search' -H 'api-version: 2' -H "Content-Type: application/json" -d '{ "senderId": "DNrspE9CF1ZoJDXLhtowVVDJhhsSDjm395", "timestamp": {"from": 1542015912} }'

{"meta":{"count":0,"pageCount":0,"totalCount":0,"next":null,"previous":null,"self":"/api/v2/transactions/search?page=1&limit=100","first":"/api/v2/transactions/search?page=1&limit=100","last":null},"data":[]}

@tpscrpt
Copy link
Contributor

tpscrpt commented Jan 2, 2019

timestamp is supposed to be based off of epoch (2017-03-xx?) and devnet goes only to october 24th this year @zillionn

@zillionn
Copy link
Contributor

zillionn commented Jan 2, 2019

Oh I see, I have to use the epoch not the unix timestamp.

@j-a-m-l j-a-m-l added the Type: Feature The issue is a request for new functionality. label Feb 25, 2019
@j-a-m-l j-a-m-l self-assigned this Feb 25, 2019
@faustbrian faustbrian added this to the 3.0.0 milestone May 20, 2020
@faustbrian
Copy link
Contributor

Closing, no longer relevant for 3.0

@ghost
Copy link

ghost commented Jun 18, 2020

This issue has been closed. If you wish to re-open it please provide additional information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature The issue is a request for new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants