What languages can I write plugins for c-lightning in?

4

I know that there's a Python library available for writing plugins for c-lightning. What would I need to do to for example use a JVM language like Scala?

torkel

Posted 2019-02-05T14:00:11.543

Reputation: 122

Answers

5

Plugins can be written in any language as long as a client library for that language exists.

The command line API and the Plugins communicate with lightningd over a unix domain socket using JSON RPC 2.0.

As far as I know no Java / Scala lib exists. I have started creating one at this pull request: https://github.com/ElementsProject/lightning/pull/2223

also it makes sense to look at the python plugin lib to see how the format of the JSON RPC 2.0 is used. Check out: https://github.com/ElementsProject/lightning/blob/master/contrib/pylightning/lightning/plugin.py which is really just a client lib talking to the UNIX Domain socket and parsing / dispatching the JSON RPC responses. So as soon as you create this in Java / Scala you should be able to create as many plugins as you wish. You could build upon my pull request (though I have started with the client library for the standard API)

Rene Pickhardt

Posted 2019-02-05T14:00:11.543

Reputation: 6 565