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 Lightning Loop functionality #226

Closed
wants to merge 34 commits into from
Closed

Add Lightning Loop functionality #226

wants to merge 34 commits into from

Conversation

reemuru
Copy link
Contributor

@reemuru reemuru commented Jul 1, 2019

Closes #225

Description

This PR attempts to address inbound liquidity issues by adding support for "Looping Out/In" to an off-chain address. The default address will be the lnd wallet address. The plan is to add a loop-http library similar to the lnd-http lib implementation. Will update as necessary pending changes to the lightning labs loop repo.

LND 0.7.0
Loop 2.2

Steps to Test

  1. Install Loopd
  2. View error handling for incorrect URL / Set correct Loop URL
  3. View loop out terms (popover on advance settings buttons)
  4. View Loop Out/In Quote
  5. Attempt Loop Out/In to off-chain address (default LND wallet)
  6. Use 'Loop Monitor' in terminal to check status
  7. Default/Advanced User settings
  8. Verify password before quote -> loop out/in

Screenshot

image

@wbobeirne
Copy link
Member

Whoa, this is awesome. Great start! I'll keep an eye on this as you progress, but my main piece of feedback so far would be to make sure that loop stays an optional addition to Joule. A lot of people won't have loop running, and the eventual support of non-LND nodes means they won't have loop either. Right now the current implementation looks like it alters a lot of method signatures and validation checks to require a functioning loop server. Ideally it would only ask you to configure your loop server when you go to actually use the feature.

I'm really looking forward to seeing how this goes!

@reemuru
Copy link
Contributor Author

reemuru commented Jul 7, 2019

Thanks @wbobeirne! Good catch! I started to refactor so that the URL for Loop will be set optionally. Still need to add some snackbars so the user knows the URL was set successfully. Will try to finish adding the actual Loop out functionality tomorrow.

@reemuru
Copy link
Contributor Author

reemuru commented Jul 9, 2019

Getting close. Was able to attempt initiate a swap but it failed and Joule crashed too (T_T)

@reemuru
Copy link
Contributor Author

reemuru commented Jul 10, 2019

image

image

@reemuru
Copy link
Contributor Author

reemuru commented Jul 15, 2019

Initiated default loop out from Joule. Will add advanced features for the Loop Out form.

image

@reemuru reemuru changed the title [WIP] Add Lightning Loop Out functionality Add Lightning Loop Out functionality Jul 19, 2019
@reemuru reemuru changed the title Add Lightning Loop Out functionality [WIP] Add Lightning Loop Out functionality Aug 3, 2019
@reemuru reemuru changed the title [WIP] Add Lightning Loop Out functionality [WIP] Add Lightning Loop functionality Aug 3, 2019
@reemuru
Copy link
Contributor Author

reemuru commented Aug 5, 2019

Added support for Loop In. Will create a separate PR for Loop Monitor. Need loop monitor to support synchronous requests with JSON array value.

image

@reemuru reemuru changed the title [WIP] Add Lightning Loop functionality Add Lightning Loop functionality Aug 7, 2019
@reemuru
Copy link
Contributor Author

reemuru commented Aug 7, 2019

Yo @wbobeirne check it out and let me know what you think!

@wbobeirne
Copy link
Member

Traveling for the next week but excited to see where it's at. Thanks for all of the hard work!

@wbobeirne wbobeirne self-requested a review August 15, 2019 13:46
Copy link
Member

@wbobeirne wbobeirne left a comment

Choose a reason for hiding this comment

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

This is dope! Unfortunate that loop will require a new release for those RPCs, but I was able to get it working.

Dropped a good bit of feedback, sorry if it's a lot. I'd be happy to pitch in to help get this one out, especially since I'd like to do a good number of tweaks to the form itself.

The last note that I didn't add in code is that we should be saving the loop URL to browser storage. Most people will probably set this up once, and to have to keep re-entering the URL is a little annoying. Let me know if you need some help to point where that gets done.

src/app/components/Loop/InputLoopAddress.tsx Show resolved Hide resolved
src/app/components/Loop/InputLoopAddress.tsx Outdated Show resolved Hide resolved
src/app/components/Loop/QuoteModal.tsx Outdated Show resolved Hide resolved
src/app/components/Loop/QuoteModal.tsx Outdated Show resolved Hide resolved
src/app/components/Loop/QuoteModal.tsx Show resolved Hide resolved
src/app/modules/loop/reducers.ts Outdated Show resolved Hide resolved
src/app/modules/loop/reducers.ts Outdated Show resolved Hide resolved
src/app/modules/loop/reducers.ts Outdated Show resolved Hide resolved
src/app/modules/loop/sagas.ts Outdated Show resolved Hide resolved
src/app/lib/loop-http/index.ts Show resolved Hide resolved
@reemuru
Copy link
Contributor Author

reemuru commented Aug 18, 2019

Thanks for the review! Submitted all the recommended changes on one big commit. If you're able to take it from here and work your magic it would be much appreciated. I'm learning a lot! Hope those API changes make it to the next loop release. I will continue learning Go and gRPC so I can work more on loop and lnd. Nice working with you!

EDIT: I figured and how to sync the URL for loop so you don't have to keep putting in. That was pretty annoying!

@wbobeirne
Copy link
Member

Great work. I'm getting started on a bit of refactoring, will have you review when I'm done. Looking forward to getting this live 🔥

I'll open a new PR for that, so I'm going to close this one for the time being just to make sure no new work or reviews end up on this branch that I have to merge back into the one I'm working on.

@wbobeirne wbobeirne closed this Aug 19, 2019
@wbobeirne wbobeirne mentioned this pull request Sep 9, 2019
1 task
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.

Add Support for Lightning Loop
2 participants