interledgerjs / settlement-lightning

⚡️ Settle Interledger payments using the Lightning Network
Apache License 2.0
15 stars 4 forks source link

Clients cannot use non public lnd nodes #31

Closed rhuairahrighairidh closed 5 years ago

rhuairahrighairidh commented 5 years ago

Description

The current client plugin almost works out of the box with Zap Wallet's bundled lnd node. But requires a small change.

Zap's lnd node doesn't have an external ip address set. This doesn't stop it sending or receiving payments. But causes the plugin to error on connect.

It fails here: https://github.com/interledgerjs/ilp-plugin-lightning/blob/9efe1886b90aed5236e97fbb3ee77a1ddbb82031/src/account.ts#L265 Because uris field of getInfo is empty: https://github.com/interledgerjs/ilp-plugin-lightning/blob/9efe1886b90aed5236e97fbb3ee77a1ddbb82031/src/index.ts#L222

Possible fix

If the external ip isn't known, send just the lnd node's pubKey on connect (instead of the full pubKey plus host ip). Then don't add the client plugin's node as a peer.

Current workaround

  1. Get credentials for Zap's bundled lnd (on macOS):

    <wallet name> is usually wallet-1

  2. Create a channel in zap to the connector's lnd node.

  3. Add a lnd.conf file here ~/Library/Application Support/Zap/lnd/bitcoin/testnet/<wallet name>/lnd.conf with the following:

    [Application Options]
    externalip=<any random ip address>

(restart zap)