Sphinx Chat Greenlight

Sphinx Chat Greenlight

What you need:

Raspberry Pi 4 or Zero 2 W

Micro SD Card (8GB min)

You do not need:

External hard drive

Getting Started

You will need 15 minutes to get your greenlight node online, and then wait around 90 minutes for your channel to be fully operational.
Once that is done, you’ll be able to use your sphinx chat app backed up by your greenlight node.

STEP 1 of 8
Grab our installer zip file from here. See the file integrity section below if you’d like to cross check this file.

Download Installer

STEP 2 of 8
Flash our installer onto your raspberry pi using your preferred method. We like to use the Raspberry Pi Imager, which you can download here.

Raspberry Pi Imager

2 A
First insert the SD Card you will use into your computer.

If your computer has an sd card slot, you’ll be able to insert it like this.

If your computer does not have an sd card slot, you’ll need a sd card adapter similar to this one, and plug it into your computer’s usb port.

2 B
Launch the Raspberry Pi Imager, and click on the button “CHOOSE OS”.

2 C
Scroll down through the options available, and select “Use custom”. Using the dialog that follows, select the image that you have downloaded in step 1.

2 D
Next, click on the button “CHOOSE STORAGE”.

2 E
Select the SD card you previously inserted into your computer.

2 F
Click on the button “WRITE”.

2 G
Ensure that you do not have any important information on the SD card as its contents are going to be COMPLETELY ERASED. Then click on the button “YES” in the pop-up that follows.

2 H
Wait for the image to be written to the SD Card.

2 I
Wait for the program to verify that the image has been written correctly to the SD card.

2 J
Click “CONTINUE”.

STEP 3 of 8
If you are connecting your raspberry pi wirelessly to your internet router, reinsert your SD card into your computer, and follow the instructions here to set up your raspberry pi’s connection.

3 A 
First, create an empty file at the base of the boot partition of the raspberry pi. The quickest way to do this in Linux / MacOS is to open a terminal, and use the command touch ssh while standing in the boot directory.

3 B
In that same directory, write a file called `wpa_supplicant.conf`, with the name of your Wifi, and the password. See the example below for the correct formatting. Also use the following country codes for these countries: United Kingdom – “GB”, France – “FR”, Germany – “DE”, United States – “US”, Sweden – “SE”.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=[Insert 2 letter ISO 3166-1 country code here]
update_config=1

network={
ssid=”[Name of your wireless LAN]”
psk=”[Password for your wireless LAN]”
}

STEP 4 of 8
Eject your sd card

STEP 5 of 8
Place your sd card into the raspberry pi, and plug the pi into a power source.

STEP 6 of 8
Wait around
5 minutes.

STEP 7 of 8
Please use Firefox for this step. If you are on Linux/MacOS load the page
http://raspberrypi.local:3001/connect and if you are on Windows, load the page http://raspberrypi:3001/connect. Follow the instructions there to open our channel with our routing node. You will need to wait around 90 minutes for your channel to be fully operational.

7 A
Once you’ve loaded the page at the link above, you should be greeted with this view. You should now click the “PEER NOW” button to peer with our routing node.

7 B
After a few seconds, you should see this view. You are now peered to our routing node, and we are initiating the channel open process.

7 C
After about a minute, you should see the txid of your channel funding transaction, along with an indicator of how many confirmations that transaction has received. You can look up your txid in any bitcoin blockchain explorer, and you’ll need 8 confirmations before your channel can be fully operational.

7 D
Once you see the view on the right, you are now connected to the lightning network.

STEP 8 of 8
Now switch to your phone, download the sphinx chat app here , and open it.

Download Sphinx

8 A
Click on “New user”.

8 B
Click on “I Have a Connection Code”.

8 C
Click “Continue”

8 D
Scan the QR code you got above with your smartphone camera.

8 E
Proceed with the rest of the onboarding.

When you can, SSH into your raspberry pi using the username pi and the password raspberry, and change the password with the command passwd

File Integrity

The sha256 of the zip file you will download from us is the following:

696f22cabe658a1a754315a1af39ed0d9471c7a480c4f40d1525bde50b911a88Copy

On macOS, you can check it by running this command in the directory where you have the file:

shasum -a 256 sphinx_greenlight_0_61.img.zip


Backing Up Your Funds and Data

All you need to do is backup the file home/pi/sphinx.db and the file home/pi/sphinx-relay/creds/hsm_secret

Unlike a lightning node, these files do not backup the state of your channels – they backup your sphinx chat data and the secret from which all your bitcoin keys are derived.

Using the app outside the home network

Here’s how you can connect your sphinx chat app to your raspberry pi at home.

  1. Before anything, note that your app talks to your raspberry pi over http. All message payloads are encrypted, but the metadata is sent in plaintext to sphinx-relay. So if you’d like to set up https, you can find instructions here.
  2. Tell your router to forward all traffic on port 3001 to your raspberry pi.
  3. Set up a dynamic DNS service and point it to your router. We like to use dynDNS.
  4. Go to the advanced page in your sphinx chat app, and point the server setting to the domain name provided by your dynamic DNS service.
  5. Done! Congratulations, you are now able to use your sphinx chat app wherever you go!
Community

Get your questions answered in the Greenlight Tribe right here!