Using Coffee
Coffee is a plugin manager and development tool for core lightning nodes. It helps automate configuration and installation of plugins, and provides plugin templates for all the official languages.
Coffee is a command line utility that provides access to a wide range of tasks.
First Configuration
✅ Implemented
Coffee is able to manage the configuration of your core lightning and all the plugins connected with it, so in order to use Coffee, the user needs to point Coffee to the current root of core lightning.
By default the Core Lightning home is stored in the /home/<user>/.lightning
,
and you can do it with the following command
coffee link /home/alice/.lightning
If you want to unlink coffee from Core Lightning configuration at any time, you can do it with the following command
coffee unlink /home/alice/.lightning
Then you will find an include at the end of the config file at
/home/alice/.lightning/bitcoin/config
, in case this config file do not exist
Coffee will create it.
include /home/alice/.coffee/testnet/coffee.conf
In addition there are the following additional option that you can specify:
--network
: by default set tobitcoin
, but if you want to specify the network that Core Lightning is using, you must ensure that the flag is set to the correct network.--data-dir
: by default set to/home/alice/.coffee
, you may want to set this option if you are looking to specify a different directory for the Coffee home.--skip-verify
: Use this option to bypasscoffee
's validation process, which checks for conflicts between its configuration and the local storage.
Add a Plugin Repository
✅ Implemented
Coffee ensures a high-functioning and secure core by allowing users to select repositories from which to download plugins, and then authorizing the installation of only the desired plugins.
To add a plugin repository, simply run the following command.
coffee remote add <repository_name> <repository_url>
To remove a plugin repository, simply run the following command.
✅ Implemented
coffee remote rm <repository_name>
To list plugin repositories, simply run the following command.
✅ Implemented
coffee remote list
To list available plugins in a specific remote repository
✅ Implemented
coffee remote inspect <repository_name>
Install a Plugin
✅ Implemented
Congratulations! After adding a repository, Coffee will catalogue it, allowing you to explore all the plugins that can be installed via the CLI. Coffee offers multiple installation strategies that you can select based on your preferences, such as:
Dynamic installation
To install a plugin dynamically, you simply need to run.
coffee install -d <plugin_name>
Static installation
✅ Implemented
To install a plugin statically, you simply need to run.
coffee install <plugin_name>
Removing a Plugin
✅ Implemented
To remove an installed plugin, you simply have to run the following command.
coffee remove <plugin_name>
Disabling a Plugin
✅ Implemented
Disabling a plugin means that the plugin will not be loaded with CLN but it will still be installed and can be enabled at any time.
To disable a plugin, run:
coffee disable <plugin_name>
Enabling a Plugin
✅ Implemented
To enable a plugin, run:
coffee enable <plugin_name>
Upgrade a Plugin
Coffee tightly integrates with git, allowing you to easily upgrade your plugins through the command line interface (CLI). This eliminates the need for tedious tasks such as downloading the latest updates and creating new versions of plugins. To upgrade a plugin, all you need to do is run.
✅ Implemented
coffee upgrade <repo_name>
Listing all the plugins
✅ Implemented
coffee list
Showing the README file of the plugin
✅ Implemented
coffee show <plugin_name>
Searching for a plugin in remote repositories
✅ Implemented
coffee search <plugin_name>
To solve issues with coffee configuration and ensure its integrity on disk
✅ Implemented
coffee nurse
Additionally, if you wish to perform a verification of coffee without making any changes, you can use the --verify
flag:
coffee nurse --verify
Tipping a plugin in Bitcoin
✅ Implemented
coffee tip <plugin_name> <millisatoshi>
Running coffee as a server
To run Coffee as a server, you can use the coffee_httpd
binary.
Please note that the server runs on localhost
with port 8080
where you can find a Swagger API documentation with all the available endpoints.
Starting the Coffee Server
To start the Coffee server, run the following command:
coffee_httpd --cln-path <core_lightning_path> --network <network>
Make sure the coffee_httpd
binary is in your system PATH or in the current working directory.