Skip to content

Commit

Permalink
docs: Add instructions for paying an offer with the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalturtle committed Feb 7, 2024
1 parent 8f9819d commit 9442eb7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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:
Expand Down
43 changes: 43 additions & 0 deletions docs/cli_commands.md
Original file line number Diff line number Diff line change
@@ -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] <COMMAND>
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 <NETWORK> Global variables [default: regtest]
-t, --tls-cert <TLS_CERT> [default: /$HOME/.lnd/tls.cert]
-m, --macaroon <MACAROON> [default: /$HOME/.lnd/data/chain/bitcoin/regtest/admin.macaroon]
-a, --address <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 <OFFER_STRING> <AMOUNT_MSATS>`

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 <OFFER_STRING> <AMOUNT_MSATS>`

0 comments on commit 9442eb7

Please sign in to comment.