gl-cli
is a command-line interface for running a Greenlight signer and
operating a Greenlight node. It is built on top of the gl-client
library.
The crate is called gl-cli
to be consistent with the naming scheme that
Greenlight uses but the binary it produces is glcli
for convenience
reasons.
glcli
is not yet feature-complete but already provides a basic set of
commands necessary for everyday node operations. Planned future enhancements
include additional commands and broader integration.
- Scheduler: Interact with Greenlight's scheduler to provision and start nodes.
- Signer: Run and interact with a local signer.
- Node: Operate and control a lightning node hosted on Greenlight.
You can install glcli
from crates.io
cargo install gl-cli
Ensure Rust is installed on your system. If it is not installed, you can set it up using Rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Navigate to the glcli
directory and use Cargo to install glcli
into
your CARGO_HOME
(which defaults to $HOME/.cargo/
):
cargo install --path=.
Ensure that CARGO_HOME/bin
is in your PATH
.
After installation, run:
glcli --help
This will display an overview of the available commands.
By default, glcli
stores application data in the system's default data
directory:
- Linux:
$XDG_DATA_HOME
or$HOME/.local/share
- macOS:
$HOME
/Library/Application Support
To specify a custom data directory, use the --data-dir
or -d
option. For
example:
glcli -d "${HOME}/.greenlight_node_1" node getinfo
Before you can operate a Greenlight node you have to register one. Currently,
you need an invite code or a
developer certificate
to register a new node. glcli
currently supports registration via an
invite code using the --invite-code
option:
glcli scheduler register --invite-code=<YOUR_INVITE_CODE>
To operate your node, you need to attach a local signer to your Greenlight node. The signer is responsible for handling cryptographic signing operations, ensuring transaction security and validating requests before granting signatures locally.
Start a local signer and attach it to Greenlight by running:
glcli signer run
The signer now listens for incomming requests.
(Optional scheduling): When executing a node
command, glcli
will
automatically start the node by calling Greenlight's scheduler if necessary.
However, you can manually schedule your node in advance by running:
glcli scheduler schedule
Once provisioned, you can interact with your node using node
subcommands. For
example to check the node's operational state:
glcli node getinfo
Greenlight supports running nodes on the bitcoin
and signet
networks,
defaulting to bitcoin
. To register a Greenlight node on signet
, use the
--network
option:
glcli --network="signet" scheduler register
Include the --network
option in all susequent commands for this node. For
example:
glcli --network="signet" signer run
glcli --network="signet" node getinfo
Please note that we do not support testnet
at the moment. Please open an
issue describing your use case if you need support for other networks.
cargo build
cargo test
glcli
is under active development and currently lacks many major commands from
Core-Lightning such as
listinvoices
, fundchannel
, close
and sendpay
. Contributions to
add these and other missing commands are welcome. If you need a command
that is not yet available, feel free to submit a pull request or open an issue
describing your use case.
If you encounter any bugs, please report them via an issue or contribute a fix through a pull request.
glcli
is licensed under the MIT License