This is a command-line interface that allows you to manage a lightning node and its LSP connections. It's powered by a Greenlight node and the Breez SDK and its main purpose is to serve as a end-to-end demonstration of what's possible.
The main advantage of this setup is the ability to host a Lightning Node in the cloud but without exposing the private key material to third parties.
The Breez documentation provides some code snippets here. In fact this small CLI client was created to test them out, and is now made available for anyone who needs a more complete sample code.
Follow the steps to compile the Breez SDK python bindings here.
Once done copy the following files to the root directory:
- breez_sdk.py
- libbreez_sdk_bindings.dylib
You must just create a file called secrets.txt
in the root directory of the project that will contain the secrets. A sample is provided at secrets.sample.txt
so you can just:
$ cp secrets.sample.txt secrets.txt
And fill in the required secrets. The expected format of the file is as follows:
phrase: <your seed phrase>
invite_code: <your greenlight invite code>
api_key: <your breez sdk api code>
Use the following commands to interact with your Greenlight node:
Documented commands (type help <topic>):
========================================
balance help lnurl_withdraw send
exit info pay_address swap_progress
get_deposit_address list_refundables pay_invoice txs
get_invoice lnurl_pay reverse_swap_progress
If you're updating the library, you may encounter an EXC_BAD_ACCESS (SIGKILL - Code Signature Invalid) error
This happens because macOS requires that all executables and shared libraries be signed with a valid code signature. To resolve this, you'll need to manually sign the libbreez_sdk_bindings.dylib file.
Run the following command in your terminal:
$ sudo codesign --force --deep --sign - /<path_to_your_current_dir>/breez-sdk-cli-wallet/libbreez_sdk_bindings.dylib