Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offers: send invoice request #87

Merged
merged 24 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a4ad1cc
multi: propagate shutdown signal from caller to lndk
carlaKC Dec 20, 2023
b104164
multi: refactor to create OfferHandler and LndkOnionMessenger
carlaKC Dec 20, 2023
8241ca1
lib: implement and use OfferMessageHandler on OfferHandler
carlaKC Dec 20, 2023
277e53e
lib: refactor create_invoice_request to be a method of OfferHandler
orbitalturtle Jan 31, 2024
6f4ae68
offers: rename create_invoice_request
orbitalturtle Jan 31, 2024
9bfed00
itests: update lnd submodule to tagged hash change
orbitalturtle Nov 14, 2023
8b00be5
itests: add walletrpc subserver to lnd Makefile/README
orbitalturtle Nov 14, 2023
53640aa
Pin rust-lightning to a custom version
orbitalturtle Nov 16, 2023
3f9982f
Add tokio clock default to satisfy clippy
orbitalturtle Nov 17, 2023
26b039f
utils: add Default for MessengerUtilities to satisfy clippy
orbitalturtle Jan 19, 2024
fbd5ae1
main: ignore unused imports from configure_me
orbitalturtle Jan 25, 2024
6de424f
tests: specify log level in ldk nodes
orbitalturtle Nov 19, 2023
be673e6
README: Fix bakemacaroon typo
orbitalturtle Nov 22, 2023
a469d71
Fix Makefile test typo
orbitalturtle Jan 1, 2024
8263b9e
Export MessengerUtilities for integration tests
orbitalturtle Jan 5, 2024
780d0fb
offers: add logic for connecting to the introduction node peer
orbitalturtle Jan 2, 2024
ac957e4
offers: validate offer amount user input
orbitalturtle Jan 2, 2024
f97bd3d
offers: wait for onion messenger ready signal before sending request
orbitalturtle Jan 22, 2024
3b09ec2
offers: Build a reply path for invoice request
orbitalturtle Jan 29, 2024
df50a92
itests: add lnd API calls needed to set up channels
orbitalturtle Jan 31, 2024
491e42e
itests: export bitcoind for tests
orbitalturtle Jan 12, 2024
8bfb006
itests: bump ldk-sample to newer version
orbitalturtle Jan 31, 2024
8af07f4
itests: advertise ldk node address
orbitalturtle Feb 6, 2024
b85cad4
offers: send invoice request
orbitalturtle Jan 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 35 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bitcoin = { version = "0.29.2", features = ["rand"] }
clap = { version = "4.4.6", features = ["derive"] }
futures = "0.3.26"
home = "0.5.5"
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "caafcedf3fc40fc6253261218c25b254dd955a82" }
lightning = { git = "https://github.com/orbitalturtle/rust-lightning", branch = "v0.0.118-custom", features = ["max_level_trace"] }
rand_chacha = "0.3.1"
rand_core = "0.6.4"
log = "0.4.17"
Expand All @@ -29,12 +29,13 @@ tonic_lnd = { git = "https://github.com/orbitalturtle/tonic_lnd", branch = "upda
hex = "0.4.3"
configure_me = "0.4.0"
bytes = "1.4.0"
triggered = "0.1.2"

[dev-dependencies]
bitcoincore-rpc = { package="core-rpc", version = "0.17.0" }
bitcoind = { version = "0.30.0", features = [ "22_0" ] }
chrono = { version = "0.4.26" }
ldk-sample = { git = "https://github.com/lndk-org/ldk-sample", branch = "onion-handler" }
ldk-sample = { git = "https://github.com/lndk-org/ldk-sample", branch = "change-node-announcement-interval" }
mockall = "0.11.3"
tempfile = "3.5.0"

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ endif
itest:
@$(call print, "Building lnd for itests.")
git submodule update --init --recursive
cd lnd/cmd/lnd; $(GO_BUILD) -tags="peersrpc signrpc dev" -o $(TMP_DIR)/lndk-tests/bin/lnd-itest$(EXEC_SUFFIX)
$(CARGO_TEST) -- -- test '*' --test-threads=1 --nocapture
cd lnd/cmd/lnd; $(GO_BUILD) -tags="peersrpc signrpc walletrpc dev" -o $(TMP_DIR)/lndk-tests/bin/lnd-itest$(EXEC_SUFFIX)
$(CARGO_TEST) --test '*' -- --test-threads=1 --nocapture

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ When you encounter a problem with `LNDK`, Feel free to file issues or start [a d

To run `LNDK`, you require access to a `LND` node running _at least_ [LND v0.17.0](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.0-beta).

You will need to compile `LND` in `dev` mode (to enable protocol-level feature handling externally) and enable the `peersrpc` and `signerrpc` sub-servers:
You will need to compile `LND` in `dev` mode (to enable protocol-level feature handling externally) and enable the `peersrpc`, `signerrpc`, and `walletrpc` sub-servers:

`make install tags="peersrpc signrpc dev"`
`make install tags="peersrpc signrpc walletrpc dev"`

Note that this guide assumes some familiarity with setting up `LND`. If you're looking to get up to speed, try [this guide](https://docs.lightning.engineering/lightning-network-tools/lnd/run-lnd).

Expand Down Expand Up @@ -82,7 +82,7 @@ Or in a more concrete example:
Rather than use the admin.macaroon with unrestricted permission to an `LND` node, we can bake a macaroon using lncli with much more specific permissions for better security. With this command, generate a macaroon which will give `LNDK` only the specific grpc endpoints it's designed to hit:

```
lncli --save_to=<FILEPATH>/lndk.macaroon uri:/lnrpc.Lightning/GetInfo uri:/lnrpc.Lightning/ListPeers uri:/lnrpc.Lightning/SubscribePeerEvents uri:/lnrpc.Lightning/SendCustomMessage uri:/lnrpc.Lightning/SubscribeCustomMessages uri:/peersrpc.Peers/UpdateNodeAnnouncement uri:/signrpc.Signer/DeriveSharedKey
lncli bakemacaroon --save_to=<FILEPATH>/lndk.macaroon uri:/lnrpc.Lightning/GetInfo uri:/lnrpc.Lightning/ListPeers uri:/lnrpc.Lightning/SubscribePeerEvents uri:/lnrpc.Lightning/SendCustomMessage uri:/lnrpc.Lightning/SubscribeCustomMessages uri:/peersrpc.Peers/UpdateNodeAnnouncement uri:/signrpc.Signer/DeriveSharedKey
```

## Security
Expand Down
2 changes: 1 addition & 1 deletion lnd
Submodule lnd updated 240 files
6 changes: 6 additions & 0 deletions src/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ impl Clock for TokioClock {
Instant::now()
}
}

impl Default for TokioClock {
fn default() -> Self {
Self::new()
}
}
Loading
Loading