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 zap ios guide #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added raspibolt/images/72_zapios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added raspibolt/images/72_zapios_scan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added raspibolt/images/72_zapios_succesful.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions raspibolt/raspibolt_60_bonus.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ The Zap desktop app (https://github.com/LN-Zap/zap-desktop) is a cross platform

![Zap Desktop](images/71_zap1_cropped.png)

## [**Zap iOS Lightning Wallet**](raspibolt_72_zap-ios.md)

*Difficulty: medium*

The Zap iOS app (https://zap.jackmallers.com) provides a neat interface for the RaspiBolt to manage peers & channels, make payments and create invoices.

![Zap iOS](images/72_zapios.png)

## [**Shango Mobile Wallet**](raspibolt_68_shango.md)

*Difficulty: intermediate*
Expand Down
98 changes: 98 additions & 0 deletions raspibolt/raspibolt_72_zap-ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[ [Intro](README.md) ] -- [ [Preparations](raspibolt_10_preparations.md) ] -- [ [Raspberry Pi](raspibolt_20_pi.md) ] -- [ [Bitcoin](raspibolt_30_bitcoin.md) ] -- [ [Lightning](raspibolt_40_lnd.md) ] -- [ [Mainnet](raspibolt_50_mainnet.md) ] -- [ [**Bonus**](raspibolt_60_bonus.md) ] -- [ [Troubleshooting](raspibolt_70_troubleshooting.md) ]

------

### Beginner’s Guide to ️⚡Lightning️⚡ on a Raspberry Pi

------

## Bonus guide: Zap iOS Lightning Wallet
*Difficulty: medium*

This guide describes how to use Zap iOS from within your own network, the same that also connects your RaspiBolt.

![Zap iOS](images/72_zapios.png)

Zap is a free Lightning Network wallet focused on good user experience and ease of use. It is in alpha testing, so **use it at your own risk**. You can find more details in the [Zap iOS GitHub repository](https://github.com/LN-Zap/zap-iOS). If you find bugs, you can contribute to this project by [reporting issues](https://github.com/LN-Zap/zap-iOS/issues).

### Preparation on the RaspiBolt

#### Prepare LND Node for gRPC access
First we make sure that LND is listening for connections from other computers on the gRPC interface.

* Login as user "admin"

* Allow connections to the RaspiBolt from your own network. Check how the ip address of your Pi is starting with, eg. 192.168.0 or 192.168.1 , and use the address accordingly. Ending with .0/24 will allow all IP addresses from that network.

Add the following lines to the section `[Application Options]`:
`$ sudo nano /home/bitcoin/.lnd/lnd.conf`
```
rpclisten=0.0.0.0:10009
tlsextraip=0.0.0.0
```

* Delete tls.cert (restarting LND will recreate it):
`$ sudo rm /home/bitcoin/.lnd/tls.*`

* Restart LND :
`$ sudo systemctl restart lnd`

* Copy the files `tls.cert` and `lnd.conf` to user "admin", as it is needed for lncli:
```
$ sudo cp /home/bitcoin/.lnd/{tls.cert,lnd.conf} /home/admin/.lnd
$ sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon /home/admin/.lnd/data/chain/bitcoin/mainnet
```

* Unlock wallet
`$ lncli unlock`

* Allow the ufw firewall to listen on 10009 from the LAN:
`$ sudo ufw allow from 192.168.0.0/24 to any port 10009 comment 'allow LND grpc from local LAN'`

* restart and check the firewall:
`$ sudo ufw enable`
`$ sudo ufw status`

#### Install LND Connect
The nifty helper tool LND Connect helps to pair the RaspiBolt with the iPhone, encoding connection and authorization information either into a QR code or a connection string.

* As user "admin", download, extract and install the current release from the [release page](https://github.com/LN-Zap/lndconnect/releases).
```
$ cd /tmp
$ wget https://github.com/LN-Zap/lndconnect/releases/download/v0.1.0/lndconnect-linux-armv7-v0.1.0.tar.gz
$ sudo tar -xvf lndconnect-linux-armv7-v0.1.0.tar.gz --strip=1 -C /usr/local/bin
```
* Display the help page to make sure it works.
```
$ lndconnect -h
```

### Connect Zap iOS to your RaspiBolt

* Now simply run lndconnect to generate the QR code we’ll scan from our iPhone
```
$ lndconnect --lnddir=/home/admin/.lnd -i
```
Depending on your screen size use `CMD`+`+` and `CMD`+`-` to adjust the size of the QR code.

* If you can't resize the QR code or have visualization problems, you can
* add the option `-j` to the above command and generate a code you can copy/paste into the app
* or use the option `-o` to write the QR code into a PNG image.

See https://github.com/LN-Zap/lndconnect for more details.

* Open the Zap iOS on your phone.

* Scan the QR code and check/modify the ip address you want to use to connect. It should be something like `192.168.x.x`.
![Zap IOS scan example](images/72_zapios_scan.png)

* A successful connection will take you into the Zap iOS application:
![Zap iOS succesful example](images/72_zapios_succesful.png)

⚠️ REMEMBER: If you change `lnd.conf` you need to delete & recreate the `tls.cert`, and also re-create and re-scan the QR code from the Zap iOS app. Do not forget to copy the new `tls.cert` and `admin.macaroon` files to the admin user.

👉 It is perfectly possible to use Zap iOS on-the-go (from the public internet) and connect to your node at home, but this involves creating new TLS certificates and reduces security. You need to set `tlsextraip=<YOUR_PUBLIC_IP>` and allow the ufw firewall to listen on 10009 from everywhere.

------

<< Back: [Bonus guides](raspibolt_60_bonus.md)