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

Add Bluewallet LNDHub #472

Merged
merged 14 commits into from
May 11, 2021
Merged

Add Bluewallet LNDHub #472

merged 14 commits into from
May 11, 2021

Conversation

maltokyo
Copy link
Contributor

@maltokyo maltokyo commented May 1, 2021

Bluewallet LNDHub additional fragment:
Use non-custodial LND Lightning directly from your Bluewallet, and freely let others open accounts on your node.

@NicolasDorier I think there was some discussion on this, would it be appreciated? I will need some help with TOR activation and creating some variables and in general making this BTCPay friendly, etc if so. I was busy for the last months, but want to get back into BTCPay contributions now.

@Kukks I think you were looking at lnbits instead, but I personally use Bluewallet and I am not sure if they complement each other, or will clash? Please provide your view.

Anyone else want to use native Bluewallet Lightning with their BTC Pay Server, this will enable it.
Use non-custodial LND Lightning directly from your Bluewallet, and freely let others open accounts on your node.
@maltokyo
Copy link
Contributor Author

maltokyo commented May 1, 2021

Can someone help to figure out the #need help here as the official docker image from bluewalletorganization uses a user called lndhub part in the code above? The official container uses a user called lndhub, which doesnt have read access to the LND admin.macaroon unless I add user: "0:0"

@dennisreimann
Copy link
Member

For reference: Prior discussion around the general topic in btcpayserver/btcpayserver#204

Copy link
Member

@Kukks Kukks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the docker compose version to match the existing ones?

Is it tested and working?

@maltokyo maltokyo requested a review from Kukks May 5, 2021 09:50
@maltokyo maltokyo changed the title Add Bluewallet LNDHub to BTCPay Server Add Bluewallet LNDHub and mempool.space to BTCPay May 5, 2021
@maltokyo
Copy link
Contributor Author

maltokyo commented May 5, 2021

Oops when I added mempool.space locally, with the intention to create a separate PR, it added it here to this one. Not sure how to avoid that, anyway, I think we can add both these with one PR, hope it is fine?

@maltokyo maltokyo changed the title Add Bluewallet LNDHub and mempool.space to BTCPay Add 2 new features 1. Bluewallet LNDHub and 2. mempool.space to BTCPay May 5, 2021
@dennisreimann
Copy link
Member

Can you roll that back and open a separate PR? We should not mix those two concerns.

@maltokyo
Copy link
Contributor Author

maltokyo commented May 5, 2021

Can you roll that back and open a separate PR? We should not mix those two concerns.

Embarrasingly, I am not sure how to do that. Two of the files are the same between both PRs. I am editing locally my fork, and just saving, and it was "auto-added" to this PR..

@Zaxounette
Copy link
Contributor

Embarrasingly, I am not sure how to do that. Two of the files are the same between both PRs. I am editing locally my fork, and just saving, and it was "auto-added" to this PR..

Do you need to be walked through ?
I can take the time if you need.
PM me in the chat.btcpayserver.org to get into a call. Same name.

@dennisreimann
Copy link
Member

@maltokyo Here's how you can do it:

  1. Create another branch based on the current state - this can act as a backup
  2. Switch back to the branch for this PR
  3. git reset 5f00aea3ea02b406d09c26292ea6d3e90a257ff8 should give you the previous state
  4. git push --force to update the PR with the previous state

Now the PR should be ok again.

  1. Switch back to master and create a new branch for the mempool PR
  2. Prepare the mempool PR and push it to a different remote branch
  3. Open new PR for mempool integration

@dennisreimann
Copy link
Member

Cool, now the only thing that needs to be cleaned up is the conflict in the nginx template. I think it is there because kukks just merged the Sphinx PR and it also contained changes in that file.

@maltokyo
Copy link
Contributor Author

maltokyo commented May 5, 2021

ok Ill wait for this one to be merged first, then do mempool after that

@dennisreimann I don't know how to resolve that conflict. When I click resolve conflict here on the web version, I don't have any buttons that I can press on the following screen. It says that only people with write access to the repo can resolve that. Could you please help?

@maltokyo maltokyo changed the title Add 2 new features 1. Bluewallet LNDHub and 2. mempool.space to BTCPay Add Bluewallet LNDHub May 5, 2021
@maltokyo
Copy link
Contributor Author

maltokyo commented May 6, 2021

@dennisreimann @Kukks - please let me know if anything else.

If anyone else is keen to test, that is cool too

Copy link
Member

@dennisreimann dennisreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing

I just tried to run it with the latest btcpayserver-docker installation. If someone else also wants to give it a try, you can deploy it as a custom fragment:

  • SSH into your BTCPay Server and go to the main BTCPay Server directory (where the btcpay-setup.sh script is located)
  • Create the file docker-compose-generator/docker-fragments/opt-add-bluewallet-lndhub.custom.yml with the content of opt-add-bluewallet-lndhub.yml from this PR
  • Add the diff snippet from Production/nginx.tmpl to the Production/nginx.tmpl file on your server
  • Run the following commands:
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="$BTCPAYGEN_ADDITIONAL_FRAGMENTS;opt-add-bluewallet-lndhub.custom"
. ./btcpay-setup.sh -i

Once the setup is done you can check the container log using docker logs -f generated_bluewallet_lndhub_app_1.

Review

Here's what I came across with the current state:

ERROR: The Compose file '/root/btcpayserver/btcpayserver-docker/Generated/docker-compose.generated.yml' is invalid because:
Unsupported config option for services.bluewallet_lndhub_app: 'init'
Unsupported config option for services.bluewallet_lndhub_redis: 'init'

Once you remove the init: true lines from the fragment it downloads and installs the container.

One more thing I noticed: You should add the docker info to the support table.

Remove init (not compatible with v3 of docker-compose)

Update compatibility table
@maltokyo
Copy link
Contributor Author

maltokyo commented May 7, 2021

Thank you @dennisreimann - both fixed. Indeed, init is not compatible with docker-compose v3, and compatibility table updated

@dennisreimann
Copy link
Member

My guess is that it assumes to be deployed at the root instead of a subdirectory. Unfortunately I can't test it, because I'm still struggling to get the container installed (as said that's on my side), but I assume that your problem might be fixable by fiddling with the proxy_pass URI, like removing the trailing slash proxy_pass http://bluewallet_lndhub_app:3000;

@maltokyo
Copy link
Contributor Author

maltokyo commented May 7, 2021

Finally got it! Thanks for the tip. Not sure if that's the correct way, but this now worked. WIth the exception of TOR, everything is done!

image

I think it is ready for merging, but that is up to you guys @dennisreimann @Kukks - thanks for help as always.

@dennisreimann
Copy link
Member

Awesome, congrats, that's very cool! 👍

Copy link
Member

@Kukks Kukks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tor support, it should be automatic (your own onion URL for btcpay +/bluewallet_lndhub_app/)

Production/nginx.tmpl Outdated Show resolved Hide resolved
Production/nginx.tmpl Outdated Show resolved Hide resolved
Copy link

@Overtorment Overtorment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor Author

@maltokyo maltokyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennisreimann any ideas?

Production/nginx.tmpl Outdated Show resolved Hide resolved
@maltokyo maltokyo requested a review from Kukks May 9, 2021 10:36
Copy link
Member

@dennisreimann dennisreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it now works for me as well. One thing I noticed is that I can access the LNDhub app without being logged in to BTCPay. Is it supposed to work that way?

@maltokyo
Copy link
Contributor Author

Yes, good observation @dennisreimann - and yes that is how it is supposed to work. It is an open page, for anyone (friends and family) to deposit on-chain BTC to set up a wallet, while the owner of the server takes all the heavy lifting of setting up channels and managing liquidity, etc. The worst that can happen is that some random person sends you some BTC on-chain... ;)

You can see, Bluewallet themselves leave this page completely open: http://lndhub.io/ - if you trust them with your BTC, you can open a lightning wallet there, and use their liquidity and channels as your own.

@maltokyo
Copy link
Contributor Author

@Kukks - please let me know if anything from your side. I think it is good to go

Copy link
Member

@Kukks Kukks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor last bits

README.md Outdated Show resolved Hide resolved
@maltokyo
Copy link
Contributor Author

All done

@Kukks
Copy link
Member

Kukks commented May 11, 2021

fixed up the last bits (you should check what I did for future features @maltokyo @dennisreimann )

@Kukks Kukks merged commit 420ae32 into btcpayserver:master May 11, 2021
@maltokyo
Copy link
Contributor Author

Thanks Kukks!! Appreciate that, and learned for next one

@dennisreimann
Copy link
Member

@Kukks Thanks, I didn't know about the script part :)

@Kukks
Copy link
Member

Kukks commented May 11, 2021

@Kukks Thanks, I didn't know about the script part :)

Yes, it's a pretty awesome feature where you actually don't trust the built images and build everything you use yourself!

@godSaysHODL
Copy link

This is HUGE! Does each store have it's own LNDhub account? Will be incredible for onboarding local businesses using my node! This is the dream!

@maltokyo
Copy link
Contributor Author

Anyone can make an account on it. They have to send you on chain BTC first.

@Kukks
Copy link
Member

Kukks commented May 13, 2021 via email

@jonathanalevi
Copy link

Worth noting that LNDHub accounts are NOT supported inside BTCPay Stores. That requires additional dev work.

This will be huge. I went ahead and set up a full node b/c I couldn't find a way to accept Lightning without doing so on a hosted btcpay box, but most people won't do that. We could get so many more businesses on LN if all they had to do was set up a wallet on a smartphone app!

@dennisreimann
Copy link
Member

@entreprenewer we are currently in the process of making LNbank a BTCPay Server plugin. It will enable this kind of functionality. https://github.com/dennisreimann/btcpayserver-lnbank

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

Successfully merging this pull request may close these issues.

7 participants