btcpayserver/BTCPayServer/Views/Stores/AddLightningNode.cshtml

116 lines
6.0 KiB
Plaintext

@model LightningNodeViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "Add lightning node (Experimental)");
}
<partial name="_StatusMessage" />
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<p>
<span>Before you proceed, please understand that the Lightning Network is still considered experimental and is under active development.</span>
</p>
<p><strong>Do not add money that you can't afford to lose - there's a high risk of loss of funds.</strong></p>
<p>
Take time to familiarize yourself with the risks, some of which are:
</p>
<ul>
<li>Most BTCPay Server deployments run on a pruned node which, while working, is not officially supported by lightning network implementations.</li>
<li>
Lightning keys are NOT automatically backed up by BTCPay Server; your keys are in a hot-wallet. This means:
<ul>
<li>If you erase your BTCPay Server virtual machine: you lose all the funds.</li>
<li>If your server gets hacked: a hacker can take all of your funds by accessing your keys.</li>
<li>If there is a bug in a lightning network implementation: you could lose all the funds.</li>
</ul>
</li>
</ul>
<p>To proceed, please ensure that:</p>
<ul>
<li>You accept being #reckless and being the sole responsible party for any loss of funds.</li>
<li>You agree to keep on your lightning node only what you can afford to lose.</li>
</ul>
</div>
<div class="row">
<div class="col-md-10">
<form method="post">
<div class="form-group">
<p>This connection string encapsulates the necessary information BTCPay needs to connect to your lightning node, we currently support:</p>
<ul>
<li><code>clightning</code> via TCP or unix domain socket connection</li>
<li><code>lightning charge</code> via HTTPS</li>
<li><code>lnd</code> via the REST proxy</li>
</ul>
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th>Examples</th>
</tr>
</thead>
<tbody>
<tr>
<th class="small"><b>type=</b>clightning;<b>server=</b>unix://root/.lightning/lightning-rpc</th>
</tr>
<tr>
<th class="small"><b>type=</b>clightning;<b>server=</b>tcp://1.1.1.1:27743/</th>
</tr>
<tr>
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>http://mylnd:8080/;<b>macaroonfilepath=</b>/root/.lnd/admin.macaroon;<b>allowinsecure=</b>true</th>
</tr>
<tr>
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>https://mylnd:8080/;<b>macaroon=</b>abef263adfe...</th>
</tr>
<tr>
<th class="small"><b>type=</b>lnd-rest;<b>server=</b>https://mylnd:8080/;<b>macaroon=</b>abef263adfe...;<b>certthumbprint=</b>abef263adfe...</th>
</tr>
<tr>
<th class="small"><b>type=</b>charge;<b>server=</b>https://charge:8080/;<b>api-token=</b>myapitoken...</th>
</tr>
<tr>
<th class="small"><b>type=</b>eclair;<b>server=</b>https://eclair:8080/;<b>password=</b>eclairpassword...</th>
</tr>
</tbody>
</table>
<p>Note that the <code>certthumbprint</code> to connect to your LND node can be obtained through this command line:</p>
<p><pre><code>openssl x509 -noout -fingerprint -sha256 -inform pem -in /root/.lnd/tls.cert | sed -e 's/.*=//' -e 's/://g'</code></pre></p>
<p>You can omit <code>certthumbprint</code> if the certificate is trusted by your machine</p>
<p>You can set <code>allowinsecure</code> to <code>true</code> if your LND REST server is using HTTP or HTTPS with an untrusted certificate which you don't know the <code>certthumbprint</code></p>
</div>
<div class="form-group">
<label asp-for="ConnectionString"></label>
<input id="lightningurl" asp-for="ConnectionString" class="form-control" />
<span asp-validation-for="ConnectionString" class="text-danger"></span>
@if (Model.InternalLightningNode != null)
{
<p class="form-text text-muted">
You can use the internal lightning node by <a href="#" id="internal-ln-node-setter" onclick="$('#lightningurl').val('@Model.InternalLightningNode'); return false;">clicking here</a>
</p>
}
</div>
<div class="form-group">
<label asp-for="Enabled"></label>
<input asp-for="Enabled" type="checkbox" class="form-check" />
</div>
<button id="save" name="command" type="submit" value="save" class="btn btn-primary">Submit</button>
<button name="command" type="submit" value="test" class="btn btn-secondary">Test connection</button>
<a
class="btn btn-secondary"
asp-controller="PublicLightningNodeInfo"
asp-action="ShowLightningNodeInfo"
asp-route-cryptoCode="@Model.CryptoCode"
asp-route-storeId="@Model.StoreId"
target="_blank">
Open Public Node Info Page
</a>
</form>
</div>
</div>
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
}