mlabs-haskell / TuxedoDapp

Cryptokitties on Polkadot using UTXO
Apache License 2.0
2 stars 1 forks source link

FE-JS:Searching kitties #4

Closed AltiMario closed 2 months ago

AltiMario commented 4 months ago

Searching kitties owned by other users. This was in the proposal.

NadigerAmit commented 4 months ago

This is difficult to implement:

Currently, we are supporting the filtering the UTXO in local db based on the public key of interest. basically, we are filtering only UTXO belonging to the keys that are installed in cli-wallet during the time block syncing.

As of now, I am not sure to achieve this in UTXO model if I want to get the kitties from the user whose keys are not installed in my wallet, which is the real-time scenario.

I will investigate on this or ask Joshy.

Withen the same wallet, I can do search based on the public key : https://github.com/mlabs-haskell/Tuxedo/blob/4caa90a2cc88b70973427c55c154f5af224118b8/wallet/src/sync.rs#L639-L644

NadigerAmit commented 4 months ago

Since UTXO are scattered, difficult to search for kitties that are for sale based on owner. One idea is Maintain an off-chain database that stores each kitty irrespective of any user, as we are doing now. In real time situation. the size of locadb increases.

NadigerAmit commented 4 months ago

Created a new issue in the main Tuxedo issue track for this : https://github.com/Off-Narrative-Labs/Tuxedo/issues/184

NadigerAmit commented 4 months ago

I think you can storing the kitties in local db is good for now : So lets go ahead with this approach . https://github.com/Off-Narrative-Labs/Tuxedo/issues/184#issuecomment-1964331728

AltiMario commented 2 months ago

hi @NadigerAmit now that the data is stored in the backed, have you implemented the search function at CLI-wallet? if it exists, @philoniare can make the API for it and connect the frontend

NadigerAmit commented 2 months ago

Hi @AltiMario and @philoniare ,

Yes, I already provided the below API for search in backend :

get-kitty-by-dna get-tradable-kitty-by-dna get-all-kitty-list get-all-tradable-kitty-list get-owned-kitty-list get-owned-tradable-kitty-list

Please see the details of the above API in below link : https://github.com/mlabs-haskell/Tuxedo/blob/webservice-with-external-signing/README.md