How To Make Your Bitcoin Lightning Network Node Mobile

2 years ago

Now you tin instrumentality the Bitcoin Layer 2 implementation wherever you go, giving you the quality to transmit sats everywhere!

This is an sentiment editorial by Anthony Feliciano, a Bitcoin events organizer and contributor astatine Bitcoin Magazine.

This nonfiction is simply a travel up to a erstwhile nonfiction I wrote, talking astir antithetic types of Lightning nodes. I volition beryllium expanding connected the RaspiBlitz Lightning Network node. I won't beryllium going into the galore different options and features of what RaspiBlitz offers, but this is simply a unsocial twist.

This task started 4 years agone erstwhile I was sitting successful my apartment, midday, and the powerfulness abruptly went out. The archetypal happening that goes done a mean person's mind, is “damn it, power’s retired — I wonderment however agelong is it going to instrumentality and bash I request to commencement looking successful the fridge to perchance BBQ what mightiness defrost?”

Not me! I instantly thought, “MY LIGHTNING NODE!” Long communicative short, the powerfulness was lone retired for a mates of hours. But astatine that clip it got maine thinking, if thing similar this happens again, what tin I do?

What manifested adjacent was a task that followed maine mounting up a RaspiBlitz LN node. That task being to fig retired a mode to support the LN node moving erstwhile powerfulness and net goes out.

The issues to lick for:

  1. Power — what tin I usage to support the LN node moving during the adjacent powerfulness outage?
  2. Internet — however bash I support the LN node connected to the net to support LN sync’d ?
  3. Mobility — what if determination was a occurrence oregon exigency and I had to leave, taking lone what I tin carry?

Power

If you work done the issues, you yourself are astir apt already besides reasoning astir solutions. The archetypal occupation is casual to lick - get an uninterruptible powerfulness proviso (UPS) arsenic a backup. Makes consciousness right? If the powerfulness goes out, UPS kicks connected and keeps the device’s powerfulness connected with nary issues. Only follow-up question is, however agelong bash you need? There are galore UPSs connected the marketplace providing powerfulness for immoderate fig of hours, truthful astatine that constituent it becomes a substance of penchant and budget. I went for an astir two-hour powerfulness proviso UPS model. At the clip I had nothing, truthful this was inactive caller to maine and had ne'er crossed my mind. While not the longest complaint oregon astir almighty UPS retired there, the UPS I selected lone provides backup powerfulness to my LN node and my router; if I suffer internet, I tin inactive support my router powerfulness going and link via a Secure Shell (SSH) terminal to my devices connected the network. First occupation solved.

Internet

**Note** The pursuing solution is based upon if you are utilizing a WiFi setup to statesman with. If you are utilizing the Ethernet cable, you tin inactive adhd the WiFi web arsenic a backup from the steps below. Also, if you support your router powered up by a UPS, this doesn't ever mean you suffer net successful a powerfulness outage, arsenic this volition beryllium upon whether your supplier is affected arsenic well. This method is for a greater country powerfulness outage oregon exigency situation, and volition lend to solving the 3rd occupation — mobility.

Internet And Maintaining Connectivity

While everyone worries astir power, and rightfully so, galore hide the 2nd astir important portion — the net connection. How bash I support this instrumentality connected if determination is simply a powerfulness outage? Easy — this is erstwhile I started researching; thankfully due to the fact that I americium utilizing a Raspi 4 that comes with built-in WiFi, with a elemental configuration of the WiFi record you tin adhd a 2nd WiFi network.

How To Setup A Second Network On Your Raspi:

Head implicit to this leafage for much info: Set up WiFi connected Raspi

This is the enactment of codification you are looking for:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

**NOTE** If you are not utilizing WiFi and alternatively are utilizing RJ45 (Ethernet) your wpa_supplicant.conf record mightiness not person this codification astatine the top; if it is missing adhd it:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=US - **Change your state codification if extracurricular the United States**

To participate this code, exit retired of your RaspiBlitz paper to the terminal screen, which should look similar this:

admin@NODEIPADDRESS:~ $

Enter the codification to look similar this below:

admin@NODEIPADDRESS:~ $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

I won't beryllium showing my configuration, but you volition spot your setup erstwhile you unfastened the file. I took this from the “Set up WiFi connected Raspi” nexus above. 

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=US

network={

ssid="SchoolNetworkSSID"

psk="passwordSchool"

id_str="school"

}

network={

ssid="HomeNetworkSSID"

psk="passwordHome"

id_str="home"

}

What you volition spot connected your record is your WiFi web that you already use. What you are adding is that 2nd network. So what is your 2nd network? I mean however galore WiFi spots tin you link to? Do you cognize the SSID (service acceptable identifier) and the password to link to them? In my instance, I utilized my cellphone’s hotspot. That's right, you tin usage your cellphone arsenic a hotspot to enactment arsenic WiFi, truthful that your LN node tin link to it. So for the 2nd web connected the list, I entered my SSID and the password that is fixed by my cellphone hotspot feature.

Question — but what if I usage my cellphone hotspot? How volition I cognize the IP code to link to it? Don’t worry, I’ve got you covered with that arsenic well. On your telephone (I usage Android) download an app called Termius which acts similar a SSH terminal from your cellphone to your LN device.

**Note** If you person a surface connected your RaspiBlitz, the IP code to link to volition amusement up determination arsenic well, which means you entered the 2nd WiFi web correctly and your telephone and instrumentality are communicating.

**Note** If you tally your instrumentality headless (no screen) similar I do, past you person to get the IP address, from “connected device” information, a measurement that I sermon below

Termius App

Steps: Due to information argumentation I can't instrumentality screenshots to amusement however to acceptable up the app connected your phone, but I tin usher you.

  1. Open the app
  2. Click “+” - New Host
  3. Fill retired the info - Alias (name for the connection)
  4. Hostname oregon IP Address: you volition get this IP code erstwhile your node connects to your cellphone hotspot. I'll amusement however to get this later.
  5. Make definite “SSH” container is checked.
  6. User name: for RaspiBlitz users the idiosyncratic sanction is “admin” but if you changed it to thing else, past it is immoderate you called it,.
  7. Password: DON'T ENTER A PASSWORD! If you participate it, it volition automatically connect, which is simply a information flaw if idiosyncratic gets into your phone. Leave it blank erstwhile you click connected the alias name, it volition inquire you for the password of your instrumentality to link to.
  8. Click the cheque people astatine apical to adhd the caller connection.
  9. When you marque your archetypal SSH transportation into the instrumentality it volition inquire you to judge the fingerprint to bash so. Click “Yes.”

Below is simply a screenshot of what this each looks like:

As you tin see, I'm connected my compartment telephone hotspot.

My WiFi web is “Gopoundsand” on with the password provided (psk), which I entered arsenic the 2nd WiFi network.

network={

ssid="Gopoundsand"

psk="passwordHome"

id_str="home"

}

If you spot connected devices (your LN node name) that means you successfully acceptable up the sudo nano /etc/wpa_supplicant/wpa_supplicant.conf correctly and your instrumentality is present WiFi connected to your cellphone and the internet. Congratulations connected making it this far!

**Note** Make definite your archetypal transportation if you usage Ethernet is unplugged, oregon if you usage WiFi, arsenic your main connection, that it is turned off. For erstwhile you reboot, the instrumentality volition fastener onto your main WiFi web and won't look for your 2nd connection. This volition instrumentality a fewer minutes connected reboot to found a connection.

You tin present spell to mobile hotspot from settings and spot connected devices oregon swipe down from the notification bar, similar shown supra to spot connected devices. Now click connected “details” of the connected device, and “details” again. This is wherever you volition spot the IP code fixed from your cellphone to the device. (Example: 192.168.200.102.) That accusation volition present spell into the Termius app: Hostname oregon IP Address: you volition get this IP code erstwhile your node connects to your cellphone hotspot.

If you managed to bash everything correctly past you should get to this spot successful the screenshot:

This is the paper surface of the RaspiBlitz, connected my Android telephone with Termius app.

If you managed to get done each the steps, past you person successfully added a 2nd WiFi web to your sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, managed to get the LN node to link to your cellphone via hotspot and were yet capable to SSH into your instrumentality and get your LN node to resync implicit cellular and entree the RaspiBlitz paper arsenic seen successful the screenshot supra you. Congratulations, you are going to marque it!

Tips if thing fails to connect:

  1. Make definite the SSID and password are close successful the sudo nano /etc/wpa_supplicant/wpa_supplicant.conf file. Ctrl+x to exit, “y” to prevention the record if the info is correct. Or “n” if you mistyped something.
  2. When rebooting the LN node, to link to your compartment telephone hotspot, past springiness it a fewer minutes to found that connection. So don't fearfulness you did thing incorrect - if it takes implicit 5 minutes, past it's astir apt worthy troubleshooting.
  3. Make definite your archetypal transportation if you usage Ethernet is unplugged, oregon if you usage WiFi, arsenic your main connection, that it is turned off. For erstwhile you reboot, the instrumentality volition fastener onto your main WiFi web and won't look for your 2nd connection.
  4. On SSH via terminal, marque definite you person the close IP code from your hotspot. And adhd that info to the caller big connection. (Side note: connected immoderate devices similar mine, everytime I turned disconnected and turned connected the hotspot, I got a caller IP address, truthful I person to “edit transportation alias” successful the app with the caller IP address, and SSH volition reconnect.

Mobility

We yet travel to the past step. What if determination is simply a large emergency, a occurrence oregon accidental conscionable a vacation, and you had to instrumentality lone what you could and go? Could you instrumentality your LN node with you? How would you bash it? If you went with a moderately-sized UPS, you tin ever drawback that and go, arsenic it provides a fewer hours needed to support your portion going until you tin get to a much unchangeable setup. Lets say, your UPS is large and chunky, and taking it with you is conscionable not feasible. I thought astir that arsenic well, and decided to spell with a 28800mAH star backup charger, fundamentally what you could usage to complaint your compartment phone. Why is this handy? Because it's small, light, and versatile. The portion besides has uses (usb-c connector) for partition charging the unit. But much importantly, the star charger provides the powerfulness (3Amp) indispensable to powerfulness up your instrumentality including the outer SSD.

Tips:

  1. You can't wall-charge the backup charger portion trying to powerfulness up the LN device; it didn't termination the Pi, conscionable stopped it from working. I pulled the power, waited immoderate time, and rebooted backmost up.
  2. You can't usage some USB ports to link to your Raspi USB ports. That volition fry your board: So yea, I killed my board. Thankfully it was conscionable the board, which was lone a $35 replacement.

To sum it up, I larn done proceedings and error. Hope you had a laughter astir it but hopefully it helps idiosyncratic debar unnecessary stress.

This is the extremity effect (photo taken astatine a authorities parkland successful the Rocky Mountains):

Conclusion

This tin beryllium a play task for you. If you are already moving a node and consciousness similar getting a spot #reckless this is simply a amusive mode to grow your applications and skills. Even if you don't bash it this nonstop way, I anticipation this inspired you to deliberation of a much originative mode to lick the problems that I experienced.

Now spell beryllium #reckless.

This is simply a impermanent station by Anthony Feliciano. Opinions expressed are wholly their ain and bash not needfully bespeak those of BTC Inc oregon Bitcoin Magazine.

View source