Merge pull request 'Configure local LND as Lightning node in BTCPay Server' (#275) from feature/btcpay_lnd_settings into feauture/lnd

Reviewed-on: #275
This commit is contained in:
Râu Cao 2021-01-05 10:33:01 +00:00
commit 9ab097dd9a
2 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,7 @@ bash 'build_btcpay' do
cwd node['btcpay']['source_dir']
code './build.sh'
action :nothing
notifies :restart, "systemd_unit[btcpayserver.service]", :delayed
end
directory "/home/#{node['bitcoin']['username']}/.btcpayserver" do
@ -36,6 +37,8 @@ end
credentials = Chef::EncryptedDataBagItem.load('credentials', 'btcpay')
lnd_admin_macaroon_path = "#{node['lnd']['lnd_dir']}/data/chain/bitcoin/mainnet/admin.macaroon" rescue nil
template node['btcpay']['config_path'] do
source "btcpay-settings.config.erb"
owner node['bitcoin']['username']
@ -49,7 +52,9 @@ template node['btcpay']['config_path'] do
postgres_port: node['btcpay']['postgres']['port'],
postgres_database: node['btcpay']['postgres']['database'],
postgres_user: node['btcpay']['postgres']['user'],
postgres_password: credentials['postgres_password']
postgres_password: credentials['postgres_password'],
lnd_admin_macaroon_path: lnd_admin_macaroon_path
notifies :restart, "systemd_unit[btcpayserver.service]", :delayed
end
directory '/run/btcpayserver' do

View File

@ -2,7 +2,9 @@ network=<%= @bitcoin_network %>
port=<%= @btcpay_port %>
bind=127.0.0.1
chains=btc
BTC.explorer.url=<%= @nbxplorer_url %>
postgres=User ID=<%= @postgres_user %>;Password=<%= @postgres_password %>;Host=<%= @postgres_host %>;Port=<%= @postgres_port %>;Database=<%= @postgres_database %>;
debuglog=<%= @btcpay_log_path %>
<%# TODO BTC.lightning=type=clightning;server=/mnt/data/lightningd/lightning-rpc %>
BTC.explorer.url=<%= @nbxplorer_url %>
<% if @lnd_admin_macaroon_path %>
BTC.lightning=type=lnd-rest;server=https://127.0.0.1:8080/;macaroonfilepath=<%= @lnd_admin_macaroon_path %>;allowinsecure=true
<% end %>