I had a question from a friend this morning about Core Lightning RPC interface and I thought my answer may be helpful for other. So here we are in Stacker News.
What is your take on RPC? my understanding is that you cannot add rune permissions to it and that it gives you admin access (god mode) on your node.
- A unix socket RPC client is something that runs on the same machine as your node and connects to it via the socket file
lightning-rpc. It is something inherently local. So if you run something in you node machine, anyway you already have access to the node, so there is no need for restriction like rune. If you have access to the node, you are already god ;) - For instance
lightning-cliis a RPC client. You use it in the same machine as the node, and each time you run a command it connect to your node via the socket filelightning-rpc. So if there is no unix socket RPC client, you couldn't talk to your node. - clnrest and cln-grpc are both plugins that expose CLN commands via some (communication) protocols: HTTP/HTTPS for clnrest and Grpc for cln-grpc. Both plugins are running locally in the node's machine, and both use a unix socket client to talk to the node. clnrest uses the Python library
pyln-clientas RPC client andcln-grpcuses the Rust librarycln-rpc. So when you ask one of those plugins to do something on your node, they will issue a RPC request to your node. What is interesting is thatclnrestasks you for arunebecause it will check withcheckruneif you are allowed to run the command you want to run and then run it locally. Something thatcln-grpcdoesn't do (as far as I understand). lnsocketis really something different. This is a library (C, go) that connects to your node using the LN protocol (BOLT #8 and BOLT #1) and sendcommandomessages. And your node that runs the builtin plugincommandoknows how to handle those specific messages. Andcommandorequires aruneto run the command you ask him to run. Under the hood it will also check the run withcheckrunecommand. If you are interested you can watch those lives:
I hope this is useful!
Have a nice day