From 3532789c35f077ead7b67ec5c20e73b72ec58818 Mon Sep 17 00:00:00 2001 From: d11n Date: Fri, 9 Sep 2022 16:01:20 +0200 Subject: [PATCH] Improve Lightning Node setup examples (#4033) * Catch connection string ToString errors LNDhub connection string error fixed in btcpayserver/BTCPayServer.Lightning#92. * Add Eclair bitcoin-host example * Document LNDhub integration --- .../UIStoresController.LightningLike.cs | 11 +++++- .../Views/UIStores/SetupLightningNode.cshtml | 38 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs index dbfd787ce..2f715b229 100644 --- a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs @@ -160,7 +160,16 @@ namespace BTCPayServer.Controllers { CryptoCode = paymentMethodId.CryptoCode }; - paymentMethod.SetLightningUrl(connectionString); + + try + { + paymentMethod.SetLightningUrl(connectionString); + } + catch (Exception ex) + { + ModelState.AddModelError(nameof(vm.ConnectionString), ex.Message); + return View(vm); + } } switch (command) diff --git a/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml b/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml index 09ce7a7c7..6a5540af6 100644 --- a/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml +++ b/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml @@ -122,11 +122,19 @@
-
    +
    • type=eclair;server=https://eclair:8080/;password=eclairpassword...
    +

    + Note that bitcoin-host and bitcoin-auth are optional, only useful if you want to use GetDepositAddress on Eclair: +

    +
      +
    • + type=eclair;server=https://eclair:8080/;password=eclairpassword;bitcoin-host=bitcoin.host;bitcoin-auth=btcpass +
    • +
@@ -139,7 +147,7 @@
-
    +
    • type=lnd-rest;server=https://mylnd:8080/;macaroon=abef263adfe...
    • @@ -147,7 +155,7 @@ type=lnd-rest;server=https://mylnd:8080/;macaroon=abef263adfe...;certthumbprint=abef263adfe...
    -

    +

    For the macaroon options you need to provide the admin.macaroon.
    The path to the LND data directory may vary, the following examples assume /root/.lnd.

    @@ -162,6 +170,30 @@
+
+

+ +

+
+
+
    +
  • + type=lndhub;server=https://login:password@lndhub.io +
  • +
+

The credentials and server address are shown as a lndhub:// URL on the "Export/Backup" screen in BlueWallet.

+

You can also use this LNDhub-URL as the connection string and BTCPay Server converts it into the expected type=lndhub connection string format:

+
    +
  • + lndhub://login:password@@https://lndhub.io +
  • +
+
+
+