clio icon indicating copy to clipboard operation
clio copied to clipboard

Plugin system for RPC commands

Open intelliot opened this issue 1 year ago • 10 comments

A plugin system/ecosystem for commands would allow the community to extend the functionality of Clio, making it more flexible and adaptable for a wider range of use cases.

Originally posted by @sublimator in https://github.com/XRPLF/rippled/issues/2438#issuecomment-374069369

intelliot avatar Feb 08 '24 18:02 intelliot

Example of an RPC that may make sense as a plugin:

Light/reduced book_offers

by @professorhantzen

An optional "light" book_offers request.

The main reason clients request the book is to place trades against it, or to present it in an interface for a user to trade against. To do this, clients require only two numbers per offer: the quality, and the funded amount of taker_gets. In most cases the other material rippled supplies is of no use. The issuer and currency for each offer is redundant for example, as it doesn't change and is known prior to sending the request. A light request could reduce book_offers bandwidth by around 95% (~800bytes vs ~40bytes per offer).

intelliot avatar Feb 08 '24 18:02 intelliot

Wow, blast from the past :)

sublimator avatar Feb 09 '24 16:02 sublimator

Curious to hear opinions on whether folks would prefer native (C++) plugins or some sort of extensions mechanism thru scripting (think Lua, Python, C#, etc.).

godexsoft avatar Feb 09 '24 16:02 godexsoft

separate plugin process?

sublimator avatar Feb 09 '24 16:02 sublimator

separate plugin process?

Can you explain in more detail what you mean with this comment?

In my understanding, a plugin would be either some sort of shared library that Clio can load and execute or it can be some script that extends functionality of Clio by using APIs we provide.

I don't think a plugin needs to be able to do everything. I personally would prefer to expose a set of APIs for developers of plugins. I imagine some way to hook into the ETL process, read/write to DB and become an RPC handler (get called by Clio when the command/method matches).

godexsoft avatar Feb 09 '24 18:02 godexsoft

Well, similar to say chrome, or sublime text, where plugins run in a separate process, so the system is a bit more resilient when plugins crash. Before Sublime Text 3 the author was tired of the plugins undoing all his performance work, so he moved to that architecture.

A throwaway question to be honest, I don't have much stake in this. Was @ mentioned so came to see what's up.

But maybe worth considering at the outset.

sublimator avatar Feb 09 '24 18:02 sublimator

@mvadari fyi 👍

godexsoft avatar Jun 18 '24 12:06 godexsoft

Note: plugins as described in XLS-42d does not currently support custom RPCs.

mvadari avatar Jun 25 '24 14:06 mvadari

@mvadari good to know. Thankfully though Clio is not limited by any XLS - we could implement just about any plugin architecture. Tagged you because you are involved with rippled's plugin system and we always welcome you to help write stuff for Clio 👍

godexsoft avatar Jun 25 '24 14:06 godexsoft

@mvadari good to know. Thankfully though Clio is not limited by any XLS - we could implement just about any plugin architecture. Tagged you because you are involved with rippled's plugin system and we always welcome you to help write stuff for Clio 👍

I know, I was just noting that there's no existing API/format 🙂

mvadari avatar Jun 25 '24 14:06 mvadari