Browse Source
* master: (84 commits) added buttit points change to bash fixed string compare fix missing end if #163 LCD IP info #134 adapt RTL.service chain & network mute error lock unlock info on LCD RTL uninstall option more height for dialog dump error meaasge added RTL to main menu install warning ip info on fail bug fix and more doc output install script for RTL #134 detecting bitcoin warmup time #65 for admin updated Czech shopping list shopping list australia with 3A power and linked to main README more info on edge cases in issue #152 ...#146
Patrick Pachur
6 years ago
39 changed files with 10556 additions and 8965 deletions
@ -0,0 +1,150 @@ |
|||
# Background: Blockchain Download |
|||
|
|||
## Why do we need to download the blockchain and not syncing it? |
|||
|
|||
The RaspiBlitz is powered by the RaspberryPi. The processing power of this SingleBoardComputer is too low to make a fast sync of the blockchain from the bitcoin peer to peer network during setup process (validation). To sync and index the complete blockchain could take weeks or even longer. Thats why the RaspiBlitz needs to download a prepared blockchain from another source. |
|||
|
|||
## Is downloading the blockchain secure? |
|||
|
|||
The downloaded Blockchain is pre-indexed and pre-validated. That is secure enough because if the user gets a "manipulated" blockchain it would not work after setup. The beginning of the downloaded blockchain needs to fit the genesis block (in bitcoind software) and the end of the downloaded blockchain needs not match with the rest of the bitcoin network state - hashes of new block distrubuted within the peer-2-peer network need to match the downloaded blockchain head. So if you downloaded a manipulated blockchain it would simply just dont work in practice. |
|||
|
|||
There might be theoretical scenarios why it would be bad for the whole network if anybody is downloading a prepared blockchain and not syncing and self-validating every block, but with a lot of self-validating full nodes already out there, just putting some RaspiBlitz with a downloaded blockchain into the mix and runnig as a self-valifating full node from that point on, is practically just strengthening the the overall network. And dont forget, the most important part of running a full node is to validate the new blocks summited by the miners - to balance out there power and to keep the Bitcoin network running by our rules. |
|||
|
|||
If you have any link to a more detailed discussion of this topic, please add it here for people to do their own research. |
|||
|
|||
## Blockchain Data |
|||
|
|||
The RaspiBlitz needs the following files from a bitcoind (>=0.17.0) that is fully sync and has indexing switched on (txindex=1) - all files from the directories: |
|||
``` |
|||
/blocks |
|||
/chainstate |
|||
/indexes |
|||
``` |
|||
|
|||
Make sure not to add other files like wallet data or lock files to a prepared download. |
|||
|
|||
You might want to include the testnet data also - then add the testnet3 folder that just contains the same three folders from the testnet blockchain. |
|||
|
|||
On download all those files need to be placed finally in the /mnt/hdd/bitcoin folder of the RaspiBlitz. |
|||
|
|||
## Download Process |
|||
|
|||
At the moment the RaspiBlitz offers two technical ways to download the blockchain: |
|||
|
|||
### FTP Download (fallback) |
|||
|
|||
The easiest way is to put the blockchain data on a FTP server and let people download it. FTP is able to download complete directories - HTTP can just handle single file. FTP clients and server hosting is widly available. |
|||
|
|||
The downside that this is a central point solution and is hard to scale up (without spending a lot of money). But it is available as a backup, if other solutions do not work. |
|||
|
|||
### Torrent Download (default) |
|||
|
|||
The preferred way is to to download the blockchain data thru the peer2peer torrent network. This way the community can help to seed the torrents (at least while downloading). Supporters of the project can setup constant seeding. There is no single point of failure within the download structure. |
|||
|
|||
In the beginning we used just on torrent file - containing all the directories and data like mentioned above. But this had the downside, that everytime when we update the torrent the seeding is bad in the beginning and downloads are slow. Good seeding needs time to build up. |
|||
|
|||
Thats why there are two torrent files now: |
|||
|
|||
#### 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. |
|||
|
|||
At the moment this is just the blk and rev files up to the number: |
|||
- /blocks : 01385 |
|||
- /testnet3/blocks: 00152 |
|||
|
|||
#### Update Torrent File (Description) |
|||
|
|||
All the rest of the files get packaged into a second torrent file. This file will be updated much more often. The seeding is expected to be not that good and download may be slower, but thats OK because its a much smaller file. |
|||
|
|||
This way a good balance between good seeding and up-to-date blockchain can be reached. |
|||
|
|||
#### Update Torrent File (Creation) |
|||
|
|||
To create the Update Torrent file, follow the following step ... |
|||
|
|||
Have a almost 100% synced bitcoind MAINNET with txindex=1 on a RaspiBlitz |
|||
|
|||
Stop bitcoind with: |
|||
``` |
|||
sudo systemctl stop bitcoind |
|||
``` |
|||
|
|||
Delete base torrent blk-files with: |
|||
``` |
|||
sudo rm /mnt/hdd/bitcoin/blocks/blk00*.dat |
|||
sudo rm /mnt/hdd/bitcoin/blocks/blk0{1000..1390}.dat |
|||
``` |
|||
|
|||
Delete base torrent rev-files with: |
|||
``` |
|||
sudo rm /mnt/hdd/bitcoin/blocks/rev00*.dat |
|||
sudo rm /mnt/hdd/bitcoin/blocks/rev0{1000..1390}.dat |
|||
``` |
|||
|
|||
Now change to your computer where you package the torrent files and transfere the three directories into your torrent base directory (should be your current working directory): |
|||
``` |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/blocks ./blocks |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/chainstate ./chainstate |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/indexes ./indexes |
|||
``` |
|||
|
|||
Also have a almost 100% synced bitcoind TESTNET with txindex=1 on a RaspiBlitz |
|||
|
|||
Stop bitcoind with: |
|||
``` |
|||
sudo systemctl stop bitcoind |
|||
``` |
|||
|
|||
Delete base torrent blk-files with: |
|||
``` |
|||
sudo rm /mnt/hdd/bitcoin/testnet3/blocks/blk000*.dat |
|||
sudo rm /mnt/hdd/bitcoin/testnet3/blocks/blk00{100..152}.dat |
|||
``` |
|||
|
|||
Delete base torrent rev-files with: |
|||
``` |
|||
sudo rm /mnt/hdd/bitcoin/testnet3/blocks/rev000*.dat |
|||
sudo rm /mnt/hdd/bitcoin/testnet3/blocks/rev00{100..152}.dat |
|||
``` |
|||
|
|||
Now change again to your computer where you package the torrent files and transfere the three directories into your torrent base directory (should be your current working directory): |
|||
``` |
|||
mkdir testnet3 |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/testnet3/blocks ./testnet3/blocks |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/testnet3/chainstate ./testnet3/chainstate |
|||
scp -r bitcoin@[RaspiBlitzIP]:/mnt/hdd/bitcoin/testnet3/indexes ./testnet3/indexes |
|||
``` |
|||
|
|||
(Re-)name the "torrent base directory" to the same name as the torrent UPDATE file itself later (without the .torrent ending). For the correct naming see the chapter "Torrent Files Naming Schema" below. |
|||
|
|||
Now open your torrent client (e.g. qTorrent for OSX) and create a new torrent-file with the freshly renamed "torrent base directory" as source directory. |
|||
|
|||
Add this list of trackers to your torrent and start seeding (keep a free/empty line between the three single trackers): |
|||
``` |
|||
udp://tracker.justseed.it:1337 |
|||
|
|||
udp://tracker.coppersurfer.tk:6969/announce |
|||
|
|||
udp://open.demonii.si:1337/announce |
|||
|
|||
udp://denis.stalker.upeer.me:6969/announce |
|||
``` |
|||
|
|||
Name the new torrent file |
|||
|
|||
To create the torrent file can take some time. Finally add the generated torrent file to the /home.admin/assets/ of the github and change the name of the updateTorrent varibale file in the script 50torrentHDD.bitcoin.sh |
|||
|
|||
#### Torrent Files Naming Schema |
|||
|
|||
The base torrent file should always have the following naming scheme: |
|||
|
|||
`raspiblitz-[CHAINNETWORK][BASEITERATIONNUMBER]-[YEAR]-[MONTH]-[DAY]-base.torrent` |
|||
|
|||
So for example the second version of the base torrent for litecoin created on 2018-10-31 would have this name: raspiblitz-litecoin2-2018-10-31-base.torrent |
|||
|
|||
The update torrentfile should always have the following naming schema: |
|||
|
|||
`raspiblitz-[CHAINNETWORK][BASEITERATIONNUMBER]-[YEAR]-[MONTH]-[DAY]-update.torrent` |
|||
|
|||
So for exmaple an update torrent created on 2018-12-24 for litecoin that is an update to the second base torrent version would have this name: raspiblitz-litecoin2-2018-12-24-update.torrent |
@ -0,0 +1,43 @@ |
|||
# Background: RaspiBlitz Settings |
|||
|
|||
## Before Version 1.0 |
|||
|
|||
The RaspiBlitz started as small collection of shell scripts to setup a bitcoin+lightning node. At this time it was not needed to have settings file. The idea was that the scripts analyse the system state and make the changes required - automatically trying to catch up. That was OK as long RaspiBlitz was just a helper to setup your Lightning node and the rest was up to you. |
|||
|
|||
Over time users that are running a RaspiBlitz expected that it can handle more complex setup and customization. Also it should be easy to update the system (exchange sd card with a newer image) and should be able to have the same configuration afterwards - keeping its state. Thats why starting from version 1.0 there will be a raspiblitz config file stored on the HDD that stores stores the config state. |
|||
|
|||
## The Config File |
|||
|
|||
The RaspiBlitz config file is stored on the HDD root: |
|||
|
|||
`/mnt/hdd/raspiblitz.conf` |
|||
|
|||
Its simple structure is: one key-value pair per line. In the end its bash-script syntax to define varibales. The RaspiBlitz shell scripts can import this file with: |
|||
|
|||
`source /mnt/hdd/raspiblitz.conf` |
|||
|
|||
After this line all the config values are available and can be worked with. I prefer to call this line in scripts explicitly and not setting this values as environment variables, because when you read as a newbie such a script, you get an idea where the config file is stored. |
|||
|
|||
## The Config Values |
|||
|
|||
So see what config parameters are available check the comments in the following script: |
|||
|
|||
`/home/admin/_bootstrap.sh` |
|||
|
|||
## Adding new Config Values |
|||
|
|||
If you extend the RaspiBlitz scripts and you have the need to add a new config key-value add it to the `/home/admin/00enforceConfig.sh` script. There is a section for default values and setting them in the config file, if they dont exist there yet. Because this script runs on every startup, you can be sure that the default value is then available to your extended script - especially if people update their system. |
|||
|
|||
## Bootstrap Service: Enforcing the Config |
|||
|
|||
On every start of the RaspiBlitz take the config file and check if the system is running as stated in the config file and when needed make changes to the system. This is done by calling this script on startup with systemd: |
|||
|
|||
`/home/admin/_bootstrap.sh` |
|||
|
|||
So if you change the config by hand or you write a script that changes the config, then simply trigger a restart the RaspiBliz. |
|||
|
|||
Having this script checking the system on every startup, the user can easily update the SD card with a fresh image and the system will automatically establish the old state. |
|||
|
|||
## What to put into the config file and what not |
|||
|
|||
All values users put into setup or setting dialogs and that is not stored on the HDD (for example in the config files of lnd or bitcoin) is a hot cadidate to put into the raspi config file. Some values make sense to get stored as a duplicate (for performance or easy of access) - but dont get to wild. |
@ -0,0 +1,39 @@ |
|||
#!/bin/bash |
|||
|
|||
# get raspiblitz config |
|||
source /mnt/hdd/raspiblitz.conf |
|||
|
|||
# show select dialog |
|||
CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \ |
|||
1 "Channel Autopilot" ${autoPilot} \ |
|||
2>&1 >/dev/tty) |
|||
#CHOICES=$(dialog --checklist "Activate/Deactivate Services:" 15 40 5 \ |
|||
#1 "Channel Autopilot" ${autoPilot} \ |
|||
#2 "UPnP Router-Portforwarding" ${natUPnP} \ |
|||
#3 "Auto Unlock on Start" ${autoUnlock} \ |
|||
#4 "Seed Torrent Blockchain" ${torrentSeed} \ |
|||
#4 "RTL Webinterface" ${rtlWebinterface} \ |
|||
#2>&1 >/dev/tty) |
|||
dialogcancel=$? |
|||
clear |
|||
|
|||
# check if user canceled dialog |
|||
if [ ${dialogcancel} -eq 1 ]; then |
|||
echo "user canceled" |
|||
exit 1 |
|||
fi |
|||
|
|||
# AUTOPILOT process choice |
|||
choice="off"; check=$(echo "${CHOICES}" | grep -c "1") |
|||
if [ ${check} -eq 1 ]; then choice="on"; fi |
|||
sudo sed -i "s/^autoPilot=.*/autoPilot=${choice}/g" /mnt/hdd/raspiblitz.conf |
|||
|
|||
# confirm reboot to activate new settings with bootstrap.service |
|||
dialog --backtitle "Rebooting" --yesno "To activate the settings a reboot is needed." 6 52 |
|||
if [ $? -eq 0 ];then |
|||
echo "Starting Reboot .." |
|||
sudo shutdown -r now |
|||
else |
|||
echo "No Reboot - changes stored, but maybe not active." |
|||
sleep 3 |
|||
fi |
@ -0,0 +1,97 @@ |
|||
#!/bin/sh |
|||
|
|||
# INSTALLING THE RTL Webinterface from |
|||
# https://github.com/ShahanaFarooqui/RTL/blob/master/README.md |
|||
|
|||
# get the local network IP to be displayed on the lCD |
|||
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') |
|||
|
|||
# load network |
|||
network=`sudo cat /home/admin/.network` |
|||
|
|||
# get chain |
|||
chain="test" |
|||
isMainChain=$(sudo cat /mnt/hdd/${network}/${network}.conf 2>/dev/null | grep "#testnet=1" -c) |
|||
if [ ${isMainChain} -gt 0 ];then |
|||
chain="main" |
|||
fi |
|||
|
|||
echo "*** Check if RTL is installed ***" |
|||
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service') |
|||
if [ ${isInstalled} -eq 1 ]; then |
|||
|
|||
echo "*** Dialog ***" |
|||
dialog --title "Deinstall: Ride The Lightning Web Interface" --yesno "RTL is installed. You you want to remove?" 5 50 |
|||
response=$? |
|||
case $response in |
|||
1) exit 1 ;; |
|||
esac |
|||
clear |
|||
|
|||
echo "*** REMOVING RTL ***" |
|||
sudo systemctl stop RTL |
|||
sudo systemctl disable RTL |
|||
sudo rm /etc/systemd/system/RTL.service |
|||
sudo rm -r /home/admin/RTL |
|||
echo "OK done." |
|||
exit 1 |
|||
fi |
|||
|
|||
echo "*** Dialog ***" |
|||
dialog --title "Install: Ride The Lightning Web Interface" --yesno "This is still experimental and very reckless:\nOnce your wallet is unlocked EVERYBODY in your\nLOCAL NETWORK can CONTROL YOUR NODE with RTL!\nDo you really want to install RTL?" 8 50 |
|||
response=$? |
|||
case $response in |
|||
1) exit 1 ;; |
|||
esac |
|||
clear |
|||
|
|||
# disable RPC listen |
|||
# to prevent tls cer auth error |
|||
echo "*** Modify lnd.conf ***" |
|||
sudo sed -i "s/^rpclisten=0.0.0.0:10009/#rpclisten=0.0.0.0:10009/g" /mnt/hdd/lnd/lnd.conf |
|||
sudo systemctl restart lnd |
|||
echo "" |
|||
|
|||
# install latest nodejs |
|||
echo "*** Install NodeJS ***" |
|||
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - |
|||
sudo apt-get install -y nodejs |
|||
echo "" |
|||
|
|||
# close source code |
|||
echo "*** Get the RTL Source Code ***" |
|||
git clone https://github.com/ShahanaFarooqui/RTL.git |
|||
cd RTL |
|||
npm install |
|||
cd .. |
|||
echo "" |
|||
|
|||
# open firewall |
|||
echo "*** Updating Firewall ***" |
|||
sudo ufw allow 3000 |
|||
sudo ufw --force enable |
|||
echo "" |
|||
|
|||
# install service |
|||
echo "*** Install RTL systemd for ${network} on ${chain} ***" |
|||
sudo cp /home/admin/assets/RTL.service /etc/systemd/system/RTL.service |
|||
sudo sed -i "s|chain/bitcoin/mainnet|chain/${network}/${chain}net|" /etc/systemd/system/RTL.service |
|||
sudo systemctl enable RTL |
|||
sudo systemctl start RTL |
|||
sleep 2 |
|||
echo "" |
|||
|
|||
# install service |
|||
echo "*** READY ***" |
|||
echo "RTL web servcie should be installed and running now." |
|||
echo "" |
|||
echo "Try to open the following URL in your local webrowser" |
|||
echo "and unlock your wallet from there with PASSWORD C." |
|||
echo "---> http://${localip}:3000" |
|||
echo "" |
|||
echo "RTL web server will now start with every new boot." |
|||
echo "Always unlock your wallet from there now." |
|||
echo "Just use RTL from same local network, DONT forward" |
|||
echo "port 3000 on your internet router to the RaspiBlitz." |
|||
echo "" |
|||
echo "Have fun 'Riding the Lightning' (RTL) :D" |
@ -0,0 +1,140 @@ |
|||
#!/bin/bash |
|||
|
|||
# This script runs on every start calles by boostrap.service |
|||
# It makes sure that the system is configured like the |
|||
# default values or as in the config. |
|||
# For more details see background_raspiblitzSettings.md |
|||
|
|||
# load codeVersion |
|||
source /home/admin/_version.info |
|||
|
|||
logfile="/home/admin/raspiblitz.log" |
|||
echo "Writing logs to: ${logfile}" |
|||
echo "" > $logfile |
|||
echo "***********************************************" >> $logfile |
|||
echo "Running RaspiBlitz Bootstrap ${codeVersion}" >> $logfile |
|||
date >> $logfile |
|||
echo "***********************************************" >> $logfile |
|||
|
|||
|
|||
################################ |
|||
# AFTER BOOT SCRIPT |
|||
# when a process needs to |
|||
# execute stuff after a reboot |
|||
# /home/admin/setup.sh |
|||
################################ |
|||
|
|||
# check for after boot script |
|||
afterSetupScriptExists=$(ls /home/admin/setup.sh 2>/dev/null | grep -c setup.sh) |
|||
if [ ${afterSetupScriptExists} -eq 1 ]; then |
|||
echo "*** SETUP SCRIPT DETECTED ***" |
|||
# echo out script to journal logs |
|||
sudo cat /home/admin/setup.sh |
|||
# execute the after boot script |
|||
sudo /home/admin/setup.sh |
|||
# delete the after boot script |
|||
sudo rm /home/admin/setup.sh |
|||
# reboot again |
|||
echo "DONE wait 6 secs ... one more reboot needed ... " |
|||
sudo shutdown -r now |
|||
sleep 100 |
|||
fi |
|||
|
|||
|
|||
################################ |
|||
# PUBLIC IP |
|||
# for LND on startup |
|||
################################ |
|||
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip; |
|||
chmod 774 /run/publicip |
|||
|
|||
|
|||
################################ |
|||
# HDD CHECK / INIT |
|||
# for the very first setup |
|||
################################ |
|||
|
|||
# check if the HDD is mounted |
|||
hddAvailable=$(ls -la /mnt/hdd 2>/dev/null) |
|||
if [ ${#hddAvailable} -eq 0 ]; then |
|||
echo "HDD is NOT available" >> $logfile |
|||
echo "TODO: Try to mount." |
|||
exit 1 |
|||
fi |
|||
|
|||
################################ |
|||
# CONFIGFILE BASICS |
|||
################################ |
|||
|
|||
# check if there is a config file |
|||
configFile="/mnt/hdd/raspiblitz.conf" |
|||
configExists=$(ls ${configFile} 2>/dev/null | grep -c '.conf') |
|||
if [ ${configExists} -eq 0 ]; then |
|||
|
|||
# create new config |
|||
echo "creating config file: ${configFile}" >> $logfile |
|||
echo "# RASPIBLITZ CONFIG FILE" > $configFile |
|||
echo "raspiBlitzVersion='${version}'" >> $configFile |
|||
sudo chmod 777 ${configFile} |
|||
|
|||
else |
|||
|
|||
# load & check config version |
|||
source $configFile |
|||
if [ "${raspiBlitzVersion}" != "${raspiBlitzVersion}" ]; then |
|||
echo "detected version change ... starting migration script" >> $logfile |
|||
/home/admin/_migrateVersion.sh |
|||
fi |
|||
|
|||
fi |
|||
|
|||
################################ |
|||
# DEFAULT VALUES |
|||
################################ |
|||
|
|||
# AUTOPILOT |
|||
# autoPilot=off|on |
|||
if [ ${#autoPilot} -eq 0 ]; then |
|||
echo "autoPilot=off" >> $configFile |
|||
fi |
|||
|
|||
# after all default values written to config - reload config |
|||
source $configFile |
|||
|
|||
|
|||
################################ |
|||
# AUTOPILOT |
|||
################################ |
|||
|
|||
echo "" >> $logfile |
|||
echo "** AUTOPILOT" >> $logfile |
|||
|
|||
# check if LND is installed |
|||
lndExists=$(ls /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep -c '.conf') |
|||
if [ ${lndExists} -eq 1 ]; then |
|||
|
|||
# check if autopilot is active in LND config |
|||
lndAutopilot=$( grep -c "autopilot.active=1" /mnt/hdd/lnd/lnd.conf ) |
|||
echo "confAutopilot(${autoPilot})" >> $logfile |
|||
echo "lndAutopilot(${lndAutopilot})" >> $logfile |
|||
|
|||
# switch on |
|||
if [ ${lndAutopilot} -eq 0 ] && [ "${autoPilot}" = "on" ]; then |
|||
echo "switching the LND autopilot ON" >> $logfile |
|||
sudo sed -i "s/^autopilot.active=.*/autopilot.active=1/g" /mnt/hdd/lnd/lnd.conf |
|||
fi |
|||
|
|||
# switch off |
|||
if [ ${lndAutopilot} -eq 1 ] && [ "${autoPilot}" = "off" ]; then |
|||
echo "switching the LND autopilot OFF" >> $logfile |
|||
sudo sed -i "s/^autopilot.active=.*/autopilot.active=0/g" /mnt/hdd/lnd/lnd.conf |
|||
fi |
|||
|
|||
else |
|||
|
|||
echo "WARNING: /mnt/hdd/lnd/lnd.conf does not exists. Setup needs to run properly first!" >> $logfile |
|||
|
|||
fi |
|||
|
|||
echo "" >> $logfile |
|||
echo "DONE BOOTSTRAP" >> $logfile |
@ -0,0 +1,17 @@ |
|||
#!/bin/bash |
|||
|
|||
# load codeVersion |
|||
source ./_version.info |
|||
|
|||
# load raspiblitz config |
|||
source /mnt/hdd/raspiblitz.conf |
|||
|
|||
echo "" |
|||
echo "*****************************" |
|||
echo "Version Migration RaspiBlitz" |
|||
echo "*****************************" |
|||
echo "Version Code: ${codeVersion}" |
|||
echo "Version Data: ${raspiBlitzVersion}" |
|||
|
|||
echo "TODO: Update Migration check ..." |
|||
echo "" |
@ -0,0 +1,2 @@ |
|||
# RaspiBlitz Version - always [main].[sub] |
|||
codeVersion="0.95" |
@ -0,0 +1,17 @@ |
|||
# Raspibolt RTL: systemd unit for RTL |
|||
# /etc/systemd/system/RTL.service |
|||
|
|||
[Unit] |
|||
Description=RTL daemon |
|||
Wants=lnd.service |
|||
After=lnd.service |
|||
|
|||
[Service] |
|||
ExecStart=/usr/bin/node /home/admin/RTL/rtl --lndir /home/admin/.lnd/data/chain/bitcoin/mainnet |
|||
User=root |
|||
Restart=always |
|||
TimeoutSec=120 |
|||
RestartSec=30 |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -0,0 +1,16 @@ |
|||
# Boostrap the RaspiBlitz |
|||
# /etc/systemd/system/bootstrap.service |
|||
|
|||
[Unit] |
|||
Description=setting up RaspiBlitz and enforcing the config on every startup |
|||
After=network.target |
|||
|
|||
[Service] |
|||
User=root |
|||
Group=root |
|||
Type=oneshot |
|||
ExecStart=/home/admin/_bootstrap.sh |
|||
StandardOutput=journal |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,20 +0,0 @@ |
|||
# RaspiBolt LND Mainnet: systemd unit for getpublicip.sh script |
|||
# /etc/systemd/system/getpublicip.service |
|||
|
|||
[Unit] |
|||
Description=getpublicip.sh: get public ip address from ipinfo.io |
|||
After=network.target |
|||
|
|||
[Service] |
|||
User=root |
|||
Group=root |
|||
Type=simple |
|||
ExecStart=/usr/local/bin/getpublicip.sh |
|||
ExecStartPost=/bin/sleep 5 |
|||
Restart=always |
|||
|
|||
RestartSec=600 |
|||
TimeoutSec=10 |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,16 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip' |
|||
while [ 0 ]; |
|||
do |
|||
# check if TOR is running |
|||
torExists=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep hostname -c) |
|||
if [ ${torExists} -eq 0 ]; then |
|||
# get and set public IP |
|||
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip; |
|||
else |
|||
# set onion address |
|||
printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip; |
|||
fi |
|||
sleep 600 |
|||
done; |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 244 KiB |
@ -0,0 +1,8 @@ |
|||
The RaspiBlitz software is build and tested for the following Hardware set that you can buy cheap on Amazon.com.au: |
|||
|
|||
* RaspBerry Pi 3 ($38.75): https://www.amazon.com/RS-Components-Raspberry-Pi-Motherboard/dp/B07BFH96M3 |
|||
* Micro SD-Card 16GB ($6.23): https://www.amazon.com/SanDisk-Mobile-MicroSDHC-SDSDQM-B35A-Adapter/dp/B004ZIENBA |
|||
* Power ($21.04): https://www.amazon.com.au/Ils-Supply-Adapter-Charger-Raspberry/dp/B07F2JLSCL/ |
|||
* 1TB Hard Drive($49.99): https://www.amazon.com/Toshiba-Advance-Portable-External-HDTC910XR3AA/dp/B079H7VYY6 |
|||
* Case ($7.50): https://www.amazon.com/Raspberry-Model-Protective-Heatsinks-Clear/dp/B01CDVSBPO |
|||
* LCD-Display ($19.99): https://www.amazon.com/ELEGOO-Raspberry-Display-480x320-Interface/dp/B01N3JROH8 |
@ -0,0 +1,13 @@ |
|||
## Hardware Needed (Alza.cz, Amazon.com and czc.cz Shopping List) |
|||
|
|||
_The RaspiBlitz software is build and tested for the following Hardware set that you can buy cheap on Alza.cz, Amazon.com and czc.cz:_ |
|||
|
|||
- RaspBerry Pi 3 (1.129 Kč) https://www.alza.cz/raspberry-pi-3-model-b-d5284636.htm?o=1 |
|||
- Micro SD-Card 16GB (379 Kč) https://www.alza.cz/EN/kingston-micro-sdhc-16gb-class-10-uhs-i-industrial-temp-sd-adapter?dq=4156874&o=2 |
|||
- Power (399 Kč)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 (1.349 Kč) https://www.czc.cz/toshiba-canvio-basics-1tb-cerna/235949/produkt?gclid=EAIaIQobChMIgpLF5Mac3gIVCM53Ch3D9QWpEAQYAyABEgK-ZfD_BwE |
|||
- Case (159 Kč) https://www.alza.cz/EN/raspberry-pi-black-d3837597.htm?o=1 |
|||
- LCD-Display (450.46 Kč) (delivered to Czech Republic) https://www.amazon.com/dp/B01N3JROH8/ref=cm_sw_r_cp_ep_dp_-gOuBb2Q6T0C5 |
|||
|
|||
**Total Price: 3.865,46 Kč** |
Loading…
Reference in new issue