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

Support for LND@BTCPay Server #321

Open
petzsch opened this issue Sep 3, 2023 · 1 comment
Open

Support for LND@BTCPay Server #321

petzsch opened this issue Sep 3, 2023 · 1 comment

Comments

@petzsch
Copy link

petzsch commented Sep 3, 2023

While trying to help a BTCPay Server user run rebalance-lnd on their instance, we came across the following issue:

Here you expect a very specific path for the admin.macaroon, however it also loads the tls.cert from the lnd_dir :

with open(f"{lnd_dir}/data/chain/bitcoin/{network}/admin.macaroon", "rb") as f:

Here is the folder contents for btcpayserver's generated_lnd_bitcion_datadir volume:

root@cryptonode:/var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data# ls
admin.macaroon  invoice.macaroon  lnd.conf  readonly.macaroon  tls.key
data            letsencrypt       logs      tls.cert

if you try to find the admin.macaroon in data/chain/bitcoin/{network}/ you'll find the following:

root@cryptonode:/var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/data/chain/bitcoin/mainnet# ls -al
total 1484
drwx------ 2 root root    4096 Aug 30 17:39 .
drwx------ 3 root root    4096 Apr 16 10:07 ..
-rw-r--r-- 1 root root      83 Apr 16 10:08 chainnotifier.macaroon
-rw-r--r-- 1 root root      45 Aug 30 17:39 channel.backup
-rw-r--r-- 1 root root      91 Apr 16 10:08 invoices.macaroon
-rw------- 1 root root   20480 Aug 30 17:38 macaroons.db
-rw-r--r-- 1 root root      91 Apr 16 10:08 router.macaroon
-rw-r--r-- 1 root root      92 Apr 16 10:08 signer.macaroon
-rw------- 1 root root 1458176 Sep  3 15:45 wallet.db
-rw-r--r-- 1 root root     114 Apr 16 10:08 walletkit.macaroon
-rw-r--r-- 1 root root     274 Apr 16 10:07 walletunlock.json

To solve this, we would need a seperate config option to specifiy the admin.macroon file path, so that the rest still works.

Hope there is a simple solution to this problem.

@robwoodgate
Copy link

Assuming you found a solution by now... for anyone else, you can simply symlink the admin.macroon into the data/chain/bitcoin/mainnet directory.

cd /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/data/chain/bitcoin/mainnet
ln -s /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/admin.macaroon admin.macaroon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants