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

LNC-mobile: add support for multiple connections #6

Merged
merged 7 commits into from
Nov 17, 2022

Conversation

kaloudis
Copy link
Contributor

@kaloudis kaloudis commented Oct 20, 2022

lightning-node-connect commit: lightninglabs/lightning-node-connect@0ef6a51

@kaloudis kaloudis changed the title LNC: add support for multiple connections LNC-mobile: add support for multiple connections Oct 20, 2022
@kaloudis kaloudis force-pushed the lnc-multiple-connections branch 5 times, most recently from b613de7 to 9de15fe Compare October 25, 2022 05:03
@kaloudis kaloudis marked this pull request as ready for review October 25, 2022 05:03
@kaloudis kaloudis requested a review from jamaljsr October 25, 2022 05:04
@jamaljsr
Copy link
Member

I haven't been able to get the demo app to run on my machine. Even the old connect-demo in the main branch is broken. I've borked my machine somehow. I'm going to have to circle back to review this next week as I gotta focus on some TW stuff atm.

From skimming the code, the only thing that stood out to me was that "pnemonic" should be spelled "mnemonic".

@kaloudis kaloudis force-pushed the lnc-multiple-connections branch from 9de15fe to f80c6dd Compare October 27, 2022 21:18
@lightninglabs-deploy
Copy link

@jamaljsr: review reminder

Copy link
Member

@jamaljsr jamaljsr left a comment

Choose a reason for hiding this comment

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

tACK 🙌

Apologies on the delay, I had a bunch of trouble getting this running but finally was able to run the android app and connect to multiple nodes.

A few questions:

  1. Do you want me to also do a code review or were you just looking for functional review?
  2. Do you want me to test iOS as well or is that still WIP?
  3. Is it possible to use relative paths in the metro.config.js and package.json instead of hard-coding a path that only work on your machine (/Users/satoshi/Repos/lightninglabs/lnc-rn)? I keep forgetting to change this after switching branches.

@kaloudis
Copy link
Contributor Author

@jamaljsr

Thanks for testing

  1. A code review would be welcome
  2. iOS is still a WIP. I'll have you test those at a later date (hopefully soon)
  3. I'll look into using relative paths - it should be possible. When we publish the package we shouldn't need it defined in metro.config.js at all

@kaloudis kaloudis mentioned this pull request Nov 16, 2022
Comment on lines 8 to 11
@observable public lnc1: any;
@observable public lnc2: any;
@observable public info1: any;
@observable public info2: any;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why you use any here instead of the LNC and GetInfoResponse types?

Comment on lines 28 to 31
mnemonic1:
'drop sell moment shift doll pull october gold squeeze gas',
mnemonic2:
'prosper brother journey park peanut ten exact photo harbor picnic'
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to have these be entered by the user in the UI opposed to needing to change the hard-coded the values?

// only load if pairingPhrase is set
if (!pairingPhrase) return;
try {
const key = `${STORAGE_KEY}:${pairingPhrase}`;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's a good idea to store the pairing phrase as plain text in local storage. I always worry about devs seeing this and thinking it is safe to do in a real app. Couldn't we use the namespace as the storage key.

@kaloudis kaloudis requested a review from jamaljsr November 16, 2022 04:45
Copy link
Member

@jamaljsr jamaljsr left a comment

Choose a reason for hiding this comment

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

tACK LGTM 👍

Comment on lines +57 to +61
<TextInput
onChangeText={this.onChangeMnemonic1}
placeholder="Enter pairing mnemonic #1 here"
value={mnemonic1}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Ahhh.. I didn't even realize these were inputs that I could modify in the UI. This makes it much clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback!

@kaloudis kaloudis merged commit eec10dd into main Nov 17, 2022
@kaloudis kaloudis deleted the lnc-multiple-connections branch November 17, 2022 00:02
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.

3 participants