Proposal: Adding diamond sockets to scuttle-shell
note: This is a first rough draft to get feedback from the community.
What are you going to do?
I want to contribute a good amount of time to scuttle-shell.
I rolled out the why in the motivation question below but the gist is this: I want multiple clients being able to run of of one sbot instance. Right now we have deadlocks so that you can only run either patchwork or that other client.
An interested circle had a gathering about two weeks ago where we consolidated our vision for what the shell cloud become. The notes from the call notes with a first milestone/roadmap draft can be found on that thread but to make it more specific, here is is my adapted version for this grant:
Milestone #0 - The Basics
- get these clients working against the shell
I propose patchbay, tale:net, git-ssb and patchfoo because I use them the most and are familiar with their design.
working for me means having a functional version of the clients using scuttle-shell installed from npm.
patchwork will come later as it has specific demands better solved with out-of-process plugins.
I'd also interested in coordinating with tictack and ngx if they are interested but I don't think this step of the grant should be port all the things but more a show that it works. - hard-coded list of plugins
which is the union of all the required plugins by the above clients.
currently git-ssb needs ssb-links which patchbay is missing, for instance. add two new plugin load pathwaysmoved to m#1maybe make the API the same as scuttlebot then we could replaceThis was my idea and it sounds nice but I fear it will make this more complicated than useful.scuttlebot
withscuttleshell
notes:
The biggest blocker I see here is getting the platform-dependent systrayhelper binary installed through an npm postinstall script.
With a good multi-platform example/template at hand, I'm fairly certain that I can port/adapt it to our needs.
Then it's just making the clients use the new shell. I'm fairly certain @mix' PR for patchbay is already >50% there and since the code in tale:net for sbot server
booting is very similar, that will also be a no-brainer. It's more of a question of polishing glue code once the shell itself is settled.
Milestones #1 - more dynamic
- be able to get scuttle-shell to take additional plugins
- maybe be able to add them via providing a path
- @SoapDog already did most of the required work for this in %8ycfKNk...
- maybe detect which clients are installed and load their plugins
notes:
I'm not so certain about the useful-ness of 1. but my guess is that it might be very handy for devs to work on new plugins.
I'm also unsure about 2. it sounds like a big chicken-egg thing and yet another level of package management.
On the other hand: we could use this functionality later to multiplex the protocol handlers to specific apps. Like lookup ssb://$someHash
and see if it is a type:gathering
or type:git-update
and delegate to an app that can support this.. now we are totally in dream land again and I'm much more excited about the things that m#2 brings.
Miltestone #2 - use plugins2 to register own plugins at runtime
plugins2 is the working title that popped in my had during the call.
It is about Plugins, which can be registered on an already running sbot.
Right now you need to shutdown sbot server, change the required plugins and start it again.
This makes it possible for any client to supply a plugin that it needs by itself and will allow for removing the too large set of plugins hard-coded in M#0 to near zero once clients migrated to this approach. @keks and I came up with this idea while prototyping our go-ssb sbot and formulated it in %oxtXLx0... after having a call with @Aljoscha. Later we also had a call with @dominic and he wrote up spec for out-of-process plugins.
The gist would be that we can have a really strong core sbot in any language, and clients that want to use map filter reduce in the flavor of ssb-query
can just register their needs through this interface. One implementation would then be, starting this plugin as another process and proxying calls through the main sbot when it sees querys starting with that name.
This way our new sbot can support all the existing clients without having to implement any of the query language logic that comes with that specific plugin. Other implementations, like full nodejs, can just require them as usual, with some book-keeping of course.
end part1