Browse Source

merged master v1.1 release

dev
Christian Rotzoll 6 years ago
parent
commit
07eac2ca58
  1. 173
      FAQ.md
  2. 44
      README.md
  3. 90
      build_sdcard.sh
  4. 14
      home.admin/00infoBlitz.sh
  5. 30
      home.admin/00infoLCD.sh
  6. 91
      home.admin/00mainMenu.sh
  7. 20
      home.admin/00settingsMenuServices.sh
  8. 5
      home.admin/10setupBlitz.sh
  9. 20
      home.admin/40addHDD.sh
  10. 55
      home.admin/50copyHDD.sh
  11. 18
      home.admin/50torrentHDD.sh
  12. 32
      home.admin/97addMobileWalletZap.sh
  13. 12
      home.admin/XXdebugLogs.sh
  14. 31
      home.admin/_background.sh
  15. 18
      home.admin/_bootstrap.provision.sh
  16. 35
      home.admin/_bootstrap.sh
  17. 2
      home.admin/_version.info
  18. 2
      home.admin/assets/RTL.service
  19. 2
      home.admin/assets/bitcoind.service
  20. 1
      home.admin/assets/bootstrap.service
  21. 2
      home.admin/assets/lnd.bitcoin.conf
  22. 2
      home.admin/assets/lnd.litecoin.conf
  23. 2
      home.admin/assets/lnd.service
  24. 35
      home.admin/config.scripts/bonus.rtl.sh
  25. 6
      home.admin/config.scripts/lnd.newtlscert.sh
  26. 151
      home.admin/config.scripts/lnd.rescue.sh
  27. BIN
      pictures/logoraspiblitz.png
  28. BIN
      raspiblitz-v1.1-2019-03-18.torrent
  29. 2
      shoppinglist_au.md
  30. 2
      shoppinglist_ca.md
  31. 4
      shoppinglist_cz.md
  32. 2
      shoppinglist_de.md
  33. 2
      shoppinglist_es.md
  34. 2
      shoppinglist_fr.md
  35. 2
      shoppinglist_uk.md
  36. 2
      shoppinglist_usa.md

173
FAQ.md

@ -1,27 +1,62 @@
# FAQ - Frequently Asked Questions
## How do I generate a Debug Report?
## Whats new in Version 1.1 of RaspiBlitz?
If your RaspiBlitz is not working right and you like to get help from the community, its good to provide more debug information, so other can better diagnose your problem - please follow the following steps to generate a debug report:
Version 1.1 packs some first fixes and enhancements to make the RaspiBlitz more stable, protect HDD data better and support you better in case of data corruption of the blockchain data.
- ssh into your raspiblitz as admin user with your password A
- If you see the menu - use CTRL+C to get to the terminal
- To generate debug report run: `./XXdebugLogs.sh`
- Then copy all output beginning with `*** RASPIBLITZ LOGS ***` and share this
- Update: RTL (Ride the Lightning) Web UI version 0.2.15-beta
- Fix: Preventing logs from filling up the sd card
- Fix: Pairing for latest Zap iOS Mobile Wallet
- Fix: Pairing for latest Shango Mobile Wallet
- Fix: Open LND port check when custom port
- New: Undervoltage Reports on LCD
- New: fsk (file system consistency check) of HDD on every boot
- New: Repair Help Menu in case if blockchain data corruption
- New: /config.scripts/lnd.setport.sh (set custom LND port)
- New: /config.scripts/lnd.rescue.sh (backup/replay LND data)
- New: Bootscreen with logo
- Removed: FTP download option for blockchain
*PLEASE NOTICE: Its possible that this logs can contain private information (like IPs, node IDs, ...) - just share publicly what you feel OK with.*
For full details see issue list of [Release 1.1 Milestone](https://github.com/rootzoll/raspiblitz/milestone/3?closed=1).
Instructions on how to update see FAQ info below.
## How to update my RaspiBlitz (AFTER version 0.98)?
To prepare the RaspiBlitz update:
For update you dont need to close any channels, remove funding or download the blockchain again.
Simply [Ddwnload the new RaspiBlitz SD card image](https://github.com/rootzoll/raspiblitz#installing-the-software) to your laptop and have an sd card writer ready. Then login into your RaspiBlitz with SSH and:
- main menu > OFF
- remove power
- remove SD card
Now download the new RaspiBlitz SD card image and write it to your SD card .. yes you simply overwrite the old one, it's OK, all your personal data is on the HDD (if you haven't done any manual changes to the system). See details about latest SD card image here: https://github.com/rootzoll/raspiblitz#scenario-2-start-at-home
Write the new image it to your SD card .. yes you simply overwrite the old one, it's OK, all your personal data is on the HDD. If you want to be extra safe you can make a image backup of your old sd card first - but that is optional. If you made manual changes to your RaspiBlitz with scripts on the sd card you might wanna check on this FAQ question first: [Why do I need to re-burn my SD card for an update?](FAQ.md#why-do-i-need-to-re-burn-my-sd-card-for-an-update).
- insert new sd card image
- power on the RaspiBlitz again
You should see that it switched into recover/backup mode. Its now provisioning the fresh OS on the sd card your old settings and data. This process can take some while especially if you had RTL Web UI activated. Follow the instructions on the display ... if it takes longer then an hour .. [get support](https://github.com/rootzoll/raspiblitz#support).
When update/recover process is ready you will see a `FINAL RECOVER LOGIN NEEDED` message on the display. Login per SSH by using the password `raspiblitz` and set your Password A again. It can be the same as the old one, but maybe use the occasion to make password change for security reasons. If you had auto-unlock activated you might also be asked to enter your old Password C again. Then it wil make a final reboot.
After your RaspiBlitz is done with catching up the latest blockchain data you should see your status screen displaying your funds and channels. Your backup is complete.
## Can I downgrade from v1.1 to v1.0?
Yes - it was tested one time and worked. Just follow the normal update mechanism - just use the old v1.0 image or your own backup image of the old sd card.
## Can I still get version 1.0 of RaspiBlitz?
If done successfully, simply put the SD card into the RaspiBlitz and power on again. Then follow the instructions on the display ... and dont worry, you dont need to re-download the blockchain again.
Yes here are the links:
HTTP: http://wiki.fulmo.org/downloads/raspiblitz-v1.0-2019-02-18.img.gz
Torrent: https://github.com/rootzoll/raspiblitz/raw/master/raspiblitz-v1.0-2019-02-18.torrent
SHA-256: 99ca96d214657388305ca117e2343ead45f9d907f185bef36c712a9a3e75568f
Code: https://github.com/rootzoll/raspiblitz/tree/v1.0
## How to update a old RaspiBlitz (BEFORE version 0.98)?
@ -55,11 +90,11 @@ Of course, people should modify the system, add own scripts, etc ... but if you
## How can I avoid using a prepared blockchain and validate myself?
The torrent and FTP download use a prepared blockchain to kick start the RaspiBlitz. If you want to selft validate you could do this on another more powerful computer and then transfere your own validated blockchain over to the RaspiBlitz. Check the options `Copying from another Computer` & `Cloning from a 2nd HDD` described in the [README](README.md) for more details.
The torrent download use a prepared blockchain to kick start the RaspiBlitz. If you want to selft validate you could do this on another more powerful computer and then transfere your own validated blockchain over to the RaspiBlitz. Check the options `Copying from another Computer` & `Cloning from a 2nd HDD` described in the [README](README.md) for more details.
## I have the full blockchain on another computer. How do I copy it to the RaspiBlitz?
Copying a already synced blockchain from another computer (for example your Laptop) can be a quick way to get the RaspiBlitz started or replacing a corrupted blockchain with a fresh one. Also that way you synced and verified the blockchain yourself and not trusting the RaspiBlitz FTP/Torrent downloads (dont trust, verify).
Copying a already synced blockchain from another computer (for example your Laptop) can be a quick way to get the RaspiBlitz started or replacing a corrupted blockchain with a fresh one. Also that way you synced and verified the blockchain yourself and not trusting the RaspiBlitz Torrent downloads (dont trust, verify).
One requirement is that the blockchain is from another bitcoin-core client with version greater or equal to 0.17.1 with transaction index switched on (`txindex=1` in the `bitcoin.conf`).
@ -105,9 +140,20 @@ To connect the 2nd HDD to the RaspiBlitz, the use of a Y cable to provide extra
![ExtraPower](pictures/extrapower.png)
## How do I generate a Debug Report?
If your RaspiBlitz is not working right and you like to get help from the community, its good to provide more debug information, so other can better diagnose your problem - please follow the following steps to generate a debug report:
- ssh into your raspiblitz as admin user with your password A
- If you see the menu - use CTRL+C to get to the terminal
- To generate debug report run: `./XXdebugLogs.sh`
- Then copy all output beginning with `*** RASPIBLITZ LOGS ***` and share this
*PLEASE NOTICE: Its possible that this logs can contain private information (like IPs, node IDs, ...) - just share publicly what you feel OK with.*
## Why is my "final sync" taking so long?
First of all if you see a final sync over 90% and you can see from time to time small increase - you should be OK ... this can take some looong time to catch up with the network. Only in the case that you activly choose the `SYNC` option in the `Getting the Blockchain` a final sync under 90% is OK. If you did a torrent, a FTP or a copy from another computer and seeing under 90% somthing went wrong and the setup process is ignoring your prepared Blockchain and doing a full sync - which can almost take forever on a raspberryPi.
First of all if you see a final sync over 90% and you can see from time to time small increase - you should be OK ... this can take some looong time to catch up with the network. Only in the case that you activly choose the `SYNC` option in the `Getting the Blockchain` a final sync under 90% is OK. If you did a torrent or a copy from another computer and seeing under 90% somthing went wrong and the setup process is ignoring your prepared Blockchain and doing a full sync - which can almost take forever on a raspberryPi.
So if something is wrong (like mentioned above) then try again from the beginning. You need to reset your HDD for a fresh start: SSH in as admin user. Abort the final sync info with CTRL+c to get to the terminal. There run `sudo /home/admin/XXcleanHDD.sh -all` and follow the script to delete all data in HDD. When finsihed power down with `sudo shutdown now`. Then make a fresh SD card from image and this time try another option to get the blockchain. If you run into trouble the second time, please report an issue on GitHub.
@ -119,45 +165,45 @@ But there is one safe way to start: Store your LND wallet seed (list of words yo
Recovering the coins that you have in an active channel is a bit more complicated. Because you have to be sure that you really have an up to date backup of your channel state data. The problem is: If you post an old state of your channel, to the network this looks like an atempt to cheat, and your channel partner is allowed claim all the funds in the channel.
To really have a reliable backup, such feature needs to be part of the LND software. Almost every other solution would not be perfect. Thats why RaspiBlitz is not trying to provide a backup feature at the moment.
But you can try to backup at your own risk. All your Lightning Node data is within the `/mnt/hdd/lnd` directory. Just run a backup of that data when the lnd service is stopped -> `sudo systemctl stop lnd` Then on your laptop you go with the terminal into the directory you want to store the backup in and use the following SCP command to download:
To really have a reliable backup, such feature needs to be part of the LND software. Almost every other solution would not be perfect. Thats why RaspiBlitz is not trying to provide a backup feature at the moment. But if you feel experimental and you look for a continues backup you may want to check out the following script to integrate into your RaspiBlitz: https://github.com/vindard/lnd-backup/blob/master/do-lndbackup.sh
`scp -r bitcoin@[LOCAL-IP-OF-RASPIBLITZ]:/mnt/hdd/lnd/ ./` use your password A
How to backup LND data in a rescue situation see next question "How can I recover my coins from a failing RaspiBlitz?".
And if you want to put a LND backup state back. Make a fresh RaspiBlitz (new sd card image and a clean HDD), set it up until its ready (you see the status screen on LCD) and then go to terminal, stop lnd service with `sudo systemctl stop lnd` delete the content of the lnd data dir with `sudo rm -rf /mnt/hdd/lnd/*`. Then on your laptop being in terminal in the same directory you did the backup in (the backuped lnd directory is listed there) run the following SCP command:
`scp -r ./lnd/* bitcoin@[LOCAL-IP-OF-RASPIBLITZ]:/mnt/hdd/lnd/` use password A
## How can I recover my coins from a failing RaspiBlitz?
No run a reboot with: `sudo shutdown -r now` ... LND may need some longer rescan after reboot, but then you should see your old channels and balances.
On a RaspiBlitz you have coins in your on-chain wallet (bitcoin wallet) and also coins in lightning channels. First we will try to recover all of them and even trying to keep your channels open with "Recover LND data". This that is not possible you can fall back to the second option "Recover from Wallet Seed".
**Be aware that if backup is some hours/days old, channels could have been closed by the other party and it may take some time until you see funds back on-chain. If backup is somewhat older also the channel counter parties may have used your offline time to cheat you with an old state. And if your backup was not the latest state and LND is closing channels it could also been happening that you are posting an old channel state (seen as cheating) and funds of that channel get lost as punishment. So again .. this backup method can be risky, use with caution.**
### 1) Recover LND data
## What is this mnemonic seed word list?
To recover all your LND data you must still be able to SSH into the RaspiBlitz (minimum v1.1) and the HDD should be still useable/reachable (mounted) - even it shows some errors. If this is not possible anymore you should skip to the second option "Recover from Wallet Seed".
With the 24 word list given you by LND on wallet creation you can recover your private key (BIP 39). You should write it down and store it at a save place.
If you still can SSH in and HDD is readable, we can try to rescue/export your LND data (funds and channels) from a RaspiBlitz to then be able to restore it back to a fresh one. For this you can use the following procedure ...
For more background on mnemonic seeds see this video: https://www.youtube.com/watch?v=wWCIQFNf_8g
To rescue/export your Lightning data from a RaspiBlitz:
## How does PASSWORD D effects the word seed?
* SSH into your RaspiBlitz and EXIT to terminal from the menu.
* then run: `/home/admin/config.scripts/lnd.rescue.sh backup`
* follow the instructions of the script.
On wallet creation you get asked if you want to protect your word seed list with an additional password. If you choose so, RaspiBlitz recommends you to use your PASSWORD D at this point.
This will create a lnd-rescue file (ends on gz.tar) that contains all the data from the LND. The script offers you a command to transfere the lnd-rescue file to your laptop. If transfere was successfull. You can now setup a fresh RaspiBlitz. Do all the setup until you have a clean new Lightning node running - just without any funding or channels.
To use a an additional password for your seed words is optional. If you choose so, you will need the password to recover your private key from your your seed words later on. Without this password your private key cannot be recovered from your seed words. So the password adds an additional layer of security, if someone finds your written down word list.
Then to restore your old LND data and to recover your funds and channels:
## How can I recover my coins from a failing RaspiBlitz?
* SSH into your new RaspiBlitz and EXIT to terminal from the menu.
* then run: `/home/admin/config.scripts/lnd.rescue.sh restore`
* follow the instructions of the script.
You might run into a situation where your hardware fails or the software starts to act buggy. So you decide to setup a fresh RaspiBlitz, like in the chapter above "Update to a new SD Card Release" - but the closing channels and cashing out is not working anymore. So whats about the funds you already have on your failing setup?
This script will offer you a way to transfere the lnd-rescue file from your laptop to the new RaspiBlitz and will restore the old data. LND gets then restarted for you and after some time it should show you the status screen again with your old funds and channels.
There is not a perfect way yet to backup/recover your coins, but you can try the following to make the best out of the situation:
**Be aware that if backup is some hours old, channels could have been closed by the other party and it may take some time until you see funds back on-chain. If backup is somewhat older then 1 day also the channel counter parties may have used your offline time to cheat you with an old state. And if your backup was not the latest state it could also been happening that you are posting an old channel state (seen as cheating) and funds of that channel get lost as punishment. So again .. this backup method can be risky, use with caution. But its recommended to try in recover and rescue situations - its not for regular backups.**
### 1) Recover from Wallet Seed
### 2) Recover from Wallet Seed
Remember those 24 words you were writing down during the setup? Thats your "cipher seed" - now this words are important to recover your wallet. If you dont have them anymore: skip this chapter and read option 2. If you still have the cypher seed: good, but read the following carefully:
With the cypher seed you can recover the bitcoin wallet that LND was managing for you - but it does not contain all the details about the channels you have open - its just the key to your funding wallet. If you were able to close all channels or never opened any channels, then everything is OK and you can go on. If you had open channels with funds in there, the following is to consider:
* You now rely on your channel counter parts to force close the channel at one point. If they do, the coins will be available to use in your funding wallet again at one point in the future - after force close delay.
* You now rely on your channel counter parts to force close the channel at one point. If they do, the coins will be available to use in your funding wallet again at one point in the future - after force close delay (but see also [#278](https://github.com/rootzoll/raspiblitz/issues/278) ).
* If your channel counter parts never force close the channel (because they are offline too) your channel funds can be frozen forever.
So going this way there is a small risk, that you will not recover your funds. But normally if your channel counter parts are still online, see that you will not come back online and they have themselves some funds on their channel side with you: They have an incentive to force close the channel to make use of their funds again.
@ -178,19 +224,17 @@ Then give LND some time to rescan the blockchain. In the end you will have resto
*Important: If you see a zero balance for on-chain funds after restoring from seed ... see details discussed [here](https://github.com/rootzoll/raspiblitz/issues/278) - you might try setup fresh this time with bigger look-ahead number.*
### 2) LND Channel State Backup
## What is this mnemonic seed word list?
With the 24 word list given you by LND on wallet creation you can recover your private key (BIP 39). You should write it down and store it at a save place.
For more background on mnemonic seeds see this video: https://www.youtube.com/watch?v=wWCIQFNf_8g
This second option is very very risky and can lead to complete loss of funds. And it olny can work, if you can still access the HDD content of your failing RaspiBlitz. It should only be used if you lost your cypher seed for the option above, forgot your cypher seed encryption password or your old channel counter parts are offline, too.
## How does PASSWORD D effects the word seed?
What you do is in priciple:
- Make a copy of the HDD directory `/mnt/hdd/lnd`
- Setup a fresh RaspiBlitz
- Stop LND with `sudo systemctl stop lnd`
- Replace the new `/mnt/hdd/lnd` with your backuped version
- Make sure everything in `/mnt/hdd/lnd` is owned by bitcoin:bitcoin
- Reboot the RaspiBlitz
On wallet creation you get asked if you want to protect your word seed list with an additional password. If you choose so, RaspiBlitz recommends you to use your PASSWORD D at this point.
This is highly experimental. And again: If you restore the LND with an backup that is not representing the latest channel state, this will trigger the lightning "penalty" mechanism - allowing your channel counter part to grab all the funds from a channel. Its a measure of last resort. But if its working for you, let us know.
To use a an additional password for your seed words is optional. If you choose so, you will need the password to recover your private key from your your seed words later on. Without this password your private key cannot be recovered from your seed words. So the password adds an additional layer of security, if someone finds your written down word list.
## How do I change the Name/Alias of my lightning node
@ -343,6 +387,10 @@ The downloaded blockchain is pre-indexed and pre-validated. That should be pract
If you dont trust the download or you want to run the RaspiBlitz in a more production like setup (on your own risk) then don't use the torrent/ftp download and choose the option to COPY the blockchain data from a more powerful computer (laptop or desktop) where you synced, verified and indexed the blockchain all by your yourself - see [README](README.md#4-copying-from-another-computer) for more details.
## Why is taking my torrent download of the blockchain so long?
Other users reported that opening up and forwarding the following port from their router to the RaspiBlitz helped speed up and getting started the torrent download: 6881-6889, 6969, 1337
## What is the "Base Torrent File"?
Inspired by the website getbitcoinblockchain.com we use one of their base torrent files to have a basic set of blocks - that will not change for the future. This torrent contains most of the data (the big file) and we dont need to change the torrent for a long time. This way the torrent can get establish a wide spread seeding and the torrent network can take the heavy load.
@ -537,3 +585,42 @@ Yes but you need to change at least on one RaspiBlitz the port number (for examp
## How to change the public port LND/Lightning node is running on?
There is a experimental script you can call from the terminal that will make all changes for you ... see details here: https://github.com/rootzoll/raspiblitz/issues/100#issuecomment-466722712
## How to solve a "signature mismatch after caveat verification" error?
If you get this error by LND that means that something is wrong with the macaroons being used to communicate with LND .. see: https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md
To fix this depends on where you get this error:
* If you get it in a mobile wallet, then redo the connection with the RaspiBlitz to get fresh macaroons.
* If you get this from RTL or from the scripts of the SSH menus of the RaspiBlitz, then go to "EXPORT Macacroons and TLS.cert" in SSH main menu and choose the the "RESET Macaroons & TLS" option.
Also make sure to check again on your power supply - it needs to deliver equal or more then 3A and should deliver a stable current. If you think your HDD is degrading - maybe this is a good time to replace it. See for details the FAQ question: [How can I recover my coins from a failing RaspiBlitz?](FAQ.md#how-can-i-recover-my-coins-from-a-failing-raspiblitz)
## Why is my node not routing?
1. You don't have inbound liquidity
2. Low uptime
3. Capital is committed to competitive destinations
4. Capital committed to destinations no one wants to send to
5. Fees are too high
6. Your inbound liquidity doesn't have good inbound liquidity itself
## How can I change the boot screen logo?
Just replace the file `/home/admin/raspiblitz/pictures/logoraspiblitz.png` with a PNG of the same dimensions.
NOTE: On updates this change will get lost and you might need to redo it.
## I cannot connect per SSH to my RaspiBlitz. What to do?
- Check the command again with how its on the display - do you have it typed in correctly?
- Replace `ssh` with `sudo ssh` and try it (laptop admin password might be required).
If that not works ry to ping the IP of the RaspiBlitz with `ping [IP-of-RaspiBlitz]`. If you get no response on the ping requests the device is not reachable try this check list:
- Make sure that your RaspiBlitz and your laptop are really on the same local network
- Check if you have a VPN running on your laptop - some VPNs block local network
- Some Routers have `IP Isolation` switched on - not allowing to devices to connect
If that all is not working: Join the conversation on [GitHub Issue #420](https://github.com/rootzoll/raspiblitz/issues/420).

44
README.md

@ -1,7 +1,7 @@
# RaspiBlitz
*Build your own Lightning Node on a RaspberryPi with a nice Display.*
`Version 1.0 with lnd 0.5.2-beta and bitcoin 0.17.0.1 or litecoin 0.16.3.`
`Version 1.1 with lnd 0.5.2-beta and bitcoin 0.17.0.1 or litecoin 0.16.3.`
![RaspiBlitz](pictures/raspiblitz.jpg)
@ -38,8 +38,8 @@ The RaspiBlitz is build from the following parts:
* RaspBerryPi 3 B+
* 1TB Hard Drive
* LCD-Display
* Micro SD-Card 16GB
* Powersupply >=3A (big & stable)
* Micro SD-Card (min 16GB - go for quality)
* Powersupply >=3A (choose big & stable output)
* Cheap Casing
**All together under 150 USD / 130 EUR (depending on country & shop)**
@ -80,16 +80,21 @@ Connect the HDD to one of the USB ports. In the end your RaspiBlitz should look
Your SD-card needs to contain the RaspiBlitz software. You can take the long road by [building the SD-card image yourself](#build-the-sd-card-image) or use the already prepared SD-Card image:
1. Download SD-Card image - **Version 1.0**:
**Download SD-Card image - Version 1.1:**
HTTP: http://wiki.fulmo.org/downloads/raspiblitz-v1.0-2019-02-18.img.gz
HTTP: http://wiki.fulmo.org/downloads/raspiblitz-v1.1-2019-03-18.img.gz
Torrent: https://github.com/rootzoll/raspiblitz/raw/master/raspiblitz-v1.0-2019-02-18.torrent
Torrent: https://github.com/rootzoll/raspiblitz/raw/master/raspiblitz-v1.1-2019-03-18.torrent
SHA-256: 99ca96d214657388305ca117e2343ead45f9d907f185bef36c712a9a3e75568f
SHA-256: b7a449ce6444f9e7e9fd05156ff09c70a6e200be0b5e580d3317049eefc4f3b7
2. Write the SD-Card image to your SD Card - if you need details, see here:
https://www.raspberrypi.org/documentation/installation/installing-images/README.md
**Write the SD-Card image to your SD Card**
if you need details, see here: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
* [How to update my RaspiBlitz?](FAQ.md#how-to-update-my-raspiblitz-after-version-098)
* [Whats new in Version 1.1 of RaspiBlitz?](FAQ.md#whats-new-in-version-11-of-raspiblitz)
* [Can I still get version 1.0 of RaspiBlitz?](FAQ.md#can-i-still-get-version-10-of-raspiblitz)
## Boot your RaspiBlitz
@ -115,6 +120,8 @@ Now open up a terminal ([OSX](https://www.youtube.com/watch?v=5XgBd6rjuDQ)/[Win1
**Now follow the dialoge in your terminal. This can take some time (prepare some coffee) - but in the end you should have a running Lightning node on your RaspberryPi that you can start to learn and hack on.**
* [I cannot connect per SSH to my RaspiBlitz. What to do?](FAQ.md#i-cannot-connect-per-ssh-to-my-raspiblitz-what-to-do)
## Support
If you run into a problem or you have still a question, follow the steps below to get support. Also check the [setup documentation](#setup-process-detailed-documentation) for details.
@ -189,26 +196,17 @@ This is the default way to download the blockchain data for the RaspiBlitz. If y
![DOWNLOAD1](pictures/download-torrent.png)
*This can take a while - normally it should be done if you keep it running over night, but some users reported that it took up to 3 days. If it takes longer than that or you cannot see any progress (downloading starting) for over an hour after you started thsi option consider to cancel the download and choose the FTP download option.*
*This can take a while - normally it should be done if you keep it running over night, but some users reported that it took up to 3 days. If it takes longer than that or you cannot see any progress (downloading starting) for over an hour after you started this option consider to cancel the download and go with the COPY option or retry fresh.*
It is safe to close the terminal window (shutdown your laptop) while the RaspiBlitz is doing the torrent download. To check on progress and to continue the setup you need to ssh back in again.
You can cancel the torrent download by keeping the key `x` pressed. Then the download will stop and you will be asked if you want to keep the progress so far. This makes sense if you need to shutdown the RaspiBlitz and you want to continue later or when you want to try another download option but want to keep the option to continue on torrent if the other option is slower or not working.
* [How can I avoid using a prepared blockchain and validate myself?](FAQ.md#how-can-i-avoid-using-a-prepared-blockchain-and-validate-myself)
* [Why is taking my torrent download of the blockchain so long?]()
#### 2. FTP-Download
You should try the FTP download if the torrent option is not working for you. Please be aware that the files are hosted on a central server by us and up-time and bandwidth is not guaranteed. If you start it, you should see the following screen:
![DOWNLOAD1](pictures/download-ftp.png)
It is safe to close the terminal window (shutdown your laptop) while the RaspiBlitz is doing the FTP download. To check on progress and to continue the setup you need to ssh back in again.
* [Why is taking my torrent download of the blockchain so long?](FAQ.md#why-is-taking-my-torrent-download-of-the-blockchain-so-long)
You can cancel the FTP download by keeping the key `x` pressed. Then the download will stop and you will be asked if you want to keep the progress so far. This makes sense if you need to shutdown the RaspiBlitz and you want to continue later or when you want to try another download option but want to keep the option to continue on FTP download if the other option is slower or not working.
#### 4. Copying from another Computer
#### 2. Copying from another Computer
If you have another computer available (laptop, desktop or another raspiblitz) that already runs a working blockchain (with txindex=1) you can use this option to copy it over to the RaspiBlitz. This will be done over the local network by SCP (SSH file transfere). Choose this option and follow the given instructions.
@ -216,11 +214,11 @@ This is also the best option if you dont like to run your RaspiBlitz with a prep
More details: [I have the full blockchain on another computer. How do I copy it to the RaspiBlitz?](FAQ.md#i-have-the-full-blockchain-on-another-computer-how-do-i-copy-it-to-the-raspiblitz)
#### 5. Cloning from a 2nd HDD
#### 3. Cloning from a 2nd HDD
If is a backup way to transfere a blockchain from another computer if copying over the network is not working. More details on the setup can be found [here](FAQ.md#how-do-i-clone-the-blockchain-from-a-2nd-hdd).
#### 6. Sync from Bitcoin-Network
#### 4. Sync from Bitcoin-Network
This is the fallback of last resort. A RaspberryPi has a very low power CPU and syncing+validating the blockchain directly with the peer2peer network can take multiple weeks - thats why the other options above where invented.

90
build_sdcard.sh

@ -12,7 +12,7 @@
echo ""
echo "*****************************************"
echo "* RASPIBLITZ SD CARD IMAGE SETUP v1.00 *"
echo "* RASPIBLITZ SD CARD IMAGE SETUP v1.1 *"
echo "*****************************************"
echo ""
@ -71,6 +71,11 @@ else
echo "OK running ${baseImage}"
fi
# setting static DNS server
# see https://github.com/rootzoll/raspiblitz/issues/322#issuecomment-466733550
sudo sed -i "s/^#static domain_name_servers=192.168.0.1*/static domain_name_servers=1.1.1.1/g" /etc/dhcpcd.conf
systemctl daemon-reload
# fixing locales for build
# https://github.com/rootzoll/raspiblitz/issues/138
# https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html
@ -127,6 +132,8 @@ if [ "${baseImage}" = "raspbian" ]; then
sudo raspi-config nonint do_boot_wait 0
# set WIFI country so boot does not block
sudo raspi-config nonint do_wifi_country US
# see https://github.com/rootzoll/raspiblitz/issues/428#issuecomment-472822840
echo "max_usb_current=1" | sudo tee -a /boot/config.txt
# extra: remove some big packages not needed
sudo apt-get remove -y --purge libreoffice* oracle-java* chromium-browser nuscratch scratch sonic-pi minecraft-pi python-pygame
sudo apt-get clean
@ -148,6 +155,75 @@ sudo bash -c "echo '[Service]' >> /etc/systemd/system/getty@tty1.service.d/autol
sudo bash -c "echo 'ExecStart=' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
sudo bash -c "echo 'ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
# change log rotates
# see https://github.com/rootzoll/raspiblitz/issues/394#issuecomment-471535483
echo "/var/log/syslog" >> ./rsyslog
echo "{" >> ./rsyslog
echo " rotate 7" >> ./rsyslog
echo " daily" >> ./rsyslog
echo " missingok" >> ./rsyslog
echo " notifempty" >> ./rsyslog
echo " delaycompress" >> ./rsyslog
echo " compress" >> ./rsyslog
echo " postrotate" >> ./rsyslog
echo " invoke-rc.d rsyslog rotate > /dev/null" >> ./rsyslog
echo " endscript" >> ./rsyslog
echo "}" >> ./rsyslog
echo "" >> ./rsyslog
echo "/var/log/mail.info" >> ./rsyslog
echo "/var/log/mail.warn" >> ./rsyslog
echo "/var/log/mail.err" >> ./rsyslog
echo "/var/log/mail.log" >> ./rsyslog
echo "/var/log/daemon.log" >> ./rsyslog
echo "{" >> ./rsyslog
echo " rotate 4" >> ./rsyslog
echo " size=100M" >> ./rsyslog
echo " missingok" >> ./rsyslog
echo " notifempty" >> ./rsyslog
echo " compress" >> ./rsyslog
echo " delaycompress" >> ./rsyslog
echo " sharedscripts" >> ./rsyslog
echo " postrotate" >> ./rsyslog
echo " invoke-rc.d rsyslog rotate > /dev/null" >> ./rsyslog
echo " endscript" >> ./rsyslog
echo "}" >> ./rsyslog
echo "" >> ./rsyslog
echo "/var/log/kern.log" >> ./rsyslog
echo "/var/log/auth.log" >> ./rsyslog
echo "{" >> ./rsyslog
echo " rotate 4" >> ./rsyslog
echo " size=100M" >> ./rsyslog
echo " missingok" >> ./rsyslog
echo " notifempty" >> ./rsyslog
echo " compress" >> ./rsyslog
echo " delaycompress" >> ./rsyslog
echo " sharedscripts" >> ./rsyslog
echo " postrotate" >> ./rsyslog
echo " invoke-rc.d rsyslog rotate > /dev/null" >> ./rsyslog
echo " endscript" >> ./rsyslog
echo "}" >> ./rsyslog
echo "" >> ./rsyslog
echo "/var/log/user.log" >> ./rsyslog
echo "/var/log/lpr.log" >> ./rsyslog
echo "/var/log/cron.log" >> ./rsyslog
echo "/var/log/debug" >> ./rsyslog
echo "/var/log/messages" >> ./rsyslog
echo "{" >> ./rsyslog
echo " rotate 4" >> ./rsyslog
echo " weekly" >> ./rsyslog
echo " missingok" >> ./rsyslog
echo " notifempty" >> ./rsyslog
echo " compress" >> ./rsyslog
echo " delaycompress" >> ./rsyslog
echo " sharedscripts" >> ./rsyslog
echo " postrotate" >> ./rsyslog
echo " invoke-rc.d rsyslog rotate > /dev/null" >> ./rsyslog
echo " endscript" >> ./rsyslog
echo "}" >> ./rsyslog
sudo mv ./rsyslog /etc/logrotate.d/rsyslog
sudo chown root:root /etc/logrotate.d/rsyslog
sudo service rsyslog restart
echo ""
echo "*** SOFTWARE UPDATE ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#software-update
@ -158,6 +234,18 @@ sudo apt-get install -y htop git curl bash-completion jq dphys-swapfile
# installs bandwidth monitoring for future statistics
sudo apt-get install -y vnstat
# prepare for BTRFS data drive raid
sudo apt-get install -y btrfs-tools
# prepare for display graphics mode
# see https://github.com/rootzoll/raspiblitz/pull/334
sudo apt-get install -y fbi
# prepare dor display service
# see https://github.com/rootzoll/raspiblitz/issues/88#issuecomment-471342311
sudo apt-get install -y redis-server
sudo -H pip3 install redis
echo ""
echo "*** ADDING MAIN USER admin ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-main-user-admin

14
home.admin/00infoBlitz.sh

@ -216,6 +216,10 @@ ln_channelInfo="\n"
ln_external="\n"
ln_alias="${hostname}"
ln_publicColor=""
ln_port=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':')
if [ ${#ln_port} -eq 0 ]; then
ln_port="9735"
fi
wallet_unlocked=$(sudo tail -n 1 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2> /dev/null | grep -c unlock)
if [ "$wallet_unlocked" -gt 0 ] ; then
@ -228,7 +232,7 @@ else
if [ ${ln_tor} -eq 1 ]; then
ln_publicColor="${color_green}"
else
public_check=$(nc -z -w6 ${public_ip} 9735 2>/dev/null; echo $?)
public_check=$(nc -z -w6 ${public_ip} ${ln_port} 2>/dev/null; echo $?)
if [ $public_check = "0" ]; then
# only set yellow/normal because netcat can only say that the port is open - not that it points to this device for sure
ln_publicColor="${color_amber}"
@ -283,14 +287,14 @@ ${color_yellow} // ${color_gray}
${color_yellow} / ${color_gray}LND ${color_green}${ln_version} ${ln_baseInfo}
${color_yellow} ${color_gray}${ln_channelInfo} ${ln_peersInfo}
${color_yellow}
${color_gray}${ln_publicColor}${ln_external}
${color_yellow}${ln_publicColor}${ln_external}${color_red}
" \
"RaspiBlitz v${codeVersion}" \
"-------------------------------------------" \
"load average:${load##up*, }" "${temp}" \
"${hdd}" "${sync_percentage}"
if [ "${runBehindTor}" != "on" ]; then
# one extra space line at the end if nodeaddress is not TOR
echo ""
if [ ${#undervoltageReports} -gt 0 ] && [ "${undervoltageReports}" != "0" ]; then
echo "${undervoltageReports} undervoltage reports found - maybe upgrade power supply"
fi

30
home.admin/00infoLCD.sh

@ -159,6 +159,36 @@ while :
# DISPLAY AFTER SETUP
###########################
if [ "${state}" = "repair" ]; then
l1="Repair Mode\n"
l2="ssh admin@${localip}\n"
l3="Use password: PasswordA\n"
boxwidth=$((${#localip} + 28))
dialog --backtitle "RaspiBlitz ${codeVersion} (${state}) ${setupStep} ${localip}" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 3
continue
fi
if [ "${state}" = "retorrent" ]; then
l1="Repair Mode- TORRENT\n"
l2="ssh admin@${localip}\n"
l3="Use password: PasswordA\n"
boxwidth=$((${#localip} + 28))
dialog --backtitle "RaspiBlitz ${codeVersion} (${state}) ${setupStep} ${localip}" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 3
continue
fi
if [ "${state}" = "recopy" ]; then
l1="Repair Mode - COPY\n"
l2="ssh admin@${localip}\n"
l3="Use password: PasswordA\n"
boxwidth=$((${#localip} + 28))
dialog --backtitle "RaspiBlitz ${codeVersion} (${state}) ${setupStep} ${localip}" --infobox "$l1$l2$l3" 5 ${boxwidth}
sleep 3
continue
fi
# check if bitcoin is ready
sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 1>/dev/null 2>error.tmp
clienterror=`cat error.tmp`

91
home.admin/00mainMenu.sh

@ -65,6 +65,15 @@ if [ "${state}" = "reindex" ]; then
exit 1
fi
# singal that torrent is in re-download
if [ "${state}" = "retorrent" ]; then
echo "Re-Index in progress ... start monitoring:"
/home/admin/50torrentHDD.sh
sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info
/home/admin/00mainMenu.sh
exit
fi
# if pre-sync is running - stop it - before continue
if [ "${state}" = "presync" ]; then
# stopping the pre-sync
@ -134,18 +143,92 @@ waitUntilChainNetworkIsReady()
echo "can take longer if device was off or first time"
while :
do
# check for error on network
sudo -u bitcoin ${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo 1>/dev/null 2>error.tmp
clienterror=`cat error.tmp`
rm error.tmp
# check for missing blockchain data
minSize=250000000000
if [ "${network}" = "litecoin" ]; then
minSize=20000000000
fi
blockchainsize=$(sudo du -shbc /mnt/hdd/${network} | head -n1 | awk '{print $1;}')
if [ ${#blockchainsize} -gt 0 ]; then
if [ ${blockchainsize} -lt ${minSize} ]; then
echo "blockchainsize(${blockchainsize})"
echo "Missing Blockchain Data (<${minSize}) ..."
clienterror="missing blockchain"
sleep 3
fi
fi
if [ ${#clienterror} -gt 0 ]; then
# analyse LOGS for possible reindex
reindex=$(sudo cat /mnt/hdd/${network}/debug.log | grep -c 'Please restart with -reindex or -reindex-chainstate to recover')
if [ ${reindex} -gt 0 ]; then
echo "!! DETECTED NEED FOR RE-INDEX in debug.log ... starting repair script."
if [ ${reindex} -gt 0 ] || [ "${clienterror}" = "missing blockchain" ]; then
echo "!! DETECTED NEED FOR RE-INDEX in debug.log ... starting repair options."
sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info
sleep 3
sudo /home/admin/config.scripts/network.reindex.sh
exit
dialog --backtitle "RaspiBlitz - Repair Script" --msgbox "Your blockchain data needs to be repaired.
This can be due to power problems or a failing HDD.
Please check the FAQ on RaspiBlitz Github
'My blockchain data is corrupted - what can I do?'
https://github.com/rootzoll/raspiblitz/blob/master/FAQ.md
The RaspiBlitz will now try to help you on with the repair.
To run a BACKUP of funds & channels first is recommended.
" 13 65
clear
# Basic Options
OPTIONS=(TORRENT "Redownload Prepared Torrent (DEFAULT)" \
COPY "Copy from another Computer (SKILLED)" \
REINDEX "Resync thru ${network}d (TAKES VERY VERY LONG)" \
BACKUP "Run Backup LND data first (optional)"
)
CHOICE=$(dialog --backtitle "RaspiBlitz - Repair Script" --clear --title "Repair Blockchain Data" --menu "Choose a repair/recovery option:" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear
if [ "${CHOICE}" = "TORRENT" ]; then
echo "Starting TORRENT ..."
sudo sed -i "s/^state=.*/state=retorrent/g" /home/admin/raspiblitz.info
/home/admin/50torrentHDD.sh
sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info
/home/admin/00mainMenu.sh
exit
elif [ "${CHOICE}" = "COPY" ]; then
echo "Starting COPY ..."
sudo sed -i "s/^state=.*/state=recopy/g" /home/admin/raspiblitz.info
/home/admin/50copyHDD.sh
sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info
/home/admin/00mainMenu.sh
exit
elif [ "${CHOICE}" = "REINDEX" ]; then
echo "Starting REINDEX ..."
sudo /home/admin/config.scripts/network.reindex.sh
exit
elif [ "${CHOICE}" = "BACKUP" ]; then
sudo /home/admin/config.scripts/lnd.rescue.sh backup
echo "PRESS ENTER to return to menu."
read key
/home/admin/00mainMenu.sh
exit
else
echo "CANCEL"
exit
fi
else
echo "${network} error: ${clienterror}"
fi
# normal info

20
home.admin/00settingsMenuServices.sh

@ -172,13 +172,21 @@ if [ "${rtlWebinterface}" != "${choice}" ]; then
echo "RTL Webinterface Setting changed .."
anychange=1
sudo /home/admin/config.scripts/bonus.rtl.sh ${choice}
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
l1="RTL web servcie will be ready AFTER NEXT REBOOT:"
l2="Try to open the following URL in your local webrowser"
l3="and login with your PASSWORD B."
l4="---> http://${localip}:3000"
dialog --title 'OK' --msgbox "${l1}\n${l2}\n${l3}\n${l4}" 11 65
if [ ${errorOnInstall} -eq 0 ]; then
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
l1="RTL web servcie will be ready AFTER NEXT REBOOT:"
l2="Try to open the following URL in your local webrowser"
l3="and login with your PASSWORD B."
l4="---> http://${localip}:3000"
dialog --title 'OK' --msgbox "${l1}\n${l2}\n${l3}\n${l4}" 11 65
else
l1="!!! FAIL on RTL install !!!"
l2="Try manual install on terminal after rebootwith:"
l3="sudo /home/admin/config.scripts/bonus.rtl.sh on"
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 10 65
fi
fi
needsReboot=1
else

5
home.admin/10setupBlitz.sh

@ -188,7 +188,6 @@ if [ ${mountOK} -eq 1 ]; then
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
--menu "You need a copy of the Bitcoin Blockchain - you have 5 options:" 13 75 5 \
T "TORRENT --> MAINNET + TESTNET thru Torrent (DEFAULT)" \
D "DOWNLOAD --> MAINNET + TESTNET per FTP (FALLBACK)" \
C "COPY --> BLOCKCHAINDATA from another node with SCP" \
N "CLONE --> BLOCKCHAINDATA from 2nd HDD (extra cable)"\
S "SYNC --> MAINNET thru Bitcoin Network (ULTRA SLOW)" 2>&1 >/dev/tty)
@ -199,7 +198,6 @@ if [ ${mountOK} -eq 1 ]; then
menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title "Getting the Blockchain" \
--menu "You need a copy of the Litecoin Blockchain - you have 3 options:" 13 75 4 \
T "TORRENT --> MAINNET thru Torrent (DEFAULT)" \
D "DOWNLOAD --> MAINNET per FTP (FALLBACK)" \
S "SYNC --> MAINNET thru Litecoin Network (FALLBACK+SLOW)" 2>&1 >/dev/tty)
# error
@ -225,9 +223,6 @@ if [ ${mountOK} -eq 1 ]; then
S)
/home/admin/50syncHDD.sh
;;
D)
/home/admin/50downloadHDD.sh
;;
esac
exit 1

20
home.admin/40addHDD.sh

@ -25,7 +25,8 @@ if [ ${existsHDD} -gt 0 ]; then
uuid=$1
fstabOK=$(cat /etc/fstab | grep -c ${uuid})
if [ ${fstabOK} -eq 0 ]; then
fstabAdd="UUID=${uuid} /mnt/hdd ext4 noexec,defaults 0 0"
# see https://github.com/rootzoll/raspiblitz/issues/360#issuecomment-467567572
fstabAdd="UUID=${uuid} /mnt/hdd ext4 noexec,defaults 0 2"
echo "Adding line to /etc/fstab ..."
echo ${fstabAdd}
# adding the new line after line 3 to the /etc/fstab
@ -46,6 +47,10 @@ if [ ${existsHDD} -gt 0 ]; then
echo "OK - HDD is mounted"
echo ""
# setting fsk check intervall to 1
# see https://github.com/rootzoll/raspiblitz/issues/360#issuecomment-467567572
sudo tune2fs -c 1 /dev/sda1
# init the RASPIBLITZ Config
configFile="/mnt/hdd/raspiblitz.conf"
configExists=$(sudo ls ${configFile} 2>/dev/null | grep -c 'raspiblitz.conf')
@ -64,6 +69,19 @@ if [ ${existsHDD} -gt 0 ]; then
# try to determine publicIP and if not possible use localIP as placeholder
# https://github.com/rootzoll/raspiblitz/issues/312#issuecomment-462675101
freshPublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php)
# sanity check on IP data
# see https://github.com/rootzoll/raspiblitz/issues/371#issuecomment-472416349
echo "-> sanity check of IP data: ${freshPublicIP}"
if [[ $freshPublicIP =~ ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$ ]]; then
echo "OK IPv6"
elif [[ $freshPublicIP =~ ^([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ ]]; then
echo "OK IPv4"
else
echo "FAIL - not an IPv4 or IPv6 address"
freshPublicIP=""
fi
if [ ${#freshPublicIP} -eq 0 ]; then
localIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo "WARNING: No publicIP information at all yet - working with placeholder : ${localIP}"

55
home.admin/50copyHDD.sh

@ -6,29 +6,55 @@ source /home/admin/raspiblitz.info
# get local ip
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
# Basic Options
OPTIONS=(UNIX "MacOS or Linux" \
WINDOWS "Windows"
)
CHOICE=$(dialog --clear --title "Which System is running on the other computer?" --menu "" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear
case $CHOICE in
UNIX) echo "Linus";;
WINDOWS) echo "Bill";;
*) exit 1;;
esac
# additional prep if this is used to replace corrupted blockchain
if [ "${setupStep}" = "100" ]; then
# warn user
echo "!! Press ENTER to delete the old blockchain .. CTRL+C to CANCEL"
read key
# make sure services are not running
echo "stopping servcies ..."
sudo systemctl stop lnd
sudo systemctl stop bitcoind
sudo systemctl disable bitcoind
sudo cp -f /mnt/hdd/bitcoin/bitcoin.conf /home/admin/assets/bitcoin.conf
fi
# delete all IN bitcoin directory but not itself if it exists
# so that possibel link to /home/bitcoin/.bitcoin nicht beschädigt wird
sudo rm -rfv /mnt/hdd/bitcoin/* 2>/dev/null
if [ -d "/mnt/hdd/bitcoin" ]; then
dialog --title "Fresh or Repair" --yesno "Do you want to delete the old/local blockchain data now?" 8 60
response=$?
echo "response(${response})"
if [ "${response}" = "1" ]; then
echo "OK - keep old blockchain - just try to repair by copying over it"
sleep 3
else
echo "OK - delete old blockchain"
# delete all IN bitcoin directory but not itself if it exists
# so that possibel link to /home/bitcoin/.bitcoin nicht beschädigt wird
# also keep debug logs for repair script
sudo mv /mnt/hdd/bitcoin/debug.log /home/admin/debug.log 2>/dev/null
sudo rm -rfv /mnt/hdd/bitcoin/* 2>/dev/null
sudo mv /home/admin/debug.log /mnt/hdd/bitcoin/debug.log 2>/dev/null
sleep 3
fi
fi
# make sure /mnt/hdd/bitcoin exists
sudo mkdir /mnt/hdd/bitcoin 2>/dev/null
# allow all users write to it ()
# allow all users write to it
sudo chmod 777 /mnt/hdd/bitcoin
echo
clear
echo "************************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from another computer"
@ -45,7 +71,11 @@ echo "blockchain data. You should see directories 'blocks', 'chainstate' & 'inde
echo "Make sure the bitcoin client on that computer is stopped."
echo ""
echo "COPY, PASTE & EXECUTE the following command on the blockchain source computer:"
echo "sudo scp -r ./chainstate ./indexes ./testnet3 ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
if [ "${CHOICE}" = "WINDOWS" ]; then
echo "sudo scp -r ./chainstate ./indexes ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
else
echo "sudo rsync -avhW --progress ./chainstate ./indexes ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
fi
echo ""
echo "This command may ask you first about the admin password of the other computer (because sudo)."
echo "Then it will ask for your SSH PASSWORD A from this RaspiBlitz."
@ -101,6 +131,7 @@ if [ ${anyDataAtAll} -eq 1 ]; then
else
echo "OK -> DATA LOOKS GOOD :D"
sudo rm /mnt/hdd/bitcoin/debug.log
fi
@ -115,15 +146,17 @@ echo "*********************************************"
# if started after intial setup - quit here
if [ "${setupStep}" = "100" ]; then
sudo cp /home/admin/assets/bitcoin.conf /mnt/hdd/bitcoin/bitcoin.conf
rpcpass=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep 'bitcoind.rpcpass' | cut -d "=" -f2)
sudo chown bitcoin:bitcoin /mnt/hdd/bitcoin/bitcoin.conf
sudo sed -i "s/^rpcpassword=.*/rpcpassword=${rpcpass}/g" /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null
sudo systemctl enable bitcoind
echo "DONE - reboot is needed: sudo shutdown -r now"
echo "DONE - rebooting: sudo shutdown -r now"
sudo shutdown -r now
exit 0
fi
# REACT ON QUICK CHECK DURING INITAL SETUP
if [ ${quickCheckOK} -eq 0 ]; then
echo "*********************************************"

18
home.admin/50torrentHDD.sh

@ -7,6 +7,14 @@ echo ""
## get basic info
source /home/admin/raspiblitz.info
# if setup was done - remove old data
if [ "${setupStep}" = "100" ]; then
echo "stopping servcies ..."
sudo systemctl stop lnd
sudo systemctl stop ${network}d
fi
# make sure rtorrent is available
sudo apt-get install rtorrent -y
echo ""
@ -245,7 +253,7 @@ if [ ${torrentError} -gt 0 ]; then
# User Cancel --> Torrent incomplete
sleep 3
echo -ne '\007'
dialog --title " WARNING (${torrentError})" --yesno "The Torrent download failed or is not complete - maybe try FTP download next time. Do you want keep already downloaded torrent data?" 8 57
dialog --title " WARNING (${torrentError})" --yesno "The Torrent download failed or is not complete - maybe try COPY option. Do you want keep already downloaded torrent data?" 8 57
response=$?
case $response in
1) sudo rm -rf ${targetDir}; sudo rm -rf ${sessionDir} ;;
@ -263,9 +271,10 @@ if [ "${setupStep}" = "100" ]; then
sudo systemctl disable ${network}d
sudo cp -f /mnt/hdd/${network}/${network}.conf /home/admin/assets/${network}.conf
sudo rm -rfv /mnt/hdd/${network}/* 2>/dev/null
sudo rm /mnt/hdd/${network}/debug.log
fi
# Download worked / just move, copy on USB2 >4h
# Download worked / just move, copy on USB2 would be >4h
echo ""
echo "*** Moving Files ***"
date +%s
@ -279,9 +288,12 @@ date +%s
if [ "${setupStep}" = "100" ]; then
sudo cp /home/admin/assets/${network}.conf /mnt/hdd/${network}/${network}.conf
rpcpass=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "${network}d.rpcpass" | cut -d "=" -f2)
sudo sed -i "s/^rpcpassword=.*/rpcpassword=${rpcpass}/g" /mnt/hdd/${network}/${network}.conf 2>/dev/null
sudo chown -R bitcoin:bitcoin /mnt/hdd/${network}/
sudo systemctl enable ${network}d
echo "DONE - reboot needed: sudo shutdown -r now"
echo "DONE - rebooting: sudo shutdown -r now"
sudo shutdown -r now
else
# set SetupState
sudo sed -i "s/^setupStep=.*/setupStep=50/g" /home/admin/raspiblitz.info

32
home.admin/97addMobileWalletZap.sh

@ -15,11 +15,13 @@ if [ ${#GOPATH} -eq 0 ]; then
fi
# make sure go is installed
goVersion="1.11"
echo "### Check Framework: GO ###"
goInstalled=$(go version 2>/dev/null | grep -c 'go')
if [ ${goInstalled} -eq 0 ];then
echo "### Installing GO ###"
wget https://storage.googleapis.com/golang/go1.11.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.11.linux-armv6l.tar.gz
echo "---> Installing GO"
wget https://storage.googleapis.com/golang/go${goVersion}.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go${goVersion}.linux-armv6l.tar.gz
sudo rm *.gz
sudo mkdir /usr/local/gocode
sudo chmod 777 /usr/local/gocode
@ -27,16 +29,24 @@ if [ ${goInstalled} -eq 0 ];then
fi
if [ ${goInstalled} -eq 0 ];then
echo "FAIL: Was not able to install GO (needed to run LndConnect)"
sleep 4
exit 1
fi
clear
correctGoVersion=$(go version | grep -c "go${goVersion}")
if [ ${correctGoVersion} -eq 0 ]; then
echo "WARNING: You work with a untested version of GO - should be ${goVersion} .. trying to continue"
go version
sleep 6
echo ""
fi
# make sure qrcode-encoder in installed
clear
echo "*** Setup ***"
echo ""
echo "Installing lndconnect. Please wait..."
echo ""
echo "Getting github.com/LN-Zap/lndconnect (please wait) ..."
echo "Getting github.com/LN-Zap/lndconnect (please wait - can take several minutes) ..."
go get -d github.com/LN-Zap/lndconnect
cd $GOPATH/src/github.com/LN-Zap/lndconnect
echo ""
@ -51,12 +61,12 @@ echo "Connect Zap Mobile Wallet"
echo "******************************"
echo ""
echo "GETTING THE APP"
echo "At the moment this app is in closed beta testing."
echo "Go to http://www.zap-ios.jackmallers.com sign up with your email (confirmation can take time)"
echo "iOS: Read https://developer.apple.com/testflight/testers/"
echo "At the moment this app is in closed beta testing and the source code has not been published yet."
echo "1. Install the app 'TestFlight' from Apple Appstore. Open it and agree to all terms of services."
echo "2. Open on your iOS device https://github.com/LN-Zap/zap-iOS and follow 'Download the Alpha'"
echo ""
echo "*** STEP 1 ***"
if [ ${#dynDomain} -eq 0 ]; then
echo "*** PAIRING STEP 1 ***"
if [ ${#dynDomain} -eq 0 ]; then
echo "Once you have the app is running make sure you are on the same local network (WLAN same as LAN)."
fi
echo "During Setup of the Zap app you should get to the 'Connect Remote-Node' screen."
@ -67,7 +77,7 @@ echo "Then PRESS ENTER here in the terminal to generare the QR code and scan it
read key
clear
echo "*** STEP 2 : Click on Scan (make whole QR code fill camera) ***"
echo "*** PAIRING STEP 2 : Click on Scan (make whole QR code fill camera) ***"
if [ ${#dynDomain} -eq 0 ]; then
# If you drop the -i parameter, lndconnect will use the external IP.

12
home.admin/XXdebugLogs.sh

@ -40,7 +40,10 @@ echo "*** CHAINNETWORK SYSTEMD STATUS ***"
sudo systemctl status ${network}d -n2 --no-pager
echo ""
echo "*** LAST 20 CHAINNETWORK LOGS ***"
echo "*** LAST 5 ERROR LOGS ***"
sudo journalctl -u ${network}d -b --no-pager -n5
echo ""
echo "*** LAST 20 INFO LOGS ***"
pathAdd=""
if [ "${chain}" = "test" ]; then
pathAdd="/testnet3"
@ -52,8 +55,11 @@ echo "*** LND SYSTEMD STATUS ***"
sudo systemctl status lnd -n2 --no-pager
echo ""
echo "*** LAST 20 LND LOGS ***"
sudo journalctl -u lnd -b --no-pager -n20
echo "*** LAST 5 LND ERROR LOGS ***"
sudo journalctl -u lnd -b --no-pager -n5
echo ""
echo "*** LAST 20 LND INFO LOGS ***"
sudo tail -n 20 /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log
echo ""
if [ "${rtlWebinterface}" = "on" ]; then

31
home.admin/_background.sh

@ -60,6 +60,25 @@ do
fi
####################################################
# CHECK FOR UNDERVOLTAGE REPORTS
# every 1 hour scan for undervoltage reports
####################################################
recheckUndervoltage=$(($counter % 3600))
if [ ${recheckUndervoltage} -eq 1 ]; then
echo "*** RECHECK UNDERVOLTAGE ***"
countReports=$(sudo cat /var/log/syslog | grep -c "Under-voltage detected!")
echo "${countReports} undervoltage reports found in syslog"
if [ ${#undervoltageReports} -eq 0 ]; then
# write new value to info file
undervoltageReports="${countReports}"
echo "undervoltageReports=${undervoltageReports}" >> ${infoFile}
else
# update value in info file
sed -i "s/^undervoltageReports=.*/undervoltageReports=${countReports}/g" ${infoFile}
fi
fi
####################################################
# RECHECK PUBLIC IP
# when public IP changes, restart LND with new IP
@ -80,6 +99,18 @@ do
echo "freshPublicIP(${freshPublicIP})"
echo "publicIP(${publicIP})"
# sanity check on IP data
# see https://github.com/rootzoll/raspiblitz/issues/371#issuecomment-472416349
echo "-> sanity check of IP data: ${freshPublicIP}"
if [[ $freshPublicIP =~ ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$ ]]; then
echo "OK IPv6"
elif [[ $freshPublicIP =~ ^([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ ]]; then
echo "OK IPv4"
else
echo "FAIL - not an IPv4 or IPv6 address"
freshPublicIP=""
fi
if [ ${#freshPublicIP} -eq 0 ]; then
echo "freshPublicIP is ZERO - ignoring"

18
home.admin/_bootstrap.provision.sh

@ -156,12 +156,18 @@ else
echo "Provisioning TOR - keep default" >> ${logFile}
fi
# CUSTOM LND PORT
# if a custom LND port was set, then run config for that
portNumber=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=" | cut -f2 -d':')
if [ ${#portNumber} -gt 0 ]; then
echo "Provisioning Custom LND Port ${portNumber}- run config script" >> ${logFile}
sudo /home/admin/config.scripts/lnd.setportsh ${portNumber} >> ${logFile} 2>&1
# CUSTOM PORT
echo "Provisioning LND Port" >> ${logFile}
lndPort=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep "^listen=*" | cut -f2 -d':')
if [ ${#lndPort} -gt 0 ]; then
if [ "${lndPort}" != "9735" ]; then
echo "User is running custom LND port: ${lndPort}" >> ${logFile}
sudo /home/admin/config.scripts/lnd.setport.sh ${lndPort} >> ${logFile} 2>&1
else
echo "User is running standard LND port: ${lndPort}" >> ${logFile}
fi
else
echo "Was not able to get LND port from config." >> ${logFile}
fi
sudo sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile}

35
home.admin/_bootstrap.sh

@ -38,6 +38,12 @@ echo "Running RaspiBlitz Bootstrap ${codeVersion}" >> $logFile
date >> $logFile
echo "***********************************************" >> $logFile
# display 3 secs logo - try to kickstart LCD
# see https://github.com/rootzoll/raspiblitz/issues/195#issuecomment-469918692
sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/raspiblitz/pictures/logoraspiblitz.png
sleep 5
sudo killall -3 fbi
# set default values for raspiblitz.info
network=""
chain=""
@ -58,6 +64,22 @@ if [ "${setupStep}" != "100" ]; then
fi
sudo chmod 777 ${infoFile}
# Emergency cleaning logs when over 1GB (to prevent SD card filling up)
# see https://github.com/rootzoll/raspiblitz/issues/418#issuecomment-472180944
echo "*** Checking Log Size ***"
logsMegaByte=$(sudo du -c -m /var/log | grep "total" | awk '{print $1;}')
if [ ${logsMegaByte} -gt 1000 ]; then
echo "WARN !! Logs /var/log in are bigger then 1GB"
echo "ACTION --> DELETED ALL LOGS"
sudo rm -r /var/log/*
sleep 3
echo "WARN !! Logs in /var/log in were bigger then 1GB and got emergency delete to prevent fillup."
echo "If you see this in the logs please report to the GitHub issues, so LOG config needs to hbe optimized."
else
echo "OK - logs are at ${logsMegaByte} MB - within safety limit"
fi
echo ""
################################
# GENERATE UNIQUE SSH PUB KEYS
# on first boot up
@ -288,6 +310,19 @@ if [ ${configExists} -eq 1 ]; then
# wait otherwise looking for publicIP fails
sleep 5
freshPublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php)
# sanity check on IP data
# see https://github.com/rootzoll/raspiblitz/issues/371#issuecomment-472416349
echo "-> sanity check of IP data: ${freshPublicIP}"
if [[ $freshPublicIP =~ ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$ ]]; then
echo "OK IPv6"
elif [[ $freshPublicIP =~ ^([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ ]]; then
echo "OK IPv4"
else
echo "FAIL - not an IPv4 or IPv6 address"
freshPublicIP=""
fi
if [ ${#freshPublicIP} -eq 0 ]; then
# prevent having no publicIP set at all and LND getting stuck
# https://github.com/rootzoll/raspiblitz/issues/312#issuecomment-462675101

2
home.admin/_version.info

@ -1,2 +1,2 @@
# RaspiBlitz Version - always [main].[sub]
codeVersion="1.0"
codeVersion="1.1"

2
home.admin/assets/RTL.service

@ -12,6 +12,8 @@ User=root
Restart=always
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal
[Install]
WantedBy=multi-user.target

2
home.admin/assets/bitcoind.service

@ -18,6 +18,8 @@ KillMode=process
Restart=always
TimeoutSec=120
RestartSec=30
StandardOutput=null
StandardError=journal
[Install]
WantedBy=multi-user.target

1
home.admin/assets/bootstrap.service

@ -12,6 +12,7 @@ Type=oneshot
RemainAfterExit=true
ExecStart=/home/admin/_bootstrap.sh
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target

2
home.admin/assets/lnd.bitcoin.conf

@ -1,7 +1,7 @@
# lnd configuration
[Application Options]
debuglevel=debug
debuglevel=info
maxpendingchannels=5
alias=raspiblitz
color=#68F442

2
home.admin/assets/lnd.litecoin.conf

@ -1,7 +1,7 @@
# lnd configuration
[Application Options]
debuglevel=debug
debuglevel=info
maxpendingchannels=5
alias=raspiblitz
color=#68F442

2
home.admin/assets/lnd.service

@ -20,6 +20,8 @@ KillMode=process
TimeoutSec=180
Restart=always
RestartSec=60
StandardOutput=null
StandardError=journal
[Install]
WantedBy=multi-user.target

35
home.admin/config.scripts/bonus.rtl.sh

@ -29,9 +29,6 @@ sudo systemctl stop RTL 2>/dev/null
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "*** INSTALL RTL ***"
# setting value in raspi blitz config
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=on/g" /mnt/hdd/raspiblitz.conf
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service')
if [ ${isInstalled} -eq 0 ]; then
@ -42,18 +39,42 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo apt-get install -y nodejs
echo ""
# check if nodeJS was installed
nodeJSInstalled=$(node -v | grep -c "v11.")
if [ nodeJSInstalled -eq 0 ]; then
echo "FAIL - Was not able to install nodeJS 11"
echo "ABORT - RTL install"
exit 1
fi
# download source code and set to tag release
echo "*** Get the RTL Source Code ***"
git clone https://github.com/ShahanaFarooqui/RTL.git
cd RTL
git reset --hard v0.2.1
#git reset --hard v0.1.14-alpha
git reset --hard v0.2.15
# check if node_modles exists now
if [ -d "/home/admin/RTL" ]; then
echo "OK - RTL code copy looks good"
else
echo "FAIL - code copy did not run correctly"
echo "ABORT - RTL install"
exit 1
fi
echo ""
# install
echo "*** Run: npm install ***"
npm install
cd ..
# check if node_modles exists now
if [ -d "/home/admin/RTL/node_modules" ]; then
echo "OK - RTL install looks good"
else
echo "FAIL - npm install did not run correctly"
echo "ABORT - RTL install"
exit 1
fi
echo ""
# prepare RTL.conf file
@ -77,10 +98,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo sed -i "s|chain/bitcoin/mainnet|chain/${network}/${chain}net|" /etc/systemd/system/RTL.service
sudo systemctl enable RTL
echo "OK - RTL is now ACTIVE"
else
echo "RTL already installed."
fi
# setting value in raspi blitz config
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=on/g" /mnt/hdd/raspiblitz.conf
echo "needs reboot to activate new setting"
exit 0
fi

6
home.admin/config.scripts/lnd.newtlscert.sh

@ -5,8 +5,10 @@
echo "making sure services are not running"
sudo systemctl stop lnd 2>/dev/null
echo "deleting TLSCert"
sudo rm /mnt/hdd/lnd/tls.* 2>/dev/null
echo "keep old tls data as backup"
sudo mv /mnt/hdd/lnd/tls.cert /mnt/hdd/lnd/tls.cert.old
sudo mv /mnt/hdd/lnd/tls.key /mnt/hdd/lnd/tls.key.old
echo "let lnd generate new TLSCert"
sudo -u bitcoin /usr/local/bin/lnd &>/dev/null &
echo "wait until generated"

151
home.admin/config.scripts/lnd.rescue.sh

@ -0,0 +1,151 @@
#!/bin/bash
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "small rescue script to to backup or restore"
echo "lnd.rescue.sh [backup|restore]"
exit 1
fi
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
mode="$1"
if [ ${mode} = "backup" ]; then
################################
# BACKUP
################################
echo "*** LND.RESCUE --> BACKUP"
# stop LND
echo "Stopping lnd..."
sudo systemctl stop lnd
sleep 5
echo "OK"
echo
# zip it
sudo tar -zcvf /home/admin/lnd-rescue.tar.gz /mnt/hdd/lnd
sudo chown admin:admin /home/admin/lnd-rescue.tar.gz
# name with md5 checksum
md5checksum=$(md5sum /home/admin/lnd-rescue.tar.gz | head -n1 | cut -d " " -f1)
mv /home/admin/lnd-rescue.tar.gz /home/admin/lnd-rescue-${md5checksum}.tar.gz
# offer SCP for download
echo
echo "****************************"
echo "* DOWNLOAD THE BACKUP FILE *"
echo "****************************"
echo
echo "RUN THE FOLLOWING COMMAND ON YOUR LAPTOP IN NEW TERMINAL:"
echo "scp -r admin@${localip}:/home/admin/lnd-rescue-*.tar.gz ./"
echo ""
echo "Use password A to authenticate file transfere."
echo
echo "BEWARE: Your Lightning node is now stopped. So its safe to backup the data and restore it"
echo "later on - for example on a fresh RaspiBlitz. But once this Lightning node gets started"
echo "again by 'sudo systemctl start lnd' or a reboot its not adviced to restore the backup file"
echo "anymore bacause it cointains outdated channel data and can lead to loss of channel funds."
elif [ ${mode} = "restore" ]; then
################################
# RESTORE
################################
echo "*** LND.RESCUE --> RESTORE"
echo ""
filename=""
while [ ${#filename} -eq 0 ]
do
countZips=$(sudo ls /home/admin/lnd-rescue-*.tar.gz 2>/dev/null | grep -c 'lnd-rescue')
if [ ${countZips} -lt 1 ]; then
echo "**************************"
echo "* UPLOAD THE BACKUP FILE *"
echo "**************************"
echo
echo "If you have a lnd-rescue backup file on your laptop you can now"
echo "upload it and restore the your old LND state."
echo
echo "To make upload open a new terminal on your laptop,"
echo "change into the directory where your lnd-rescue file is and"
echo "COPY, PASTE AND EXECUTE THE FOLLOWING COMMAND:"
echo "scp -r ./lnd-rescue-*.tar.gz admin@${localip}:/home/admin/"
echo ""
echo "Use password A to authenticate file transfere."
echo
echo "PRESS ENTER when upload is done. Use CTRL-C to abort."
fi
if [ ${countZips} -gt 1 ]; then
echo "!! WARNING !!"
echo "There are multiple lnd-rescue files in directory /home/admin."
echo "Make sure there is only one file to work with and start again."
echo
exit 1
fi
if [ ${countZips} -eq 1 ]; then
clear
echo
echo "**************************"
echo "* RESTORING BACKUP FILE *"
echo "**************************"
echo
filename=$(sudo ls /home/admin/lnd-rescue-*.tar.gz)
echo "OK -> found file to restore: ${filename}"
md5checksum=$(md5sum ${filename} | head -n1 | cut -d " " -f1)
isCorrect=$(echo ${filename} | grep -c ${md5checksum})
if [ ${isCorrect} -eq 1 ]; then
echo "OK -> checksum looks good: ${md5checksum}"
else
echo "!!! FAIL -> Checksum not correct."
echo "Maybe transfere failed? Continue on your own risk!"
echo "Recommend to abort and upload again!"
fi
echo
echo "WARNING: This will delete the actual LND state/funds of this RaspiBlitz."
echo
echo "PRESS ENTER to start restore. Use CTRL-C to abort."
fi
read key
done
# stop LND
echo "Stopping lnd..."
sudo systemctl stop lnd
sleep 5
echo "OK"
echo
# clean DIR
echo "Cleaning LND data ..."
sudo rm -r /mnt/hdd/lnd/*
echo "OK"
echo
# unpack zip
echo "Restoring LND data from ${filename} ..."
sudo tar -xf ${filename} -C /
sudo chown -R bitcoin:bitcoin /mnt/hdd/lnd
echo "OK"
echo
# start LND
echo "Starting lnd..."
sudo systemctl start lnd
echo "OK"
echo
echo "DONE - please check if LND starts up correctly with restored state and funds."
echo "Keep in mind that some channels got forced closed by channel partners in the meanwhile."
echo
else
echo "unknown parameter '${mode}' - exit"
fi

BIN
pictures/logoraspiblitz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
raspiblitz-v1.1-2019-03-18.torrent

Binary file not shown.

2
shoppinglist_au.md

@ -2,7 +2,7 @@
## Shopping List: Amazon Australia
* RaspBerry Pi 3: https://www.amazon.com/RS-Components-Raspberry-Pi-Motherboard/dp/B07BFH96M3
* Micro SD-Card 16GB: https://www.amazon.com/SanDisk-Mobile-MicroSDHC-SDSDQM-B35A-Adapter/dp/B004ZIENBA
* Micro SD-Card 32GB: https://www.amazon.com/Samsung-Endurance-32GB-Micro-Adapter/dp/B07B98GXQT
* Power: https://www.amazon.com.au/Ils-Supply-Adapter-Charger-Raspberry/dp/B07F2JLSCL/
* 1TB Hard Drive: https://www.amazon.com/Toshiba-Advance-Portable-External-HDTC910XR3AA/dp/B079H7VYY6
* Case: https://www.amazon.com/Raspberry-Model-Protective-Heatsinks-Clear/dp/B01CDVSBPO

2
shoppinglist_ca.md

@ -1,7 +1,7 @@
## Shopping List: Amazon Canada
* RaspBerry Pi 3: https://amzn.to/2NDLD31
* Micro SD-Card 16GB: https://amzn.to/2NEXWMa
* Micro SD-Card 32GB: https://www.amazon.ca/Samsung-Endurance-Micro-Adapter-MB-MJ32GA/dp/B07DTFRNRJ
* Power: https://amzn.to/2NCdCju
* 1TB Hard Drive: https://amzn.to/2NF0lqj
* LCD-Display + Case + Pen: https://amzn.to/2GWx3D8

4
shoppinglist_cz.md

@ -1,9 +1,9 @@
## Shopping List: Amazon/Alza/CZC Czech
- RaspBerry Pi 3: https://www.alza.cz/raspberry-pi-3-model-b-d5284636.htm?o=1
- Micro SD-Card 16GB: https://www.alza.cz/EN/kingston-micro-sdhc-16gb-class-10-uhs-i-industrial-temp-sd-adapter?dq=4156874&o=2
- Micro SD-Card 32GB: https://www.alza.cz/EN/samsung-microsdhc-32gb-pro-endurance-uhs-i-u1-sd-adapter-d5339757.htm
- Power: https://www.alza.cz/EN/alzapower-q100-quick-charge-3-0-black-d5324257.htm?o=2
- maybe you need an micro usb cable
- 1TB Hard Drive: https://www.czc.cz/toshiba-canvio-basics-1tb-cerna/235949/produkt?gclid=EAIaIQobChMIgpLF5Mac3gIVCM53Ch3D9QWpEAQYAyABEgK-ZfD_BwE
- Case: https://www.alza.cz/EN/raspberry-pi-black-d3837597.htm?o=1
- LCD-Display (delivered to Czech Republic): https://www.amazon.com/dp/B01N3JROH8/ref=cm_sw_r_cp_ep_dp_-gOuBb2Q6T0C5
- LCD-Display (delivered to Czech Republic): https://www.amazon.com/dp/B01N3JROH8/ref=cm_sw_r_cp_ep_dp_-gOuBb2Q6T0C5

2
shoppinglist_de.md

@ -1,7 +1,7 @@
## Shopping List: Amazon Germany
* RaspBerry Pi 3: https://www.amazon.de/dp/B07BDR5PDW
* Micro SD-Card 16GB: https://www.amazon.de/gp/product/B073K14CVB/
* Micro SD-Card 32GB: https://www.amazon.de/Samsung-MB-MJ32GA-EU-microSDXC-Endurance
* Power >=3A: https://www.amazon.de/gp/product/B01JZE38QE
* 1TB Hard Drive: https://www.amazon.de/dp/B07997KKSK?th=1
* Case: https://www.amazon.de/dp/B0173GQF8Y

2
shoppinglist_es.md

@ -1,7 +1,7 @@
## Shopping List: Amazon Spain
* RaspBerry Pi 3: https://www.amazon.es/gp/product/B07BDR5PDW/
* Micro SD-Card 16GB: https://www.amazon.es/gp/product/B073K14CVB/
* Micro SD-Card 32GB: https://www.amazon.es/Samsung-Pro-Endurance-microSDHC-Adaptador/dp/B07CY3QSST
* Power: https://www.amazon.es/gp/product/B01JZE38QE
* 1TB Hard Drive: https://www.amazon.es/gp/product/B07997KKSK/
* Case: https://www.amazon.es/gp/product/B07DK4CRHS/

2
shoppinglist_fr.md

@ -1,7 +1,7 @@
## Shopping List: Amazon France
* RaspBerry Pi 3: https://www.amazon.fr/dp/B07BDR5PDW
* Micro SD-Card 16GB: https://www.amazon.fr/dp/B073K14CVB/
* Micro SD-Card 32GB: https://www.amazon.fr/SANDISK-Adaptateur-Logiciel-Récupération-RescuePRO/dp/B06XWMQ81P/
* Power: https://www.amazon.fr/dp/B01566WOAG
* 1TB Hard Drive: https://www.amazon.fr/dp/B07997KKSK
* Case: https://www.amazon.fr/dp/B0173GQF70/

2
shoppinglist_uk.md

@ -1,7 +1,7 @@
## Shopping List: Amazon UK
* RaspBerry Pi 3: https://www.amazon.co.uk/Raspberry-Pi-Model-64-Bit-Processor/dp/B07BDR5PDW
* Micro SD-Card 16GB: https://www.amazon.co.uk/Kingston-SDC10G2-16GB-microSDHC-Included/dp/B0162YQEIE
* Micro SD-Card 32GB: https://www.amazon.co.uk/Samsung-Endurance-MicroSDHC-Memory-Adapter/dp/B07CY3QSST
* Power: https://www.amazon.co.uk/iTrunk-Raspberry-Model-Supply-Charger/dp/B01MFFSPHE or https://www.amazon.co.uk/dp/B07MLZQXS7
* 1TB Hard Drive: https://www.amazon.co.uk/Toshiba-Canvio-Basics-Portable-External/dp/B00KWHJY7Q
* Case: https://www.amazon.co.uk/SB-Components-Transparent-Case-Raspberry/dp/B0173GQF8Y

2
shoppinglist_usa.md

@ -1,7 +1,7 @@
## Shopping List: Amazon USA
* RaspBerry Pi 3: http://a.co/ahl7RIp
* Micro SD-Card 16GB: http://a.co/d/710f4oJ
* Micro SD-Card 32GB: https://www.amazon.com/Samsung-Endurance-32GB-Micro-Adapter/dp/B07B98GXQT
* Power: http://a.co/d/fVVOYZZ
* 1TB Hard Drive: http://a.co/eUgVfLd
* Case: http://a.co/1774Hwl

Loading…
Cancel
Save