Lightning Prisms have been implemented as a CLN plugin.
We are going to jump right into how you can run ROYGBIV on your own CLN node (assuming that you already have a node up and running). This post will be geared towards the Bolt 12 Prism Plugin, but can be used generally for other plugins as well.
ROYGBIV is written in Python with the pyln-client library, so your node will need to have Python installed as well as the pyln-client library. You'll also need the plugin itself.
The plugin can be found here. You just need `prism-plugin.py`, but feel free to clone the whole repo as well.
Python just needs to be installed in the same environment as your node. This means that if you are running CLN on a server, simply install Python onto the server. Or, for example, if you are running CLN in a Docker container, make sure Python is installed there.
apt install python3
Once Python is installed, installing the library is as simple as:
apt install pip && pip install pyln-client
Okay, now that we've got the dependencies taken care of lets jump into actually running the plugin on your node.
Starting the Plugin
There are two options to start the plugin.
- Generally, you will want the plugin to start whenever your node starts
- Often for development, it's handy to manually stop and start the plugin
To make the plugin start when your node starts, it's as simple as adding the path to the plugin in your config file.
Add to your node's config file:
You can also add the plugin and enable offers in your startup command
Start Up Command
From the command line, when you start your node add the
--plugin flag. It would look something like this:
lightningd --plugin=/path/to/bolt12-prism.py --experimental-offers
Awesome, now your node is running and has exposed the RPC methods made available by the plugin.
But what if you are developing on the plugin? Well, if you make any changes to the plugin file, then those changes will not be reflected until you stop and start (aka restart) the plugin.
In order to stop and start the plugin you will need access to
lightning-cli. If you've followed the install instructions for CLN you should be all good to go!
lightning-cli getinfo . This should return a JSON object (not an error 😁).
Sometimes (if not specified in your config file), you will need to specify which directory your node is running from using the
This would look something like this:
lightning-cli plugin start --plugin=/path/to/bolt12-prism.py
lightning-cli plugin stop bolt12-prism.py
lightning-cli plugin list
Again, this method of manually stopping and starting is generally for development purposes because the plugin needs to be restarted before any changes made are seen by the node.