From c656c4ab88074da26e9c78dc39799c0e5c32f2f6 Mon Sep 17 00:00:00 2001 From: Orbital Date: Sun, 28 Jan 2024 22:10:04 -0600 Subject: [PATCH] docs: Add instructions for paying an offer with the cli --- README.md | 8 ++++++++ docs/cli_commands.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 docs/cli_commands.md diff --git a/README.md b/README.md index 8313067b..c9277a53 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,14 @@ protocol.custom-nodeann=39 protocol.custom-init=39 ``` +#### Two options for LNDK + +Now that we have LND set up properly, there are two key things you can do with LNDK: +1) Forward onion messages. By increasing the number of Lightning nodes out there that can forward onion messages, this increases the anonymity set and helps to bootstrap BOLT 12 for more private payments. +2) Pay BOLT 12 offers, a more private standard for receiving payments over Lightning, which also allows for static invoices. + +To accomplish #1, follow the instructions below to get the LNDK binary up and running. For #2, you can [use the CLI](https://github.com/lndk-org/lndk/blob/master/docs/cli_commands.md). + #### Running LNDK Now we need to set up LNDK. To start: diff --git a/docs/cli_commands.md b/docs/cli_commands.md new file mode 100644 index 00000000..3acbdf62 --- /dev/null +++ b/docs/cli_commands.md @@ -0,0 +1,43 @@ +# LNDK-CLI + +For now, you can use `lndk-cli` separately from `lndk` meaning you don't need to have a `lndk` binary running for `lndk-cli` to work. + +## Installation + +To use the `lndk-cli` to pay a BOLT 12 offer, follow these instructions: +- To install lndk-cli: + `cargo install --bin=lndk-cli --path .` +- With the above command, `lndk-cli` will be installed to `~/.cargo/bin`. So make sure `~/.cargo/bin` is on your PATH so we can properly run `lndk-cli`. +- Run `lndk-cli -h` to make sure it's working. You'll see output similar to: + +``` +A cli for interacting with lndk + +Usage: lndk-cli [OPTIONS] + +Commands: + decode Decodes a bech32-encoded offer string into a BOLT 12 offer + pay-offer PayOffer pays a BOLT 12 offer, provided as a 'lno'-prefaced offer string + help Print this message or the help of the given subcommand(s) + +Options: + -n, --network Global variables [default: regtest] + -t, --tls-cert [default: /$HOME/.lnd/tls.cert] + -m, --macaroon [default: /$HOME/.lnd/data/chain/bitcoin/regtest/admin.macaroon] + -a, --address
[default: https://localhost:10009] + -h, --help Print help +``` + +## Commands + +Once `lndk-cli` is installed, you can use it to pay an offer. + +Since `lndk-cli` needs to connect to lnd, you'll need to provide lnd credentials to the binary. If your credentials are not in the default location, you'll need to specify them manually. + +If your credentials are in the default location, paying an offer looks like: + +`lndk-cli pay-offer ` + +If your credentials are not in the default location, an example command looks like: + +`lndk-cli -- --network=mainnet --tls-cert=/credentials/tls.cert --macaroon=/credentials/custom.macaroon --address=https://localhost:10019 pay-offer `