Explore names
RPC methods #35
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: golgi-ssb/golgi#35
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Go-SSB supports three name / image-related methods:
a781ad4ee5/sbot/manifest.go (L89)
According to ssb-names, they do the following:
get() : get all naming relationships
getImageFor(id) : get the image for an id
getSignifier(id) : get the name for an id. returns a name for this id.
This could be a great way to simplify some of the
about
API methods in golgi.@notplants
Today I've been taking a look at this and experimenting with kuska.
The methods themselves are really efficient when interacting with a go-sbot.
name.getSignifier(ssb_id)
returns the latest name as a string and simply returns the ID if a name is not found in the local sbot log. I don't have any benchmarks for comparison but I think this will be quite a lot quicker than our current stream filtering approach. It'll make a big difference on the follows / followers / friends views in PeachCloud where we need to look-up names for many peers at once.Now the not-so-great news: I've learned that these methods are not implemented in Patchwork and Manyverse. Patchwork uses ssb-about, and Manyverse uses aboutSelf (from ssb-db2).
Since our current
about
methods usegetSubset
queries under the hood, they will also not work with Patchwork.So we have an interesting decision to make. One idea is to continue on our original path of focusing golgi development on go-ssb interoperability. This will lead to the best outcomes for PeachCloud and might prevent us tying ourselves in knots trying to cover all the bases (Go-SSB, Patchwork, Manyverse etc.).
For example, I could refactor our
get_name()
method to usenames.getSignifier
and leaveget_latest_about_message()
as it currently is. Then, when using go-ssb, one can useget_name()
for the most efficient result but could instead useget_latest_about_message()
if communicating with another client which hasgetSubset
but not support forssb-names
.that all sounds good to me. I would be a bit surprised if filtering in rust for names from about messages was a major bottleneck given that there is probably a pretty small number of about messages that any user has, but as you mentioned, since there could be a large list to get names for, a small difference could be multiplied, so sounds worth exploring
in regards to supporting different servers and their interfaces, there was also a related discussion at one point about whether to keep the muxrpc functions for the sake of it, or just have new ones that made more sense
I would lean towards providing the underlying functions where possible in a 1:1 mapping, in addition to any of our functions that we define,
so that if there is a particular function you want to call (e.g. names.getSignifier), you can call it, and the function ideally has the same name in golgi so its easy to find. I could see this being helpful for people using golgi with various servers with various subsets of muxrpc implemented, and that if they know what functions their server implements, they can only use those functions from golgi. I'm not sure if there is some sane way to indicate which functions are directly mapped to muxrpc functions, and which are our own, or are composite functions on top of the muxrpc stuff. but indeed, it seems like a red herring to try to focus on supporting all servers, especially initially, so maybe lets just prioritize go-sbot integration. what you described with names and get_about_messages makes sense to me
@notplants
Thanks for your thoughts and a sanity check on this. I'm revisiting this work this week and it was really helpful to reread this discussion.
Cool, this sounds good to me.
That's an interesting idea. I like it. I'll give this some thought while I work. One option is to add some sort of tag or keyword to the doc comments of each function.
The three methods mentioned above have now been merged into kuska:
https://github.com/Kuska-ssb/ssb/pull/27
Merged in #53