ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.82k stars 1.35k forks source link

Add rune parameter for "ord balances" command to get only specific rune balances. #3569

Open proskillowner opened 5 months ago

proskillowner commented 5 months ago

In the current implementation, ord balances command takes too long to show all rune balances. My suggestion is to add new parameter like "--rune" to specify which rune balances want to display.

ldiego08 commented 4 months ago

@raphjaph, I started looking into this but noticed there's no straightforward way to filter outpoints eagerly by rune (spaced, id, etc.). The balances command calls (get_rune_balance)[https://github.com/ordinals/ord/blob/879cee6559718f7bd683194ac17daf00367ae3cb/src/index.rs#L1068] in the index and later decodes the rune info from the outpoint data. The rune is unknown until this point, meaning we would still need to decode all balances before filtering. It would take just as long. Any recommendations here?

raphjaph commented 3 months ago

@ldiego08 yes, we would need a separate database table for that. PR #3675 adds this. I'll have a look what the status of that PR is and then we can build this feature ontop of that

ldiego08 commented 3 months ago

@ldiego08 yes, we would need a separate database table for that. PR #3675 adds this. I'll have a look what the status of that PR is and then we can build this feature ontop of that

@raphjaph awesome! If there's anything I can help with, just lmk. :)