Merge branch 'v1.6' into add-bonus-zerotier

This commit is contained in:
Christian Rotzoll 2020-06-23 18:50:47 +02:00 committed by GitHub
commit 3a8c208f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 2041 additions and 647 deletions

16
FAQ.md
View File

@ -4,16 +4,20 @@
- Update: Raspberry Pi OS Base Image (May 2020)
- Update: bitcoin-core version 0.20.0-beta [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/)
- Update: litecoin version 0.18.1-beta [details](https://blog.litecoin.org/litecoin-core-v0-18-1-release-233cabc26440)
- Update: LND version 0.10.1-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.10.1-beta)
- Update: Specter Desktop 0.4.1 [details](https://github.com/cryptoadvance/specter-desktop/blob/master/README.md)
- Update: Loop 0.6.3 [details](https://lightning.engineering/posts/2020-05-13-loop-mpp/)
- Update: Loop 0.6.4 [details](https://lightning.engineering/posts/2020-05-13-loop-mpp/)
- Update: BTCPayServer v1.0.4.4+ [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.0.4.4)
- Update: RTL 0.7.1 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.7.1)
- New: Nginx Web Server
- New: Subscriptions Management
- New: IP2Tor Bridge (optional subscription service)
- New: Balance of Satoshis [details](https://github.com/alexbosworth/balanceofsatoshis)
- New: Balance of Satoshis v5.39.4 (with update option) [details](https://github.com/alexbosworth/balanceofsatoshis)
- New: Faraday [details](https://github.com/lightninglabs/faraday)
- New: Let's Encrypt client [details](FAQ.md#how-to-use-the-lets-encrypt-client)
- New: ThunderHub 0.7.1 [details](https://www.thunderhub.io)
- New: ThunderHub v0.8.0 (with update option) [details](https://www.thunderhub.io)
- New: JoininBox (terminal based GUI for JoinMarket) [details](https://github.com/openoms/joininbox)
- Fix: DropBox StaticChannelBackup
- Shoppinglist: 4GB RaspberryPi 4 is now default for Standard Package (will still run with less)
@ -66,7 +70,7 @@ Beside many small improvements and changes, these are most important changes:
- New: Loop (Submarine Swaps Service) [details](https://github.com/lightninglabs/loop)
- New: LNbits (Lightning wallet/accounts System) [details](https://github.com/arcbtc/lnbits)
- New: Fully Noded (iOS) [details](https://apps.apple.com/us/app/fully-noded/id1436425586)
- New: TOR Support to connect mobile Apps
- New: Tor Support to connect mobile Apps
- New: Migration Export/Import (e.g. HDD -> SSD) [details](README.md#import-a-migration-file)
- New: Start without LCD (switch to HDMI) [details](FAQ.md#can-i-run-the-raspiblitz-without-a-displaylcd)
- New: Recovery Sheet (PDF) [details](https://github.com/rootzoll/raspiblitz/raw/v1.4/home.admin/assets/RaspiBlitzRecoverySheet.pdf)
@ -88,12 +92,12 @@ Version 1.3 is using the new Raspbian Buster that is ready to use with the Raspb
- Update: New Torrent files
- New: Logo (see folder raspiblitz/logos)
- New: Sync/Validate Blockchain as default for RP4
- New: Switch on TOR during setup
- New: Switch on Tor during setup
- New: Support Zap Mobile for Android
- New: Repair Options in main menu
- New: UPNP (AutoNAT) support in services menu
- New: LCD rotate 180 degrees in services menu
- Fix: TOR switch on/off
- Fix: Tor switch on/off
- Fix: Zap iOS Mobile Wallet connect
- Fix: Shango Mobile Wallet connect
- Experimental: LCD Touchscreen Support

View File

@ -2,7 +2,7 @@
*Build your own Lightning Node on a RaspberryPi with a nice Display.*
`Version 1.5 with lnd 0.9.2-beta (0.10.0-beta optional) and bitcoin 0.19.1 (or litecoin 0.17.1)`
`Version 1.6 with lnd 0.10.1 and bitcoin 0.20.0 (or litecoin 0.18.1)`
![RaspiBlitz](pictures/raspiblitz.jpg)
@ -22,7 +22,7 @@ As an alternative to the SSH menu the "Ride the Lightning" (RTL) WebUI is availa
There are further Services that can be switched on:
* **TOR** (Run as Hidden Service) [details](https://en.wikipedia.org/wiki/Tor_(anonymity_network)#Onion_services)
* **Tor** (Run as Hidden Service) [details](https://en.wikipedia.org/wiki/Tor_(anonymity_network)#Onion_services)
* **ElectRS** (Electrum Server in Rust) [details](https://github.com/romanz/electrs)
* **BTCPayServer** (Cryptocurrency Payment Processor) [details](https://btcpayserver.org)
* **BTC-RPC-Explorer** (Bitcoin Blockchain Explorer) [details](https://github.com/janoside/btc-rpc-explorer)
@ -31,6 +31,9 @@ There are further Services that can be switched on:
* **LNDmanage** (Advanced Channel Management CLI) [details](https://github.com/bitromortac/lndmanage)
* **Loop** (Submarine Swaps Service) [details](https://github.com/lightninglabs/loop)
* **JoinMarket** (CoinJoin Service) [details](https://github.com/JoinMarket-Org/joinmarket-clientserver)
* **ThunderHub** (Lightning Node Manager WebUI) [details](https://www.thunderhub.io/)
* **Faraday** (Channel Analysis & Recommendations CLI) [details](https://github.com/lightninglabs/faraday/blob/master/README.md)
* **Balance Of Satoshis** (Commands for working with LND balances) [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/README.md)
You can connect the following Wallet-Apps to your RaspiBlitz:
@ -68,7 +71,7 @@ The cheapest way is to buy and assemble the single parts yourself. There are two
* RaspberryPi 4 4GB (or 8GB) [amazon referral link](https://geni.us/raspiblitz-4gb-new)
* Power Supply - USB-C, 5V, >=3A [amazon referral link](https://geni.us/raspiblitz-ps)
* 1TB SSD - SanDisk SSD Plus 1TB 2.5" : [amazon referral link](https://geni.us/raspiblitz-1000gb-san)
* 1TB SSD - SanDisk SSD Plus 1TB 2.5" : [amazon referral link](https://geni.us/raspiblitz-1000gb-san) *other 1TB SSD models might cause power issues*
* SSD-case - UGREEN 2.5" External USB 3.0 Hard Disk Case with UASP support : [amazon referral link](https://geni.us/raspiblitz-ssd-case)
* MicroSDCard 32GB - Samsung PRO Endurance 32 GB microSDHC UHS-I U1: [amazon referral link](https://geni.us/raspiblitz-sc-card)
* LCD - 3.5" RPi Display, GPIO connection, XPT2046 Touch Controller: [amazon referral link](https://geni.us/raspiblitz-touchscreen)
@ -114,15 +117,17 @@ In the end your RaspiBlitz should look like this:
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:
**Download SD-Card image - Version 1.5:**
**Download SD-Card image - Version 1.6:**
Browser: https://raspiblitz.com/raspiblitz-v1.5-2020-05-08.img.gz
THIS IS A RELEASE CANDIDATE - NOT THE FINAL VERSION - DONT USE FOR PRODUCTION NODE!
Torrent: https://github.com/rootzoll/raspiblitz/raw/v1.5/home.admin/assets/raspiblitz-v1.5-2020-05-08.img.gz.torrent
Browser: https://files.rotzoll.de/raspiblitz-v1.6rc1-2020-06-12.img.gz
SHA-256: 51cf8cc0f5ff9f562327ed8ba6779cffef8ba8e3c6e2b8e21bcd2f931f630584 or [SIGNATURE](https://raspiblitz.com/raspiblitz-v1.5-2020-05-08.img.gz.sig)
Torrent: [TODO]
* [Whats new in Version 1.5 of RaspiBlitz?](FAQ.md#whats-new-in-version-15-of-raspiblitz)
SHA-256: c9bed779eb3eb2fe17dd879cd9f797bf4ba1ed2d10977946aca6146f4354d8e0 or [SIGNATURE](https://todo)
* [Whats new in Version 1.6 of RaspiBlitz?](FAQ.md#whats-new-in-version-16-of-raspiblitz)
* [How to update my RaspiBlitz?](README.md#updating-raspiblitz-to-new-version)
* [How to verify the sd card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)
@ -220,15 +225,15 @@ Then the user is asked to enter the Password B - this is internally used for the
*The other passwords C & D will be needed later on. They will be used during the lightning wallet setup.*
### Running behind TOR
### Running behind Tor
On setup you can now decide if you want to run your RaspiBlitz behind TOR or make your IP public to the lightning network.
On setup you can now decide if you want to run your RaspiBlitz behind Tor or make your IP public to the lightning network.
![TOR](pictures/chooseTOR.png)
Your IP can reveal your location (at least to a certain radius) to everyone and your internet provider has a record of your personal identity tied to your IP. When you choose to run behind the TOR network this personal data is much better protected. But running behind TOR reduces speed and might makes it more difficult to connect to you for other nodes or pairing other devices and apps to it.
Your IP can reveal your location (at least to a certain radius) to everyone and your internet provider has a record of your personal identity tied to your IP. When you choose to run behind the Tor network this personal data is much better protected. But running behind Tor reduces speed and might makes it more difficult to connect to you for other nodes or pairing other devices and apps to it.
You can switch TOR off later on. Also you can switch TOR on also after the setup, but keep in mind that once running your node with your public IP leaves records on the internet connecting your lightning node id to your public IP.
You can switch Tor off later on. Also you can switch Tor on also after the setup, but keep in mind that once running your node with your public IP leaves records on the internet connecting your lightning node id to your public IP.
After this the setup process will need some time and the user will see a lot of console outputs - just wait until its finished:
@ -522,22 +527,22 @@ You will be asked for your dynamic domain name such like "mynode.crabdance.org"
*NOTE: DynamicDNS just works if you can forward ports on your router and you have a temporary public IP address (your ISP is not running you behind a NAT - like on most mobile connections). Another solution to make your ports reachable from the public internet is to use reverse ssh tunneling - see FAQ on ['How to setup port-forwarding with a SSH tunnel?'](FAQ.md#how-to-setup-port-forwarding-with-a-ssh-tunnel)*
##### Run behind TOR
##### Run behind Tor
You can run your Bitcoin- & Lightning-Node and also additional Apps as a TOR hidden service - replacing your IP with an .onion-address
You can run your Bitcoin- & Lightning-Node and also additional Apps as a Tor hidden service - replacing your IP with an .onion-address
![tor1](pictures/tor1.png)
This has some benefits:
* You don't publish your IP running a node so it's much harder to resolve your real name and location.
* You tunnel through the NAT of your router and make Bitcoin and Lightning reachable to all other TOR nodes.
* By using a TOR address it's possible to move the node to a different IPv4 address and keep the existing (=preciously open and funded) channels functional.
* You tunnel through the NAT of your router and make Bitcoin and Lightning reachable to all other Tor nodes.
* By using a Tor address it's possible to move the node to a different IPv4 address and keep the existing (=preciously open and funded) channels functional.
But this also comes with the following side effects:
* Some Mobile wallets don't support connecting to RaspiBlitz over TOR yet
* Lightning nodes that don't run TOR cannot reach you (like behind NAT)
* Some Mobile wallets don't support connecting to RaspiBlitz over Tor yet
* Lightning nodes that don't run Tor cannot reach you (like behind NAT)
To try it out just switch on the service - you can deactivate later on if it's not working for you.
@ -610,7 +615,7 @@ BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It
![BTCPAY](pictures/btcpay.png)
*At the moment the RaspiBlitz can just make the BTCPayServer publicly available to the outside over the TOR network (Hidden Service).*
*At the moment the RaspiBlitz can just make the BTCPayServer publicly available to the outside over the Tor network (Hidden Service).*
[Details on Service](https://btcpayserver.org/)
@ -675,16 +680,16 @@ At the moment the following mobile wallets are supported:
* [ZAP (iOS/Android)](https://github.com/LN-Zap/zap-iOS)
* [Shango (iOS/Android)](https://github.com/neogeno/shango-lightning-wallet)
* [Zeus (iOS/Android)](https://github.com/ZeusLN/zeus)
* [Fully Noded (iOS over TOR)](https://apps.apple.com/us/app/fully-noded/id1436425586)
* [Fully Noded (iOS over Tor)](https://apps.apple.com/us/app/fully-noded/id1436425586)
* [SendMany (Android)](https://github.com/fusion44/sendmany/blob/master/README.md)
Please keep in mind that if you also want to connect to your smartphone also from the outside (when you are outside of your local network) with your RaspiBlitz you might need to open/forward ports on your router and should look into the DynamicDNS features to handle changing IP of our Home-DSL.
This youtube video explains the "port forwarding" on your router in more detail: https://www.youtube.com/watch?v=KESo7hHXQtg
When you have TOR activated you can also try to connect mobile wallets that support this. The Fully Noded Wallet can only connect over TOR.
When you have Tor activated you can also try to connect mobile wallets that support this. The Fully Noded Wallet can only connect over Tor.
If you run your node behind TOR the SendMany App will just offer to connect when your in the same local network ... for connection over TOR there is no support yet.
If you run your node behind Tor the SendMany App will just offer to connect when your in the same local network ... for connection over Tor there is no support yet.
Basically those mobile wallets work as a remote control app for your RaspiBlitz. First you need to install the apps on your phone - a QR code with the links to the app stores are displayed. And then you need to `pair` them with your RaspiBlitz - also with a QR code displayed on the LCD. If you run your RaspiBlitz without a LCD there is the fallback option to display that QR code on the terminal as ASCII code (might involve lowering your terminal font size).
@ -839,7 +844,7 @@ With the command `raspiblitz` it's possible to return to the main menu.
As mentioned above you can export a Migration File from your Raspiblitz with MAINMENU > REPAIR > MIGRATION and store it on your laptop.
A Migration file contains all the important data of your RaspiBlitz like your LND data, Bitcoin Wallet, raspiblitz.config, TOR/SSH keys .. and also the data of installed apps. You can use this to migrate your RaspiBlitz to a new hardware.
A Migration file contains all the important data of your RaspiBlitz like your LND data, Bitcoin Wallet, raspiblitz.config, Tor/SSH keys .. and also the data of installed apps. You can use this to migrate your RaspiBlitz to a new hardware.
If you want to it to import it again to a new RaspiBlitz (for example with an updated HDD/SSD) you can choose the MIGRATION option on the first setup dialog after the Hardwaretest (where you normally choose between Bitcoin & Litecoin).
@ -880,7 +885,7 @@ To develop your own scripts/apps and to connect other services/apps to your Rasp
* `gRPC` running on port 10009 (public) [DOC](https://api.lightning.community/)
* `REST` running on port 8080 (public) [DOC](https://api.lightning.community/rest/index.html)
If you activate TOR then your LND gRPC & REST APIs are also reachable publicly as a Hidden Service.
If you activate Tor then your LND gRPC & REST APIs are also reachable publicly as a Hidden Service.
### Backup for On-Chain- & Channel-Funds

View File

@ -185,7 +185,7 @@ if [ "${runBehindTor}" = "on" ]; then
public_addr="${onionAddress}:${public_port}"
public=""
public_color="${color_green}"
torInfo="+ TOR"
torInfo="+ Tor"
else

View File

@ -97,7 +97,8 @@ if [ "${chain}" = "main" ]; then
OPTIONS+=(lnfwdreport "Lightning Forwarding Events Report")
fi
OPTIONS+=(SERVICES "Activate/Deactivate Services")
OPTIONS+=(SETTINGS "Node Settings & Options")
OPTIONS+=(SERVICES "Additional Apps & Services")
OPTIONS+=(SUBSCRIBE "Manage Subscriptions")
OPTIONS+=(MOBILE "Connect Mobile Wallet")
OPTIONS+=(LNDCREDS "Manage LND Credentials")
@ -230,6 +231,9 @@ case $CHOICE in
SERVICES)
/home/admin/00settingsMenuServices.sh
;;
SETTINGS)
/home/admin/00settingsMenuBasics.sh
;;
CLOSEALL)
/home/admin/BBcloseAllChannels.sh
echo "Press ENTER to return to main menu."

View File

@ -0,0 +1,399 @@
#!/bin/bash
# get raspiblitz config
echo "get raspiblitz config"
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
echo "services default values"
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
if [ ${#chain} -eq 0 ]; then chain="main"; fi
if [ ${#autoNatDiscovery} -eq 0 ]; then autoNatDiscovery="off"; fi
if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi
if [ ${#touchscreen} -eq 0 ]; then touchscreen=0; fi
if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
if [ ${#letsencrypt} -eq 0 ]; then letsencrypt="off"; fi
echo "map dropboxbackup to on/off"
DropboxBackup="off";
if [ ${#dropboxBackupTarget} -gt 0 ]; then DropboxBackup="on"; fi
echo "map chain to on/off"
chainValue="off"
if [ "${chain}" = "test" ]; then chainValue="on"; fi
echo "map domain to on/off"
domainValue="off"
dynDomainMenu='DynamicDNS'
if [ ${#dynDomain} -gt 0 ]; then
domainValue="on"
dynDomainMenu="${dynDomain}"
fi
echo "map lcdrotate to on/off"
lcdrotateMenu='off'
if [ ${lcdrotate} -gt 0 ]; then
lcdrotateMenu='on'
fi
echo "map touchscreen to on/off"
touchscreenMenu='off'
if [ ${touchscreen} -gt 0 ]; then
touchscreenMenu='on'
fi
echo "check autopilot by lnd.conf"
lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'autopilot.active=1')
if [ ${lndAutoPilotOn} -eq 1 ]; then
autoPilot="on"
else
autoPilot="off"
fi
echo "map keysend to on/off"
keysend="on"
source <(sudo /home/admin/config.scripts/lnd.keysend.sh status)
if [ ${keysendOn} -eq 0 ]; then
keysend="off"
fi
# show select dialog
echo "run dialog ..."
OPTIONS=()
OPTIONS+=(t 'Run behind TOR' ${runBehindTor})
OPTIONS+=(s 'Touchscreen' ${touchscreenMenu})
OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
OPTIONS+=(a 'Channel Autopilot' ${autoPilot})
OPTIONS+=(k 'Accept Keysend' ${keysend})
OPTIONS+=(n 'Testnet' ${chainValue})
OPTIONS+=(c 'Let`s Encrypt Client' ${letsencrypt})
OPTIONS+=(u 'LND Auto-Unlock' ${autoUnlock})
OPTIONS+=(d 'StaticChannelBackup on DropBox' ${DropboxBackup})
if [ ${#runBehindTor} -eq 0 ] || [ "${runBehindTor}" = "off" ]; then
OPTIONS+=(y ${dynDomainMenu} ${domainValue})
OPTIONS+=(b 'BTC UPnP (AutoNAT)' ${networkUPnP})
OPTIONS+=(l 'LND UPnP (AutoNAT)' ${autoNatDiscovery})
fi
CHOICES=$(dialog --title ' Node Settings & Options ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 "${OPTIONS[@]}" 2>&1 >/dev/tty)
dialogcancel=$?
echo "done dialog"
clear
# check if user canceled dialog
echo "dialogcancel(${dialogcancel})"
if [ ${dialogcancel} -eq 1 ]; then
echo "user canceled"
exit 1
elif [ ${dialogcancel} -eq 255 ]; then
echo "ESC pressed"
exit 1
fi
needsReboot=0
anychange=0
# TESTNET process choice - KEEP FIRST IN ORDER
choice="main"; check=$(echo "${CHOICES}" | grep -c "n")
if [ ${check} -eq 1 ]; then choice="test"; fi
if [ "${chain}" != "${choice}" ]; then
if [ "${network}" = "litecoin" ] && [ "${choice}"="test" ]; then
dialog --title 'FAIL' --msgbox 'Litecoin-Testnet not available.' 5 25
elif [ "${BTCRPCexplorer}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off BTC-RPC-Explorer FIRST\nbefore changing testnet.' 6 45
exit 1
elif [ "${BTCPayServer}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off BTC-Pay-Server FIRST\nbefore changing testnet.' 6 45
exit 1
elif [ "${ElectRS}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off Electrum-Rust-Server FIRST\nbefore changing testnet.' 6 48
exit 1
elif [ "${loop}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off Loop-Service FIRST\nbefore changing testnet.' 6 48
exit 1
else
echo "Testnet Setting changed .."
anychange=1
sudo /home/admin/config.scripts/network.chain.sh ${choice}net
walletExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${choice}net/wallet.db 2>/dev/null | grep -c 'wallet.db')
if [ ${walletExists} -eq 0 ]; then
echo "Need to creating a new wallet ... wait 20secs"
sudo systemctl start lnd
sleep 20
tryAgain=1
while [ ${tryAgain} -eq 1 ]
do
echo "****************************************************************************"
echo "Creating a new LND Wallet for ${network}/${choice}net"
echo "****************************************************************************"
echo "A) For 'Wallet Password' use your PASSWORD C --> !! minimum 8 characters !!"
echo "B) Answer 'n' because you don't have a 'cipher seed mnemonic' (24 words) yet"
echo "C) For 'passphrase' to encrypt your 'cipher seed' use PASSWORD D (optional)"
echo "****************************************************************************"
sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net create 2>error.out
error=`sudo cat error.out`
if [ ${#error} -eq 0 ]; then
sleep 2
# WIN
tryAgain=0
echo "!!! Make sure to write down the 24 words (cipher seed mnemonic) !!!"
echo "If you are ready. Press ENTER."
else
# FAIL
tryAgain=1
echo "!!! FAIL ---> SOMETHING WENT WRONG !!!"
echo "${error}"
echo "Press ENTER to retry ... or CTRL-c to EXIT"
fi
read key
done
echo "Check for Macaroon .. (10sec)"
sleep 10
macaroonExists=$(sudo ls /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon | grep -c 'admin.macaroon')
if [ ${macaroonExists} -eq 0 ]; then
echo "*** PLEASE UNLOCK your wallet with PASSWORD C to create macaroon"
lncli unlock 2>/dev/null
sleep 6
fi
macaroonExists=$(sudo ls /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon | grep -c 'admin.macaroon')
if [ ${macaroonExists} -eq 0 ]; then
echo "FAIL --> Was not able to create macaroon"
echo "Please report problem."
exit 1
fi
echo "stopping lnd again"
sleep 5
sudo systemctl stop lnd
fi
echo "Update Admin Macaroon"
sudo rm -r /home/admin/.lnd/data/chain/${network}/${choice}net 2>/dev/null
sudo mkdir /home/admin/.lnd/data/chain/${network}/${choice}net
sudo cp /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon /home/admin/.lnd/data/chain/${network}/${choice}net
sudo chown -R admin:admin /home/admin/.lnd/
needsReboot=1
fi
else
echo "Testnet Setting unchanged."
fi
# AUTOPILOT process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoPilot}" != "${choice}" ]; then
echo "Autopilot Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice}
needsReboot=1
else
echo "Autopilot Setting unchanged."
fi
# Dynamic Domain
choice="off"; check=$(echo "${CHOICES}" | grep -c "y")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${domainValue}" != "${choice}" ]; then
echo "Dynamic Domain changed .."
anychange=1
sudo /home/admin/config.scripts/internet.dyndomain.sh ${choice}
needsReboot=1
else
echo "Dynamic Domain unchanged."
fi
# UPnP
choice="off"; check=$(echo "${CHOICES}" | grep -c "b")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${networkUPnP}" != "${choice}" ]; then
echo "BTC UPnP Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh on
networkUPnP="on"
needsReboot=1
else
echo "Stopping BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh off
networkUPnP="off"
needsReboot=1
fi
else
echo "BTC UPnP Setting unchanged."
fi
# AutoNAT
choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoNatDiscovery}" != "${choice}" ]; then
echo "AUTO NAT Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh on
autoNatDiscovery="on"
needsReboot=1
else
echo "Stopping autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh off
autoNatDiscovery="off"
needsReboot=1
fi
else
echo "LND AUTONAT Setting unchanged."
fi
# TOR process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "t")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${runBehindTor}" != "${choice}" ]; then
echo "TOR Setting changed .."
# special actions if TOR is turned on
if [ "${choice}" = "on" ]; then
# inform user about privacy risk
whiptail --title " PRIVACY NOTICE " --msgbox "
RaspiBlitz will now install/activate TOR & after reboot run behind it.
Please keep in mind that thru your LND node id & your previous IP history with your internet provider your lightning node could still be linked to your personal id even when running behind TOR. To unlink you from that IP history its recommended that after the switch/reboot to TOR you also use the REPAIR > RESET-LND option to create a fresh LND wallet. That might involve closing all channels & move your funds out of RaspiBlitz before that RESET-LND.
" 16 76
# make sure AutoNAT & UPnP is off
/home/admin/config.scripts/lnd.autonat.sh off
/home/admin/config.scripts/network.upnp.sh off
fi
# change TOR
anychange=1
sudo /home/admin/config.scripts/internet.tor.sh ${choice}
needsReboot=1
else
echo "TOR Setting unchanged."
fi
# Let's Encrypt process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${letsencrypt}" != "${choice}" ]; then
echo "Let's Encrypt Client Setting changed .."
anychange=1
/home/admin/config.scripts/bonus.letsencrypt.sh ${choice}
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
msg="Successfully installed."
else
msg="Failed to install!"
fi
else
if [ ${errorOnInstall} -eq 0 ]; then
msg="Successfully removed."
else
msg="Failed to remove!"
fi
fi
dialog --backtitle "Additional Services" \
--title "Let's Encrypt Client" \
--infobox "\n${msg}" 5 40 ; sleep 3
else
echo "Let's Encrypt Client Setting unchanged."
fi
# LND Auto-Unlock
choice="off"; check=$(echo "${CHOICES}" | grep -c "u")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoUnlock}" != "${choice}" ]; then
echo "LND Autounlock Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autounlock.sh ${choice}
l1="AUTO-UNLOCK IS NOW OFF"
if [ "${choice}" = "on" ]; then
l1="AUTO-UNLOCK IS NOW ACTIVE"
fi
dialog --title 'OK' --msgbox "\n${l1}\n" 9 50
needsReboot=1
else
echo "LND Autounlock Setting unchanged."
fi
# touchscreen
choice="0"; check=$(echo "${CHOICES}" | grep -c "s")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${touchscreen}" != "${choice}" ]; then
echo "Touchscreen Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.touchscreen.sh ${choice}
if [ "${choice}" == "1" ]; then
dialog --title 'Touchscreen Activated' --msgbox 'Touchscreen was activated - will reboot.\n\nAfter reboot use the SCREEN option in main menu to calibrate the touchscreen.' 9 48
fi
needsReboot=1
else
echo "Touchscreen Setting unchanged."
fi
# lcd rotate
choice="0"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.lcdrotate.sh ${choice}
needsReboot=1
else
echo "LCD Rotate Setting unchanged."
fi
# DropBox process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "d")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${DropboxBackup}" != "${choice}" ]; then
echo "DropBox Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/dropbox.upload.sh ${choice}
if [ "${choice}" = "on" ]; then
# doing initial upload so that user can see result
source /mnt/hdd/raspiblitz.conf
sudo /home/admin/config.scripts/dropbox.upload.sh upload ${dropboxBackupTarget} /home/admin/.lnd/data/chain/${network}/${chain}net/channel.backup
fi
else
echo "Dropbox backup setting unchanged."
fi
# Keysend process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "k")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${keysend}" != "${choice}" ]; then
echo "keysend setting changed .."
anychange=1
needsReboot=1
sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice}
dialog --msgbox "Accept Keysend is now ${choice} after Reboot." 5 46
else
echo "keysend setting unchanged."
fi
if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0
fi
if [ ${needsReboot} -eq 1 ]; then
sleep 2
dialog --pause "OK. System will reboot to activate changes." 8 58 8
clear
echo "rebooting .. (please wait)"
# stop bitcoind
sudo -u bitcoin ${network}-cli stop
sleep 4
sudo /home/admin/XXshutdown.sh reboot
fi

View File

@ -6,18 +6,10 @@ source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
echo "services default values"
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
if [ ${#loop} -eq 0 ]; then loop="off"; fi
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
if [ ${#BTCRPCexplorer} -eq 0 ]; then BTCRPCexplorer="off"; fi
if [ ${#specter} -eq 0 ]; then specter="off"; fi
if [ ${#chain} -eq 0 ]; then chain="main"; fi
if [ ${#autoNatDiscovery} -eq 0 ]; then autoNatDiscovery="off"; fi
if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi
if [ ${#touchscreen} -eq 0 ]; then touchscreen=0; fi
if [ ${#lcdrotate} -eq 0 ]; then lcdrotate=0; fi
if [ ${#BTCPayServer} -eq 0 ]; then BTCPayServer="off"; fi
if [ ${#ElectRS} -eq 0 ]; then ElectRS="off"; fi
if [ ${#lndmanage} -eq 0 ]; then lndmanage="off"; fi
@ -26,110 +18,25 @@ if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi
if [ ${#faraday} -eq 0 ]; then faraday="off"; fi
if [ ${#bos} -eq 0 ]; then bos="off"; fi
if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi
if [ ${#letsencrypt} -eq 0 ]; then letsencrypt="off"; fi
if [ ${#zerotier} -eq 0 ]; then zerotier="off"; fi
echo "map dropboxbackup to on/off"
DropboxBackup="off";
if [ ${#dropboxBackupTarget} -gt 0 ]; then DropboxBackup="on"; fi
echo "map chain to on/off"
chainValue="off"
if [ "${chain}" = "test" ]; then chainValue="on"; fi
echo "map domain to on/off"
domainValue="off"
dynDomainMenu='DynamicDNS'
if [ ${#dynDomain} -gt 0 ]; then
domainValue="on"
dynDomainMenu="${dynDomain}"
fi
echo "map lcdrotate to on/off"
lcdrotateMenu='off'
if [ ${lcdrotate} -gt 0 ]; then
lcdrotateMenu='on'
fi
echo "map touchscreen to on/off"
touchscreenMenu='off'
if [ ${touchscreen} -gt 0 ]; then
touchscreenMenu='on'
fi
echo "check autopilot by lnd.conf"
lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'autopilot.active=1')
if [ ${lndAutoPilotOn} -eq 1 ]; then
autoPilot="on"
else
autoPilot="off"
fi
echo "map keysend to on/off"
keysend="on"
source <(sudo /home/admin/config.scripts/lnd.keysend.sh status)
if [ ${keysendOn} -eq 0 ]; then
keysend="off"
fi
# show select dialog
echo "run dialog ..."
if [ "${runBehindTor}" = "on" ]; then
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \
1 'Channel Autopilot' ${autoPilot} \
k 'Accept Keysend' ${keysend} \
l 'Lightning Loop' ${loop} \
2 'Testnet' ${chainValue} \
3 ${dynDomainMenu} ${domainValue} \
4 'Run behind TOR' ${runBehindTor} \
5 'RTL Webinterface' ${rtlWebinterface} \
b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \
c 'Let`s Encrypt Client' ${letsencrypt} \
s 'Cryptoadvance Specter' ${specter} \
6 'LND Auto-Unlock' ${autoUnlock} \
9 'Touchscreen' ${touchscreenMenu} \
r 'LCD Rotate' ${lcdrotateMenu} \
e 'Electrum Rust Server' ${ElectRS} \
p 'BTCPayServer' ${BTCPayServer} \
m 'lndmanage' ${lndmanage} \
f 'Faraday' ${faraday} \
o 'Balance of Satoshis' ${bos} \
t 'ThunderHub' ${thunderhub} \
i 'LNbits' ${LNBits} \
d 'StaticChannelBackup on DropBox' ${DropboxBackup} \
j 'JoinMarket' ${joinmarket} \
z 'ZeroTier' ${zerotier} \
2>&1 >/dev/tty)
else
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \
1 'Channel Autopilot' ${autoPilot} \
k 'Accept Keysend' ${keysend} \
l 'Lightning Loop' ${loop} \
2 'Testnet' ${chainValue} \
3 ${dynDomainMenu} ${domainValue} \
4 'Run behind TOR' ${runBehindTor} \
5 'RTL Webinterface' ${rtlWebinterface} \
b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \
c 'Let`s Encrypt Client' ${letsencrypt} \
s 'Cryptoadvance Specter' ${specter} \
6 'LND Auto-Unlock' ${autoUnlock} \
7 'BTC UPnP (AutoNAT)' ${networkUPnP} \
8 'LND UPnP (AutoNAT)' ${autoNatDiscovery} \
9 'Touchscreen' ${touchscreenMenu} \
r 'LCD Rotate' ${lcdrotateMenu} \
e 'Electrum Rust Server' ${ElectRS} \
p 'BTCPayServer' ${BTCPayServer} \
m 'lndmanage' ${lndmanage} \
f 'Faraday' ${faraday} \
o 'Balance of Satoshis' ${bos} \
t 'ThunderHub' ${thunderhub} \
i 'LNbits' ${LNBits} \
d 'StaticChannelBackup on DropBox' ${DropboxBackup} \
j 'JoinMarket' ${joinmarket} \
z 'ZeroTier' ${zerotier} \
2>&1 >/dev/tty)
fi
OPTIONS=()
OPTIONS+=(l 'Lightning Loop' ${loop})
OPTIONS+=(r 'RTL Webinterface' ${rtlWebinterface})
OPTIONS+=(b 'BTC-RPC-Explorer' ${BTCRPCexplorer})
OPTIONS+=(s 'Cryptoadvance Specter' ${specter})
OPTIONS+=(e 'Electrum Rust Server' ${ElectRS})
OPTIONS+=(p 'BTCPayServer' ${BTCPayServer})
OPTIONS+=(m 'lndmanage' ${lndmanage})
OPTIONS+=(f 'Faraday' ${faraday})
OPTIONS+=(o 'Balance of Satoshis' ${bos})
OPTIONS+=(t 'ThunderHub' ${thunderhub})
OPTIONS+=(i 'LNbits' ${LNBits})
OPTIONS+=(j 'JoinMarket' ${joinmarket})
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 "${OPTIONS[@]}" 2>&1 >/dev/tty)
dialogcancel=$?
echo "done dialog"
@ -148,103 +55,6 @@ fi
needsReboot=0
anychange=0
# TESTNET process choice - KEEP FIRST IN ORDER
choice="main"; check=$(echo "${CHOICES}" | grep -c "2")
if [ ${check} -eq 1 ]; then choice="test"; fi
if [ "${chain}" != "${choice}" ]; then
if [ "${network}" = "litecoin" ] && [ "${choice}"="test" ]; then
dialog --title 'FAIL' --msgbox 'Litecoin-Testnet not available.' 5 25
elif [ "${BTCRPCexplorer}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off BTC-RPC-Explorer FIRST\nbefore changing testnet.' 6 45
exit 1
elif [ "${BTCPayServer}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off BTC-Pay-Server FIRST\nbefore changing testnet.' 6 45
exit 1
elif [ "${ElectRS}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off Electrum-Rust-Server FIRST\nbefore changing testnet.' 6 48
exit 1
elif [ "${loop}" = "on" ]; then
dialog --title 'NOTICE' --msgbox 'Please turn off Loop-Service FIRST\nbefore changing testnet.' 6 48
exit 1
else
echo "Testnet Setting changed .."
anychange=1
sudo /home/admin/config.scripts/network.chain.sh ${choice}net
walletExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${choice}net/wallet.db 2>/dev/null | grep -c 'wallet.db')
if [ ${walletExists} -eq 0 ]; then
echo "Need to creating a new wallet ... wait 20secs"
sudo systemctl start lnd
sleep 20
tryAgain=1
while [ ${tryAgain} -eq 1 ]
do
echo "****************************************************************************"
echo "Creating a new LND Wallet for ${network}/${choice}net"
echo "****************************************************************************"
echo "A) For 'Wallet Password' use your PASSWORD C --> !! minimum 8 characters !!"
echo "B) Answer 'n' because you don't have a 'cipher seed mnemonic' (24 words) yet"
echo "C) For 'passphrase' to encrypt your 'cipher seed' use PASSWORD D (optional)"
echo "****************************************************************************"
sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net create 2>error.out
error=`sudo cat error.out`
if [ ${#error} -eq 0 ]; then
sleep 2
# WIN
tryAgain=0
echo "!!! Make sure to write down the 24 words (cipher seed mnemonic) !!!"
echo "If you are ready. Press ENTER."
else
# FAIL
tryAgain=1
echo "!!! FAIL ---> SOMETHING WENT WRONG !!!"
echo "${error}"
echo "Press ENTER to retry ... or CTRL-c to EXIT"
fi
read key
done
echo "Check for Macaroon .. (10sec)"
sleep 10
macaroonExists=$(sudo ls /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon | grep -c 'admin.macaroon')
if [ ${macaroonExists} -eq 0 ]; then
echo "*** PLEASE UNLOCK your wallet with PASSWORD C to create macaroon"
lncli unlock 2>/dev/null
sleep 6
fi
macaroonExists=$(sudo ls /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon | grep -c 'admin.macaroon')
if [ ${macaroonExists} -eq 0 ]; then
echo "FAIL --> Was not able to create macaroon"
echo "Please report problem."
exit 1
fi
echo "stopping lnd again"
sleep 5
sudo systemctl stop lnd
fi
echo "Update Admin Macaroon"
sudo rm -r /home/admin/.lnd/data/chain/${network}/${choice}net 2>/dev/null
sudo mkdir /home/admin/.lnd/data/chain/${network}/${choice}net
sudo cp /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon /home/admin/.lnd/data/chain/${network}/${choice}net
sudo chown -R admin:admin /home/admin/.lnd/
needsReboot=1
fi
else
echo "Testnet Setting unchanged."
fi
# AUTOPILOT process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "1")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoPilot}" != "${choice}" ]; then
echo "Autopilot Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice}
needsReboot=1
else
echo "Autopilot Setting unchanged."
fi
# LOOP process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
if [ ${check} -eq 1 ]; then choice="on"; fi
@ -269,92 +79,8 @@ else
echo "Loop Setting unchanged."
fi
# Dynamic Domain
choice="off"; check=$(echo "${CHOICES}" | grep -c "3")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${domainValue}" != "${choice}" ]; then
echo "Dynamic Domain changed .."
anychange=1
sudo /home/admin/config.scripts/internet.dyndomain.sh ${choice}
needsReboot=1
else
echo "Dynamic Domain unchanged."
fi
# UPnP
choice="off"; check=$(echo "${CHOICES}" | grep -c "7")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${networkUPnP}" != "${choice}" ]; then
echo "BTC UPnP Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh on
networkUPnP="on"
needsReboot=1
else
echo "Stopping BTC UPNP ..."
/home/admin/config.scripts/network.upnp.sh off
networkUPnP="off"
needsReboot=1
fi
else
echo "BTC UPnP Setting unchanged."
fi
# AutoNAT
choice="off"; check=$(echo "${CHOICES}" | grep -c "8")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoNatDiscovery}" != "${choice}" ]; then
echo "AUTO NAT Setting changed .."
anychange=1
if [ "${choice}" = "on" ]; then
echo "Starting autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh on
autoNatDiscovery="on"
needsReboot=1
else
echo "Stopping autoNAT ..."
/home/admin/config.scripts/lnd.autonat.sh off
autoNatDiscovery="off"
needsReboot=1
fi
else
echo "LND AUTONAT Setting unchanged."
fi
# TOR process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "4")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${runBehindTor}" != "${choice}" ]; then
echo "TOR Setting changed .."
# special actions if TOR is turned on
if [ "${choice}" = "on" ]; then
# inform user about privacy risk
whiptail --title " PRIVACY NOTICE " --msgbox "
RaspiBlitz will now install/activate TOR & after reboot run behind it.
Please keep in mind that thru your LND node id & your previous IP history with your internet provider your lightning node could still be linked to your personal id even when running behind TOR. To unlink you from that IP history its recommended that after the switch/reboot to TOR you also use the REPAIR > RESET-LND option to create a fresh LND wallet. That might involve closing all channels & move your funds out of RaspiBlitz before that RESET-LND.
" 16 76
# make sure AutoNAT & UPnP is off
/home/admin/config.scripts/lnd.autonat.sh off
/home/admin/config.scripts/network.upnp.sh off
fi
# change TOR
anychange=1
sudo /home/admin/config.scripts/internet.tor.sh ${choice}
needsReboot=1
else
echo "TOR Setting unchanged."
fi
# RTL process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "5")
choice="off"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${rtlWebinterface}" != "${choice}" ]; then
echo "RTL Webinterface Setting changed .."
@ -406,36 +132,6 @@ else
echo "BTC-RPC-Explorer Setting unchanged."
fi
# Let's Encrypt process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${letsencrypt}" != "${choice}" ]; then
echo "Let's Encrypt Client Setting changed .."
anychange=1
/home/admin/config.scripts/bonus.letsencrypt.sh ${choice}
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
msg="Successfully installed."
else
msg="Failed to install!"
fi
else
if [ ${errorOnInstall} -eq 0 ]; then
msg="Successfully removed."
else
msg="Failed to remove!"
fi
fi
dialog --backtitle "Additional Services" \
--title "Let's Encrypt Client" \
--infobox "\n${msg}" 5 40 ; sleep 3
else
echo "Let's Encrypt Client Setting unchanged."
fi
# cryptoadvance Specter process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "s")
if [ ${check} -eq 1 ]; then choice="on"; fi
@ -462,50 +158,6 @@ else
echo "Cryptoadvance Specter Setting unchanged."
fi
# LND Auto-Unlock
choice="off"; check=$(echo "${CHOICES}" | grep -c "6")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${autoUnlock}" != "${choice}" ]; then
echo "LND Autounlock Setting changed .."
anychange=1
sudo /home/admin/config.scripts/lnd.autounlock.sh ${choice}
l1="AUTO-UNLOCK IS NOW OFF"
if [ "${choice}" = "on" ]; then
l1="AUTO-UNLOCK IS NOW ACTIVE"
fi
dialog --title 'OK' --msgbox "\n${l1}\n" 9 50
needsReboot=1
else
echo "LND Autounlock Setting unchanged."
fi
# touchscreen
choice="0"; check=$(echo "${CHOICES}" | grep -c "9")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${touchscreen}" != "${choice}" ]; then
echo "Touchscreen Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.touchscreen.sh ${choice}
if [ "${choice}" == "1" ]; then
dialog --title 'Touchscreen Activated' --msgbox 'Touchscreen was activated - will reboot.\n\nAfter reboot use the SCREEN option in main menu to calibrate the touchscreen.' 9 48
fi
needsReboot=1
else
echo "Touchscreen Setting unchanged."
fi
# lcd rotate
choice="0"; check=$(echo "${CHOICES}" | grep -c "r")
if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.lcdrotate.sh ${choice}
needsReboot=1
else
echo "LCD Rotate Setting unchanged."
fi
# ElectRS process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "e")
if [ ${check} -eq 1 ]; then choice="on"; fi
@ -677,35 +329,6 @@ else
echo "LNbits setting unchanged."
fi
# DropBox process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "d")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${DropboxBackup}" != "${choice}" ]; then
echo "DropBox Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/dropbox.upload.sh ${choice}
if [ "${choice}" = "on" ]; then
# doing initial upload so that user can see result
source /mnt/hdd/raspiblitz.conf
sudo /home/admin/config.scripts/dropbox.upload.sh upload ${dropboxBackupTarget} /home/admin/.lnd/data/chain/${network}/${chain}net/channel.backup
fi
else
echo "Dropbox backup setting unchanged."
fi
# Keysend process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "k")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${keysend}" != "${choice}" ]; then
echo "keysend setting changed .."
anychange=1
needsReboot=1
sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice}
dialog --msgbox "Accept Keysend is now ${choice} after Reboot." 5 46
else
echo "keysend setting unchanged."
fi
# JoinMarket process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "j")
if [ ${check} -eq 1 ]; then choice="on"; fi
@ -735,18 +358,6 @@ else
echo "JoinMarket not changed."
fi
# ZeroTier process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "z")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${zerotier}" != "${choice}" ]; then
echo "zerotier setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice}
dialog --msgbox "ZeroTier is now ${choice}." 5 46
else
echo "ZeroTier setting unchanged."
fi
if [ ${anychange} -eq 0 ]; then
dialog --msgbox "NOTHING CHANGED!\nUse Spacebar to check/uncheck services." 8 58
exit 0

View File

@ -42,9 +42,9 @@ echo "OK"
# check minimal size of data drive needed
echo
echo "# --> Check HDD/SSD for Size ..."
# bitcoin: 450 GB
# bitcoin: 440 GB
# litecoin: 120 GB
minSize=450
minSize=440
if [ "${network}" = "litecoin" ]; then
minSize=120
fi

View File

@ -7,16 +7,20 @@ source /home/admin/raspiblitz.info
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
# Basic Options
OPTIONS=(UNIX "MacOS or Linux" \
WINDOWS "Windows"
OPTIONS=(WINDOWS "Windows" \
MACOS "Apple MacOSX" \
LINUX "Linux" \
BLITZ "RaspiBlitz"
)
CHOICE=$(dialog --clear --title "Which System is running on the other computer?" --menu "" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
CHOICE=$(dialog --clear --title " Copy Blockchain from another laptop/node over LAN " --menu "\nWhich system is running on the other laptop/node you want to copy the blockchain from?\n " 14 60 9 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear
case $CHOICE in
UNIX) echo "Linus";;
MACOS) echo "Steve";;
LINUX) echo "Linus";;
WINDOWS) echo "Bill";;
BLITZ) echo "Satoshi";;
*) exit 1;;
esac
@ -29,8 +33,19 @@ if [ "${setupStep}" = "100" ]; then
sudo cp -f /mnt/hdd/bitcoin/bitcoin.conf /home/admin/assets/bitcoin.conf
fi
if [ -d "/mnt/hdd/bitcoin" ] && [ "$1" != "stop-after-script" ]; then
dialog --title "Fresh or Repair" --yesno "Do you want to delete the old/local blockchain data now?" 8 60
# check if old blockchain data exists
hasOldBlockchainData=0
sizeBlocks=$(sudo du -s /mnt/hdd/bitcoin/blocks 2>/dev/null | tr -dc '[0-9]')
if [ ${#sizeBlocks} -gt 0 ] && [ ${sizeBlocks} -gt 0 ]; then
hasOldBlockchainData=1
fi
sizeChainstate=$(sudo du -s /mnt/hdd/bitcoin/chainstate 2>/dev/null | tr -dc '[0-9]')
if [ ${#sizeChainstate} -gt 0 ] && [ ${sizeChainstate} -gt 0 ]; then
hasOldBlockchainData=1
fi
if [ ${hasOldBlockchainData} -eq 1 ] && [ "$1" != "stop-after-script" ]; then
dialog --title " Old Blockchain Data Found " --yesno "\nDo you want to delete the old/local blockchain data now?" 7 60
response=$?
echo "response(${response})"
if [ "${response}" = "1" ]; then
@ -38,12 +53,8 @@ if [ -d "/mnt/hdd/bitcoin" ] && [ "$1" != "stop-after-script" ]; then
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
sudo rm -rfv /mnt/hdd/bitcoin/blocks/* 2>/dev/null
sudo rm -rfv /mnt/hdd/bitcoin/chainstate/* 2>/dev/null
sleep 3
fi
fi
@ -56,36 +67,85 @@ sudo chmod 777 /mnt/hdd/bitcoin
echo
clear
echo "************************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from another computer"
echo "************************************************************************************"
echo ""
echo "You can use the blockchain from another bitcoin-core client with version"
echo "greater or equal to 0.17.1."
echo ""
echo "Both computers (your RaspberryPi and the other computer with the full blockchain on) need"
echo "to be connected to the same local network."
echo ""
echo "If you use a RaspiBlitz (>=v1.5) as Blockchain source go: MENU > REPAIR > COPY-SOURCE"
echo "Otherwiese open a terminal on the source computer and change into the directory that"
echo "contains the blockchain data. You should see directories 'blocks' & 'chainstate'".
echo "Make sure the bitcoin client on that computer is stopped."
echo ""
echo "COPY, PASTE & EXECUTE the following command on the blockchain source computer:"
if [ "${CHOICE}" = "WINDOWS" ]; then
echo "sudo scp -r ./chainstate ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
else
echo "****************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from a WINDOWS computer"
echo "****************************************************************************"
echo ""
echo "ON YOUR WINDOWS COMPUTER download and validate the blockchain with the Bitcoin"
echo "Core wallet software (>=0.17.1) from: bitcoincore.org/en/download"
echo "If the Bitcoin Blockchain is synced up - make sure that your Windows computer &"
echo "your RaspiBlitz are in the same local network."
echo ""
echo "Open a fresh terminal on your Windows computer & change into the directory that"
echo "contains the blockchain data - should see folders named 'blocks' & 'chainstate'"
echo "there. Normally on Windows thats: C:\Users\YourUserName\Appdata\Roaming\Bitcoin"
echo "Make sure that the Bitcoin Core Wallet is not running in the background anymore."
echo ""
echo "COPY, PASTE & EXECUTE the following command on your Windows computer terminal:"
echo "scp -r ./chainstate ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
echo ""
echo "If asked for a password use PASSWORD A (or 'raspiblitz')."
fi
if [ "${CHOICE}" = "MACOS" ]; then
echo "****************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from a MacOSX computer"
echo "****************************************************************************"
echo ""
echo "ON YOUR MacOSX COMPUTER download and validate the blockchain with the Bitcoin"
echo "Core wallet software (>=0.17.1) from: bitcoincore.org/en/download"
echo "If the Bitcoin Blockchain is synced up - make sure that your MacOSX computer &"
echo "your RaspiBlitz are in the same local network."
echo ""
echo "Open a fresh terminal on your MacOSX computer and change into the directory that"
echo "contains the blockchain data - should see folders named 'blocks' & 'chainstate'"
echo "there. Normally on MacOSX thats: cd ~/Library/Application Support/Bitcoin/"
echo "Make sure that the Bitcoin Core Wallet is not running in the background anymore."
echo ""
echo "COPY, PASTE & EXECUTE the following command on your MacOSX terminal:"
echo "sudo rsync -avhW --progress ./chainstate ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
echo ""
echo "You will be asked for passwords. First can be the user password of your MacOSX"
echo "computer and the last is the PASSWORD A (or 'raspiblitz') of this RaspiBlitz."
fi
if [ "${CHOICE}" = "LINUX" ]; then
echo "****************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from a LINUX computer"
echo "****************************************************************************"
echo ""
echo "ON YOUR LINUX COMPUTER download and validate the blockchain with the Bitcoin"
echo "Core wallet software (>=0.17.1) from: bitcoincore.org/en/download"
echo "If the Bitcoin Blockchain is synced up - make sure that your Linux computer &"
echo "your RaspiBlitz are in the same local network."
echo ""
echo "Open a fresh terminal on your Linux computer and change into the directory that"
echo "contains the blockchain data - should see folders named 'blocks' & 'chainstate'"
echo "there. Normally on Linux thats: cd ~/.bitcoin/"
echo "Make sure that the Bitcoin Core Wallet is not running in the background anymore."
echo ""
echo "COPY, PASTE & EXECUTE the following command on your Linux terminal:"
echo "sudo rsync -avhW --progress ./chainstate ./blocks bitcoin@${localip}:/mnt/hdd/bitcoin"
echo ""
echo "You will be asked for passwords. First can be the user password of your Linux"
echo "computer and the last is the PASSWORD A (or 'raspiblitz') of this RaspiBlitz."
fi
if [ "${CHOICE}" = "BLITZ" ]; then
echo "****************************************************************************"
echo "Instructions to COPY/TRANSFER SYNCED BLOCKCHAIN from another RaspiBlitz"
echo "****************************************************************************"
echo ""
echo "The other RaspiBlitz needs a minimum version of 1.6 (if lower, update first)."
echo "Make sure that the other RaspiBlitz is on the same local network."
echo ""
echo "Open a fresh terminal and login per SSH into that other RaspiBlitz."
echo "Once in the main menu go: MAINMENU > REPAIR > COPY-SOURCE"
echo "Follow the given instructions ..."
echo ""
echo "The LOCAL IP of this target RaspiBlitz is: ${localip}"
fi
echo ""
echo "This command may ask you first about the admin password of the other computer (because sudo)."
if [ "$1" == "stop-after-script" ]; then
echo "Then it will ask for the default RaspiBlitz SSH password --> raspiblitz."
else
echo "Then it will ask for your SSH PASSWORD A from this RaspiBlitz."
fi
echo "It can take multiple hours until transfer is complete - be patient."
echo "************************************************************************************"
echo "****************************************************************************"
echo "PRESS ENTER if transfers is done OR if you want to choose another option."
sleep 2
read key

View File

@ -32,6 +32,9 @@ sudo cp /home/admin/assets/${network}.conf /home/admin/.${network}/${network}.co
# make sure all files are linked correct
sudo /home/admin/config.scripts/blitz.datadrive.sh link
# BLITZ WEB SERVICE
/home/admin/config.scripts/blitz.web.sh on
###### ACTIVATE TOR IF SET DURING SETUP
if [ "${runBehindTor}" = "on" ]; then

View File

@ -197,7 +197,6 @@ if [ ${walletExists} -eq 0 ]; then
# generate wallet with seed and set passwordC
clear
echo "Generating new Wallet ...."
source /home/admin/python3-env-lnd/bin/activate
python3 /home/admin/config.scripts/lnd.initwallet.py new ${passwordC} > /home/admin/.seed.tmp
source /home/admin/.seed.tmp
sudo shred -u /home/admin/.pass.tmp 2>/dev/null

View File

@ -28,8 +28,8 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "
if [ "${state}" = "copysource" ]; then
l1="Copy Blockchain Source Modus\n"
l2="Please restart RaspiBlitz when done.\n"
l3="Restart from Terminal: sudo shutdown -r now"
l2="May needs restart node when done.\n"
l3="Restart from Terminal: restart"
dialog --backtitle "RaspiBlitz ${codeVersion} (${state}) ${localIP}" --infobox "$l1$l2$l3" 5 45
sleep 3
exit 1

View File

@ -101,7 +101,7 @@ checkIP2TOR()
userHasActiveChannels=$(sudo -u bitcoin lncli listchannels | grep -c '"active": true')
if [ ${userHasActiveChannels} -gt 0 ]; then
/home/admin/config.scripts/blitz.subscriptions.ip2tor.py create-ssh-dialog "$1" "$toraddress" "$port"
sudo -u admin /home/admin/config.scripts/blitz.subscriptions.ip2tor.py create-ssh-dialog "$1" "$toraddress" "$port"
else
whiptail --title " Lightning not Ready " --msgbox "\nYou need at least one active Lightning channel.\n\nPlease make sure that your node is funded and\nyou have a confirmed and active channel running.\nThen try again to connect the mobile wallet." 13 52
exit 0

View File

@ -49,18 +49,63 @@ RaspiBlitz image to your SD card.
copyHost()
{
clear
sed -i "s/^state=.*/state=copysource/g" /home/admin/raspiblitz.info
echo
echo "# *** Copy Blockchain Source Modus ***"
echo "# get IP of RaspiBlitz to copy to ..."
targetIP=$(whiptail --inputbox "\nPlease enter the LOCAL IP of the\nRaspiBlitz to copy Blockchain to:" 10 38 "" --title " Target IP " --backtitle "RaspiBlitz - Copy Blockchain" 3>&1 1>&2 2>&3)
targetIP=$(echo "${targetIP[0]}")
localIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
if [ ${#targetIP} -eq 0 ]; then
return
fi
if [ "${localIP}" == "${targetIP}" ]; then
whiptail --msgbox "Dont type in the local IP of this RaspiBlitz,\nthe LOCAL IP of the other RaspiBlitz is needed." 8 54 "" --title " Testing Target IP " --backtitle "RaspiBlitz - Copy Blockchain"
return
fi
canPingIP=$(ping ${targetIP} -c 1 | grep -c "1 received")
if [ ${canPingIP} -eq 0 ]; then
whiptail --msgbox "Was not able to contact/ping: ${targetIP}\n\n- check if IP of target RaspiBlitz is correct.\n- check to be on the same local network.\n- try again ..." 11 58 "" --title " Testing Target IP " --backtitle "RaspiBlitz - Copy Blockchain"
return
fi
echo "# install dependencies ..."
sudo apt-get install -y sshpass
echo "# get Password of RaspiBlitz to copy to ..."
targetPassword=$(whiptail --passwordbox "\nPlease enter the PASSWORD A of the\nRaspiBlitz to copy Blockchain to:" 10 38 "" --title "Target Password" --backtitle "RaspiBlitz - Copy Blockchain" 3>&1 1>&2 2>&3)
if [ ${#targetPassword} -eq 0 ]; then
return
fi
canLogin=$(sshpass -p "${targetPassword}" ssh -t bitcoin@${targetIP} "echo 'working'" 2>/dev/null | grep -c 'working')
if [ ${canLogin} -eq 0 ]; then
whiptail --msgbox "Password was not working for IP: ${targetIP}\n\n- check thats the correct IP for correct RaspiBlitz\n- check that you used PASSWORD A and had no typo\n- If you tried too often, wait 1h try again" 11 58 "" --title " Testing Target Password " --backtitle "RaspiBlitz - Copy Blockchain"
return
fi
echo "# stopping services ..."
sudo systemctl stop lnd
sudo systemctl stop ${network}d
sudo systemctl disable ${network}d
sleep 5
sudo systemctl stop bitcoind 2>/dev/null
clear
echo
echo "# Starting copy over LAN (around 4-6 hours) ..."
sed -i "s/^state=.*/state=copysource/g" /home/admin/raspiblitz.info
cd /mnt/hdd/${network}
echo
echo "*** Copy Blockchain Source Modus ***"
echo "Your RaspiBlitz has now stopped LND and ${network}d ..."
echo "1. Use command to change to source dir: cd /mnt/hdd/$network"
echo "2. Then run the script given by the other RaspiBlitz in Terminal"
echo "3. When you are done - Restart RaspiBlitz: sudo shutdown -r now"
echo
exit 99
sudo sshpass -p "${targetPassword}" rsync -avhW -e 'ssh -o StrictHostKeyChecking=no -p 22' --info=progress2 ./chainstate ./blocks bitcoin@${targetIP}:/mnt/hdd/bitcoin
sed -i "s/^state=.*/state=/g" /home/admin/raspiblitz.info
echo "# start services again ..."
sudo systemctl enable ${network}d
sudo systemctl start ${network}d
sudo systemctl start lnd
echo "# show final message"
whiptail --msgbox "OK - Copy Process Finished.\n\nNow check on the target RaspiBlitz if it was sucessful." 10 40 "" --title " DONE " --backtitle "RaspiBlitz - Copy Blockchain"
}
# Basic Options
@ -165,5 +210,6 @@ case $CHOICE in
;;
COPY-SOURCE)
copyHost
/home/admin/config.scripts/lnd.unlock.sh
;;
esac

View File

@ -260,7 +260,7 @@ do
recheckSubscription=$((($counter % 600)+1))
if [ ${recheckSubscription} -eq 1 ]; then
# IP2TOR subscriptions (that will need renew in next 20min = 1200 secs)
/home/admin/config.scripts/blitz.subscriptions.ip2tor.py subscriptions-renew 1200
sudo -u admin /home/admin/config.scripts/blitz.subscriptions.ip2tor.py subscriptions-renew 1200
fi
###############################

View File

@ -168,6 +168,10 @@ sudo sed -i "s/^message=.*/message='Installing Services'/g" ${infoFile}
echo "### RUNNING PROVISIONING SERVICES ###" >> ${logFile}
# BLITZ WEB SERVICE
echo "Provisioning BLITZ WEB SERVICE - run config script" >> ${logFile}
/home/admin/config.scripts/blitz.web.sh on >> ${logFile} 2>&1
# LND INTERIMS UPDATE
if [ ${#lndInterimsUpdate} -gt 0 ]; then
sudo sed -i "s/^message=.*/message='Provisioning LND update'/g" ${infoFile}

View File

@ -578,5 +578,8 @@ fi
sed -i "s/^state=.*/state=ready/g" ${infoFile}
sed -i "s/^message=.*/message='Node Running'/g" ${infoFile}
# make sure that bitcoin service is active
sudo systemctl enable ${network}d
echo "DONE BOOTSTRAP" >> $logFile
exit 0

View File

@ -91,6 +91,29 @@ function torthistx() {
}
# command: status
# start the status screen in the terminal
function status() {
sudo -u pi /home/admin/00infoLCD.sh
}
# command: balance
# switch to the bos user for Balance of Satoshis
function balance() {
if [ $(cat /mnt/hdd/raspiblitz.conf 2>/dev/null | grep -c "bos=on") -eq 1 ]; then
sudo su - bos
else
echo "Balance of Satoshis is not installed - to install run:"
echo "/home/admin/config.scripts/bonus.bos.sh on"
fi
}
# command: jmarket
# switch to the joinmarket user for the JoininBox menu
function jmarket() {
if [ $(cat /mnt/hdd/raspiblitz.conf 2>/dev/null | grep -c "joinmarket=on") -eq 1 ]; then
sudo su - joinmarket
else
echo "JoinMarket is not installed - to install run:"
echo "sudo /home/admin/config.scripts/bonus.joinmarket.sh on"
fi
}

View File

@ -0,0 +1,20 @@
## btcpay_ssl.conf
server {
listen 23001 ssl;
listen [::]:23001 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_btcpay.log;
error_log /var/log/nginx/error_btcpay.log;
location / {
proxy_pass http://127.0.0.1:23000;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,17 @@
## btcpay_tor.conf
server {
listen localhost:23002;
listen [::1]:23002;
server_name _;
access_log /var/log/nginx/access_btcpay.log;
error_log /var/log/nginx/error_btcpay.log;
location / {
proxy_pass http://127.0.0.1:23001;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,20 @@
## btcpay_tor_ssl.conf
server {
listen localhost:23003 ssl;
listen [::1]:23003 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_btcpay.log;
error_log /var/log/nginx/error_btcpay.log;
location / {
proxy_pass http://127.0.0.1:23001;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,20 @@
## btcrpcexplorer_ssl.conf
server {
listen 3021 ssl;
listen [::]:3021 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3020;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,17 @@
## btcrpcexplorer_tor.conf
server {
listen localhost:3022;
listen [::1]:3022;
server_name _;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3020;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,20 @@
## btcrpcexplorer_tor_ssl.conf
server {
listen localhost:3023 ssl;
listen [::1]:3023 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3020;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,20 @@
## thub_ssl.conf
server {
listen 3011 ssl;
listen [::]:3011 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3010;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,17 @@
## thub_tor.conf
server {
listen localhost:3012;
listen [::1]:3012;
server_name _;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3010;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -0,0 +1,20 @@
## thub_tor_ssl.conf
server {
listen localhost:3013 ssl;
listen [::1]:3013 ssl;
server_name _;
include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
access_log /var/log/nginx/access_thub.log;
error_log /var/log/nginx/error_thub.log;
location / {
proxy_pass http://127.0.0.1:3010;
include /etc/nginx/snippets/ssl-proxy-params.conf;
}
}

View File

@ -70,7 +70,7 @@ if [ "$1" = "status" ]; then
echo "# BASICS"
echo "isMounted=${isMounted}"
echo "isBTRFS=${isBTRFS}"
echo "isSSD=${isBTRFS}"
echo "isSSD=${isSSD}"
# if HDD is not mounted system is in the pre-setup phase
# deliver all the detailes needed about the data drive
@ -344,13 +344,14 @@ if [ "$1" = "format" ]; then
fi
# wipe all partitions and write fresh GPT
>&2 echo "# Wiping all partitions"
for v_partition in $(parted -s /dev/${hdd} print|awk '/^ / {print $1}')
do
>&2 echo "# sudo parted -s /dev/${hdd} rm ${v_partition}"
sudo parted -s /dev/${hdd} rm ${v_partition}
sleep 2
done
>&2 echo "# Wiping all partitions (sfdisk/wipefs)"
sudo sfdisk --delete /dev/${hdd}
sudo wipefs -a /dev/${hdd}
partitions=$(lsblk | grep -c "${hdd}")
if [ ${partitions} -gt 0 ]; then
>&2 echo "# WARNING: partitions are still not clean - try Quick & Dirty"
sudo dd if=/dev/zero of=/dev/${hdd} bs=512 count=1
fi
partitions=$(lsblk | grep -c "${hdd}")
if [ ${partitions} -gt 0 ]; then
echo "error='partition cleaning failed'"

View File

@ -22,8 +22,8 @@ else
# based on https://medium.com/@jason.hcwong/litecoin-lightning-with-raspberry-pi-3-c3b931a82347
# set version (change if update is available)
litecoinVersion="0.17.1"
litecoinSHA256="7e6f5a1f0b190de01aa20ecf5c5a2cc5a64eb7ede0806bcba983bcd803324d8a"
litecoinVersion="0.18.1"
litecoinSHA256="59b73bc8f034208295634da56a175d74668b07613cf6484653cb467deafb1d52"
# cleaning download folder
sudo rm -r /home/admin/download 1>/dev/null

View File

@ -648,7 +648,8 @@ More information on the service you can find under:
You DID PAY the initial fee.
But the service was not able to provide service.
Subscription will be ignored.
''',title="Error on Subscription")
Error: {0}
'''.format(be.errorShort),title="Error on Subscription")
sys.exit(1)
else:

View File

@ -121,11 +121,11 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "Turning ON: Web"
# install
sudo apt-get update >/dev/null
sudo apt-get install -y nginx apache2-utils >/dev/null
sudo apt-get update
sudo apt-get install -y nginx apache2-utils
# make sure that it is enabled and started
sudo systemctl enable nginx >/dev/null
sudo systemctl enable nginx
sudo systemctl start nginx
# general nginx settings
@ -134,7 +134,7 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo sed -i -E '/^.*server_names_hash_bucket_size [0-9]*;$/a \\tserver_names_hash_bucket_size 128;' /etc/nginx/nginx.conf
fi
if [ -f /etc/ssl/certs/dhparam.pem ]; then
if [ ! -f /etc/ssl/certs/dhparam.pem ]; then
#can take 5-10+ minutes on a Raspberry Pi 3
echo "Running \"sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048\" next."
echo "This can take 5-10 minutes on a Raspberry Pi 3 - please be patient!"
@ -152,7 +152,7 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then
fi
if ! [ -d /var/www/letsencrypt/.well-known/acme-challenge ]; then
sudo mkdir -p /var/www/letsencrypt/.well-known/acme-challenge >/dev/null
sudo mkdir -p /var/www/letsencrypt/.well-known/acme-challenge
fi
# make sure admin can write here even without sudo
@ -175,7 +175,7 @@ elif [ "$1" = "1" ] || [ "$1" = "on" ]; then
fi
# make sure jinja2 is installed and install j2cli
sudo apt-get install python3-jinja2 >/dev/null
sudo apt-get install -y python3-jinja2
sudo -H python3 -m pip install j2cli
# create nginx app-data dir and use LND cert by default

View File

@ -58,7 +58,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo /usr/sbin/usermod --append --groups lndadmin bos
# install bos
sudo -u bos npm install -g balanceofsatoshis@5.36.0
sudo -u bos npm install -g balanceofsatoshis@5.39.4
# setting value in raspi blitz config
sudo sed -i "s/^bos=.*/bos=on/g" /mnt/hdd/raspiblitz.conf

View File

@ -39,7 +39,7 @@ This can take multiple hours.
# TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser:
http://${localip}:3002
https://${localip}:3021
Login is 'admin' with your Password B\n
Hidden Service address for TOR Browser (QR see LCD):
${toraddress}
@ -49,7 +49,7 @@ ${toraddress}
# IP + Domain
whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser:
http://${localip}:3002
https://${localip}:3021
Login is 'admin' with your Password B\n
Activate TOR to access the web block explorer from outside your local network.
" 12 54
@ -127,7 +127,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# Host/Port to bind to
# Defaults: shown
BTCEXP_HOST=0.0.0.0
BTCEXP_PORT=3002
BTCEXP_PORT=3020
# Bitcoin RPC Credentials (URI -OR- HOST/PORT/USER/PASS)
# Defaults:
# - [host/port]: 127.0.0.1:8332
@ -156,9 +156,30 @@ EOF
# open firewall
echo "*** Updating Firewall ***"
sudo ufw allow 3002 comment 'btc-rpc-explorer'
sudo ufw allow 3020 comment 'btc-rpc-explorer HTTP'
sudo ufw allow 3021 comment 'btc-rpc-explorer HTTPS'
echo ""
##################
# NGINX
##################
# setup nginx symlinks
if ! [ -f /etc/nginx/sites-available/btcrpcexplorer_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcrpcexplorer_ssl.conf /etc/nginx/sites-available/btcrpcexplorer_ssl.conf
fi
if ! [ -f /etc/nginx/sites-available/btcrpcexplorer_tor.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcrpcexplorer_tor.conf /etc/nginx/sites-available/btcrpcexplorer_tor.conf
fi
if ! [ -f /etc/nginx/sites-available/btcrpcexplorer_tor_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcrpcexplorer_tor_ssl.conf /etc/nginx/sites-available/btcrpcexplorer_tor_ssl.conf
fi
sudo ln -sf /etc/nginx/sites-available/btcrpcexplorer_ssl.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/btcrpcexplorer_tor.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/btcrpcexplorer_tor_ssl.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
# install service
echo "*** Install btc-rpc-explorer systemd ***"
cat > /home/admin/btc-rpc-explorer.service <<EOF
@ -204,8 +225,8 @@ EOF
source /mnt/hdd/raspiblitz.conf
if [ "${runBehindTor}" = "on" ]; then
# correct old Hidden Service with port
sudo sed -i "s/^HiddenServicePort 3002 127.0.0.1:3002/HiddenServicePort 80 127.0.0.1:3002/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh btc-rpc-explorer 80 3002
sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:3002/HiddenServicePort 80 127.0.0.1:3022/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh btc-rpc-explorer 80 3022 443 3023
fi
exit 0
fi
@ -219,15 +240,27 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
isInstalled=$(sudo ls /etc/systemd/system/btc-rpc-explorer.service 2>/dev/null | grep -c 'btc-rpc-explorer.service')
if [ ${isInstalled} -eq 1 ]; then
echo "*** REMOVING BTC-RPC-explorer ***"
sudo systemctl stop btc-rpc-explorer
sudo systemctl disable btc-rpc-explorer
sudo rm /etc/systemd/system/btc-rpc-explorer.service
sudo rm -rf /home/btcrpcexplorer/btc-rpc-explorer
sudo rm -f /home/btcrpcexplorer/.config/btc-rpc-explorer.env
# delete user and home directory
sudo userdel -rf btcrpcexplorer
# remove nginx symlinks
sudo rm -f /etc/nginx/sites-enabled/btcrpcexplorer_ssl.conf
sudo rm -f /etc/nginx/sites-enabled/btcrpcexplorer_tor.conf
sudo rm -f /etc/nginx/sites-enabled/btcrpcexplorer_tor_ssl.conf
sudo nginx -t
sudo systemctl reload nginx
echo "OK BTC-RPC-explorer removed."
else
echo "BTC-RPC-explorer is not installed."
fi
# close ports on firewall
sudo ufw deny 3020
sudo ufw deny 3021
exit 0
fi

View File

@ -109,12 +109,44 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# exit 1
#fi
if [ "$2" == "tor" ]; then
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain='localhost'/g" /mnt/hdd/raspiblitz.conf
/home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000
else
echo "# FAIL - at the moment only BTCPay Server over TOR is supported"
exit 1
#if [ "$2" == "tor" ]; then
# sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain='localhost'/g" /mnt/hdd/raspiblitz.conf
# /home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000
#else
# echo "# FAIL - at the moment only BTCPay Server over TOR is supported"
# exit 1
#fi
##################
# NGINX
##################
# setup nginx symlinks
if ! [ -f /etc/nginx/sites-available/btcpay_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcpay_ssl.conf /etc/nginx/sites-available/btcpay_ssl.conf
fi
if ! [ -f /etc/nginx/sites-available/btcpay_tor.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcpay_tor.conf /etc/nginx/sites-available/btcpay_tor.conf
fi
if ! [ -f /etc/nginx/sites-available/btcpay_tor_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/btcpay_tor_ssl.conf /etc/nginx/sites-available/btcpay_tor_ssl.conf
fi
sudo ln -sf /etc/nginx/sites-available/btcpay_ssl.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/btcpay_tor.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/btcpay_tor_ssl.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
# open the firewall
echo "*** Updating Firewall ***"
sudo ufw allow 23000 comment 'allow BTCPay HTTP'
sudo ufw allow 23001 comment 'allow BTCPay HTTPS'
echo ""
# Hidden Service for BTCPay if Tor is active
if [ "${runBehindTor}" = "on" ]; then
# correct old Hidden Service with port
sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:23000/HiddenServicePort 80 127.0.0.1:23002/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23002 443 23003
fi
# check for $BTCPayDomain
@ -148,8 +180,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "***"
echo ""
# download dotnet-sdk
# https://dotnet.microsoft.com/download/dotnet-core/3.1
# dependencies
@ -392,9 +422,15 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# clear app config (not user data)
sudo rm -f /home/btcpay/.nbxplorer/Main/settings.config
sudo rm -f /home/btcpay/.btcpayserver/Main/settings.config
# clear nginx config
# clear nginx config (from btcpaysetdomain)
sudo rm -f /etc/nginx/sites-enabled/btcpayserver
sudo rm -f /etc/nginx/sites-available/btcpayserver
# remove nginx symlinks
sudo rm -f /etc/nginx/sites-enabled/btcpay_ssl.conf
sudo rm -f /etc/nginx/sites-enabled/btcpay_tor.conf
sudo rm -f /etc/nginx/sites-enabled/btcpay_tor_ssl.conf
sudo nginx -t
sudo systemctl reload nginx
# nuke user
sudo userdel -rf btcpay 2>/dev/null
echo "OK BTCPayServer removed."

View File

@ -30,11 +30,13 @@ if [ "$1" = "menu" ]; then
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
whiptail --title " Cryptoadvance Specter " --msgbox "Open the following URL in your local web browser:
https://${localip}:25441
You have to accept the self-signed-certificate.
Login with the Pin being Password B. If you have connected to a different Bitcoin RPC Endpoint, the Pin is the configured RPCPassword.
Hidden Service address for TOR Browser (QR see LCD):
${toraddress}\n
" 16 70
" 15 74
/home/admin/config.scripts/blitz.lcd.sh hide
else
@ -236,7 +238,9 @@ EOF
if [ "${runBehindTor}" = "on" ]; then
echo "# --> correct old Hidden Service with port"
sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:25441/HiddenServicePort 80 127.0.0.1:25441/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 80 25441
sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:80/HiddenServicePort 443 127.0.0.1:25441/g" /etc/tor/torrc
# port 25441 is HTTPS with self-signed cert
/home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 443 25441
fi
exit 0
fi

View File

@ -5,7 +5,7 @@
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "config script to switch the Electrum Rust Server on or off"
echo "bonus.electrs.sh [on|off|status|menu]"
echo "bonus.electrs.sh [on|off|status[showAddress]|menu]"
exit 1
fi
@ -66,7 +66,9 @@ if [ "$1" = "status" ]; then
# check local IPv4 port
localIP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo "localIP='${localIP}'"
echo "publicIP='${publicIP}'"
if [ "$2" = "showAddress" ]; then
echo "publicIP='${publicIP}'"
fi
echo "portTCP='50001'"
localPortRunning=$(sudo netstat -a | grep -c '0.0.0.0:50001')
echo "localTCPPortActive=${localPortRunning}"
@ -92,8 +94,10 @@ if [ "$1" = "status" ]; then
# add TOR info
if [ "${runBehindTor}" == "on" ]; then
echo "TORrunning=1"
TORaddress=$(sudo cat /mnt/hdd/tor/electrs/hostname)
echo "TORaddress='${TORaddress}'"
if [ "$2" = "showAddress" ]; then
TORaddress=$(sudo cat /mnt/hdd/tor/electrs/hostname)
echo "TORaddress='${TORaddress}'"
fi
else
echo "TORrunning=0"
fi
@ -115,7 +119,7 @@ if [ "$1" = "menu" ]; then
# get status
echo "# collecting status info ... (please wait)"
source <(sudo /home/admin/config.scripts/bonus.electrs.sh status)
source <(sudo /home/admin/config.scripts/bonus.electrs.sh status showAddress)
if [ ${serviceInstalled} -eq 0 ]; then
echo "# FAIL not installed"
@ -153,7 +157,7 @@ Check 'sudo nginx -t' for a detailed error message.
sudo mkdir /var/log/nginx
sudo systemctl restart nginx
fi
/home/admin/config.scripts/internet.selfsignedcert.sh
/home/admin/config.scripts/blitz.web.sh
echo "Press ENTER to get back to main menu."
read key
exit 0
@ -326,13 +330,6 @@ EOF
sudo mv /home/admin/config.toml /home/electrs/.electrs/config.toml
sudo chown electrs:electrs /home/electrs/.electrs/config.toml
echo ""
echo "***"
echo "Open port 50001 on UFW "
echo "***"
echo ""
sudo ufw allow 50001 comment 'electrs TCP'
echo ""
echo "***"
echo "Checking for config.toml"
@ -346,9 +343,6 @@ EOF
echo "OK"
fi
# create a self-signed ssl certificate
/home/admin/config.scripts/internet.selfsignedcert.sh
echo ""
echo "***"
echo "Setting up nginx.conf"
@ -372,11 +366,11 @@ stream {
server {
listen 50002 ssl;
proxy_pass electrs;
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_certificate /mnt/hdd/app-data/nginx/tls.cert;
ssl_certificate_key /mnt/hdd/app-data/nginx/tls.key;
ssl_session_cache shared:SSL-electrs:1m;
ssl_session_timeout 4h;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
}
}" | sudo tee -a /etc/nginx/nginx.conf
@ -390,11 +384,11 @@ stream {
server {
listen 50002 ssl;
proxy_pass electrs;
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_certificate /mnt/hdd/app-data/nginx/tls.cert;
ssl_certificate_key /mnt/hdd/app-data/nginx/tls.key;
ssl_session_cache shared:SSL-electrs:1m;
ssl_session_timeout 4h;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
}
}" | sudo tee -a /etc/nginx/nginx.conf
@ -405,12 +399,16 @@ stream {
fi
fi
echo "allow port 50002 on ufw"
sudo ufw allow 50002 comment 'electrs-nginx SSL'
sudo systemctl enable nginx
sudo systemctl restart nginx
echo ""
echo "***"
echo "Open ports 50001 and 5002 on UFW "
echo "***"
echo ""
sudo ufw allow 50001 comment 'electrs TCP'
sudo ufw allow 50002 comment 'electrs SSL'
echo ""
echo "***"
echo "Installing the systemd service"
@ -485,17 +483,13 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
if [ ${isInstalled} -eq 1 ]; then
echo "#*** REMOVING ELECTRS ***"
sudo systemctl stop electrs
sudo systemctl disable electrs
sudo rm /etc/systemd/system/electrs.service
sudo rm -rf /home/electrs/electrs
sudo rm -rf /home/electrs/.cargo
sudo rm -rf /home/electrs/.rustup
sudo rm -rf /home/electrs/.profile
# delete user and home directory
sudo userdel -rf electrs
# close ports on firewall
sudo ufw deny 50001
sudo ufw deny 50002
echo "# OK ElectRS removed."
## Disable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active

View File

@ -108,34 +108,55 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
pip install qrcode[pil]
pip install https://github.com/sunu/qt5reactor/archive/58410aaead2185e9917ae9cac9c50fe7b70e4a60.zip#egg=qt5reactor
# add the joininbox menu
sudo rm -rf /home/joinmarket/joininbox
sudo -u joinmarket git clone https://github.com/openoms/joininbox.git /home/joinmarket/joininbox
sudo -u joinmarket cp /home/joinmarket/joininbox/scripts/* /home/joinmarket/
sudo -u joinmarket cp /home/joinmarket/joininbox/scripts/.* /home/joinmarket/ 2>/dev/null
sudo chmod +x /home/joinmarket/*.sh
# joinin.conf settings
sudo -u joinmarket touch /home/joinmarket/joinin.conf
# tor config
# add default value to joinin.conf if needed
checkTorEntry=$(sudo -u joinmarket cat /home/joinmarket/joinin.conf | grep -c "runBehindTor")
if [ ${checkTorEntry} -eq 0 ]; then
echo "runBehindTor=off" | sudo -u joinmarket tee -a /home/joinmarket/joinin.conf
fi
checkAllowOutboundLocalhost=$(sudo cat /etc/tor/torsocks.conf | grep -c "AllowOutboundLocalhost 1")
if [ ${checkAllowOutboundLocalhost} -eq 0 ]; then
echo "AllowOutboundLocalhost 1" | sudo tee -a /etc/tor/torsocks.conf
sudo systemctl restart tor
fi
# setting value in joinin config
checkBlitzTorEntry=$(cat /mnt/hdd/raspiblitz.conf | grep -c "runBehindTor=on")
if [ ${checkBlitzTorEntry} -gt 0 ]; then
sudo -u joinmarket sed -i "s/^runBehindTor=.*/runBehindTor=on/g" /home/joinmarket/joinin.conf
fi
# autostart for joinmarket
bash -c "echo '# command: torthistx' >> /home/joinmarket/.bashrc"
bash -c "echo 'function torthistx() {' >> /home/joinmarket/.bashrc"
bash -c "echo 'echo \"Broadcasting transaction through Tor to the Blockstream API and into the network.\"' >> /home/joinmarket/.bashrc"
bash -c "echo 'curl --socks5-hostname localhost:9050 -d \$1 -X POST http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/api/tx' >> /home/joinmarket/.bashrc"
bash -c "echo '}' >> /home/joinmarket/.bashrc"
bash -c "echo '# automatically start startup.sh for joinmarket unless' >> /home/joinmarket/.bashrc"
bash -c "echo '# when running in a tmux session' >> /home/joinmarket/.bashrc"
bash -c "echo 'if [ -z \"\$TMUX\" ]; then' >> /home/joinmarket/.bashrc"
bash -c "echo ' /home/joinmarket/startup.sh' >> /home/joinmarket/.bashrc"
bash -c "echo 'fi' >> /home/joinmarket/.bashrc"
bash -c "echo '# always activate jmvenv with PySide2 and cd to scripts' >> /home/joinmarket/.bashrc"
bash -c "echo '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate' >> /home/joinmarket/.bashrc"
bash -c "echo '/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"' >> /home/joinmarket/.bashrc"
bash -c "echo 'cd /home/joinmarket/joinmarket-clientserver/scripts/' >> /home/joinmarket/.bashrc"
echo "
# automatically start startup.sh for joinmarket unless
# when running in a tmux session
if [ -z \"\$TMUX\" ]; then
/home/joinmarket/startup.sh
fi
# always activate jmvenv with PySide2 and cd to scripts'
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"
cd /home/joinmarket/joinmarket-clientserver/scripts/
# shortcut commands
source /home/joinmarket/_commands.sh
# automatically start main menu for joinmarket unless
# when running in a tmux session
if [ -z \"\$TMUX\" ]; then
/home/joinmarket/menu.sh
fi
" | sudo -u joinmarket tee -a /home/joinmarket/.bashrc
cat > /home/admin/startup.sh <<EOF
# check for joinmarket.cfg
if [ -f "/home/joinmarket/.joinmarket/joinmarket.cfg" ] ; then
echo ""
echo "Welcome to the JoinMarket command line!"
echo ""
echo "Notes on usage:"
echo "https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md"
echo ""
echo "To return to the RaspiBlitz menu open a new a terminal window or use: exit"
echo ""
else
if [ ! -f "/home/joinmarket/.joinmarket/joinmarket.cfg" ] ; then
echo "Generating the joinmarket.cfg"
echo ""
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate &&\
@ -158,21 +179,11 @@ else
sed -i "s/^#port = 6667/port = 6667/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sed -i "s/^#usessl = false/usessl = false/g" /home/joinmarket/.joinmarket/joinmarket.cfg
echo "Edited the joinmarket.cfg to communicate over Tor only."
echo ""
echo "Welcome to the JoinMarket command line!"
echo ""
echo "Notes on usage:"
echo "https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md"
echo ""
echo "To return to the RaspiBlitz menu open a new a terminal window or use: exit"
echo ""
fi
EOF
mv /home/admin/startup.sh /home/joinmarket/startup.sh
chown joinmarket:joinmarket /home/joinmarket/startup.sh
chmod +x /home/joinmarket/startup.sh
else
echo "JoinMarket is already installed"
echo ""
@ -194,7 +205,6 @@ EOF
fi
exit 0
fi
# switch off

View File

@ -239,9 +239,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo sed -i "s/^LNBits=.*/LNBits=off/g" /mnt/hdd/raspiblitz.conf
# remove nginx symlinks
sudo rm -f /etc/nginx/sites-enabled/lnbits_5001_https.conf
sudo rm -f /etc/nginx/sites-enabled/lnbits_5002_http.conf
sudo rm -f /etc/nginx/sites-enabled/lnbits_5003_https.conf
sudo rm -f /etc/nginx/sites-enabled/lnbits_ssl.conf
sudo rm -f /etc/nginx/sites-enabled/lnbits_tor.conf
sudo rm -f /etc/nginx/sites-enabled/lnbits_tor_ssl.conf
sudo nginx -t
sudo systemctl reload nginx

View File

@ -46,7 +46,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
if [ ${lndInstalledVersionMain} -lt 10 ]; then
sudo -u bitcoin git reset --hard v0.5.1-beta
else
sudo -u bitcoin git reset --hard v0.6.3-beta
sudo -u bitcoin git reset --hard v0.6.4-beta
fi
cd /home/bitcoin/loop/cmd
go install ./...

View File

@ -29,19 +29,21 @@ if [ "$1" = "menu" ]; then
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
whiptail --title " Ride The Lightning (RTL) " --msgbox "Open the following URL in your local web browser:
https://${localip}:3001
SHA1 Thumb/Fingerprint: ${fingerprint}\n
SHA1 Thumb/Fingerprint:
${fingerprint}\n
Use your Password B to login.\n
Hidden Service address for TOR Browser (QR see LCD):\n${toraddress}
" 14 67
Hidden Service address for TOR Browser (QRcode on LCD):\n${toraddress}
" 15 67
/home/admin/config.scripts/blitz.lcd.sh hide
else
# Info without TOR
whiptail --title " Ride The Lightning (RTL) " --msgbox "Open the following URL in your local web browser:
https://${localip}:3001
SHA1 Thumb/Fingerprint: ${fingerprint}\n
SHA1 Thumb/Fingerprint:
${fingerprint}\n
Use your Password B to login.\n
Activate TOR to access the web interface from outside your local network.
" 13 57
" 14 57
fi
echo "please wait ..."
exit 0
@ -172,7 +174,8 @@ EOF
# open firewall
echo "*** Updating Firewall ***"
sudo ufw allow 3000 comment 'RTL'
sudo ufw allow 3000 comment 'RTL HTTP'
sudo ufw allow 3001 comment 'RTL HTTPS'
echo ""
# install service
@ -212,6 +215,7 @@ EOF
# Hidden Service for RTL if Tor is active
if [ "${runBehindTor}" = "on" ]; then
# correct old Hidden Service with port
sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:3000/HiddenServicePort 80 127.0.0.1:3002/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh RTL 80 3002 443 3003
fi
exit 0
@ -223,7 +227,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
# setting value in raspi blitz config
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=off/g" /mnt/hdd/raspiblitz.conf
# setup nginx symlinks
# remove nginx symlinks
sudo rm -f /etc/nginx/sites-enabled/rtl_ssl.conf
sudo rm -f /etc/nginx/sites-enabled/rtl_tor.conf
sudo rm -f /etc/nginx/sites-enabled/rtl_tor_ssl.conf
@ -233,15 +237,19 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service')
if [ ${isInstalled} -eq 1 ]; then
echo "*** REMOVING RTL ***"
sudo systemctl stop RTL
sudo systemctl disable RTL
sudo rm /etc/systemd/system/RTL.service
sudo rm -rf /home/rtl/RTL
# delete user and home directory
sudo userdel -rf rtl
echo "OK RTL removed."
else
echo "RTL is not installed."
fi
# close ports on firewall
sudo ufw deny 3000
sudo ufw deny 3001
echo "needs reboot to activate new setting"
exit 0
fi

View File

@ -22,23 +22,28 @@ if [ "$1" = "menu" ]; then
# get network info
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
toraddress=$(sudo cat /mnt/hdd/tor/thunderhub/hostname 2>/dev/null)
fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2)
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
whiptail --title " ThunderHub " --msgbox "Open the following URL in your local web browser:
http://${localip}:3010
https://${localip}:3011
SHA1 Thumb/Fingerprint:
${fingerprint}\n
Use your Password B to login.\n
Hidden Service address for TOR Browser (QR see LCD):\n${toraddress}
" 12 67
Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress}
" 15 67
/home/admin/config.scripts/blitz.lcd.sh hide
else
# Info without TOR
whiptail --title " ThunderHub " --msgbox "Open the following URL in your local web browser:
http://${localip}:3010
https://${localip}:3011
SHA1 Thumb/Fingerprint:
${fingerprint}\n
Use your Password B to login.\n
Activate TOR to access the web interface from outside your local network.
" 12 57
" 14 57
fi
echo "please wait ..."
exit 0
@ -76,7 +81,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u thunderhub git clone https://github.com/apotdevin/thunderhub.git /home/thunderhub/thunderhub
cd /home/thunderhub/thunderhub
# https://github.com/apotdevin/thunderhub/releases
sudo -u thunderhub git reset --hard v0.7.1
sudo -u thunderhub git reset --hard v0.8.0
echo "Running npm install and run build..."
sudo -u thunderhub npm install
sudo -u thunderhub npm run build
@ -110,9 +115,17 @@ LOG_LEVEL='debug'
# Interface Configs
# -----------
THEME='dark'
# CURRENCY='sat'
# FETCH_PRICES=false
# FETCH_FEES=false
CURRENCY='sat'
# -----------
# Privacy Configs
# -----------
FETCH_PRICES=false
FETCH_FEES=false
HODL_HODL=false
DISABLE_LINKS=true
NO_CLIENT_ACCOUNTS=true
NO_VERSION_CHECK=true
# -----------
# Account Configs
@ -144,6 +157,31 @@ EOF
sudo chown thunderhub:thunderhub /home/thunderhub/thubConfig.yaml
sudo chmod 600 /home/thunderhub/thubConfig.yaml | exit 1
##################
# NGINX
##################
# setup nginx symlinks
if ! [ -f /etc/nginx/sites-available/thub_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/thub_ssl.conf /etc/nginx/sites-available/thub_ssl.conf
fi
if ! [ -f /etc/nginx/sites-available/thub_tor.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/thub_tor.conf /etc/nginx/sites-available/thub_tor.conf
fi
if ! [ -f /etc/nginx/sites-available/thub_tor_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/thub_tor_ssl.conf /etc/nginx/sites-available/thub_tor_ssl.conf
fi
sudo ln -sf /etc/nginx/sites-available/thub_ssl.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/thub_tor.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/thub_tor_ssl.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
# open the firewall
echo "*** Updating Firewall ***"
sudo ufw allow from any to any port 3010 comment 'allow ThunderHub HTTP'
sudo ufw allow from any to any port 3011 comment 'allow ThunderHub HTTPS'
echo ""
##################
# SYSTEMD SERVICE
##################
@ -176,15 +214,14 @@ EOF
sudo systemctl enable thunderhub
echo "OK - the ThunderHub service is now enabled"
# open the firewall
sudo ufw allow from any to any port 3010 comment 'allow ThunderHub'
# setting value in raspiblitz config
sudo sed -i "s/^thunderhub=.*/thunderhub=on/g" /mnt/hdd/raspiblitz.conf
# Hidden Service for thunderhub if Tor is active
if [ "${runBehindTor}" = "on" ]; then
/home/admin/config.scripts/internet.hiddenservice.sh thunderhub 80 3010
# correct old Hidden Service with port
sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:3001/HiddenServicePort 80 127.0.0.1:3012/g" /etc/tor/torrc
/home/admin/config.scripts/internet.hiddenservice.sh thunderhub 80 3012 443 3013
fi
fi
exit 0
@ -199,6 +236,17 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
sudo rm -f /etc/systemd/system/thunderhub.service
# delete user and home directory
sudo userdel -rf thunderhub
# close ports on firewall
sudo ufw deny 3010
sudo ufw deny 3011
# remove nginx symlinks
sudo rm -f /etc/nginx/sites-enabled/thub_ssl.conf
sudo rm -f /etc/nginx/sites-enabled/thub_tor.conf
sudo rm -f /etc/nginx/sites-enabled/thub_tor_ssl.conf
sudo nginx -t
sudo systemctl reload nginx
echo "OK ThunderHub removed."
# setting value in raspi blitz config

View File

@ -92,6 +92,7 @@ HiddenServicePort $toPort 127.0.0.1:$fromPort" | sudo tee -a /etc/tor/torrc
echo "use with the port: $toPort"
echo ""
if [ ${#toPort2} -gt 0 ]; then
alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c "\b127.0.0.1:$fromPort2\b")
if [ ${alreadyThere} -eq 0 ]; then
echo "or the port: $toPort2"
else

View File

@ -5,8 +5,8 @@ import sys
from pathlib import Path
import grpc
from lndlibs import rpc_pb2 as ln
from lndlibs import rpc_pb2_grpc as lnrpc
from lndlibs import walletunlocker_pb2 as lnrpc
from lndlibs import walletunlocker_pb2_grpc as rpcstub
if sys.version_info < (3, 0):
print("Can't run on Python2")
@ -14,9 +14,6 @@ if sys.version_info < (3, 0):
# display config script info
if len(sys.argv) <= 1 or sys.argv[1] in ["-h", "--help", "help"]:
print("# ! always activate virtual env first: source /home/admin/python3-env-lnd/bin/activate")
print("# ! and run with with: python3 /home/admin/config.scripts/lnd.initwallet.py")
print("# ! Or: /home/admin/python3-env-lnd/bin/python3 /home/admin/config.scripts/lnd.initwallet.py")
print("# creating or recovering the LND wallet")
print("# lnd.initwallet.py new [walletpassword] [?seedpassword]")
print("# lnd.initwallet.py seed [walletpassword] [\"seeds-words-seperated-spaces\"] [?seedpassword]")
@ -26,14 +23,13 @@ if len(sys.argv) <= 1 or sys.argv[1] in ["-h", "--help", "help"]:
mode = sys.argv[1]
def new(stub, wallet_password="", seed_entropy=None):
if seed_entropy:
# provide 16-bytes of static data to get reproducible seeds for TESTING!)
print("WARNING: Use this for testing only!!")
request = ln.GenSeedRequest(seed_entropy=seed_entropy)
request = lnrpc.GenSeedRequest(seed_entropy=seed_entropy)
else:
request = ln.GenSeedRequest()
request = lnrpc.GenSeedRequest()
try:
response = stub.GenSeed(request)
@ -65,7 +61,7 @@ def new(stub, wallet_password="", seed_entropy=None):
print("err='GenSeedRequest'")
sys.exit(1)
request = ln.InitWalletRequest(
request = lnrpc.InitWalletRequest(
wallet_password=wallet_password.encode(),
cipher_seed_mnemonic=seed_words
)
@ -86,7 +82,7 @@ def new(stub, wallet_password="", seed_entropy=None):
def seed(stub, wallet_password="", seed_words="", seed_password=""):
request = ln.InitWalletRequest(
request = lnrpc.InitWalletRequest(
wallet_password=wallet_password.encode(),
cipher_seed_mnemonic=[x.encode() for x in seed_words],
recovery_window=5000,
@ -115,7 +111,7 @@ def scb(stub, wallet_password="", seed_words="", seed_password="", file_path_scb
scb_hex_str = binascii.hexlify(content)
print(scb_hex_str)
request = ln.InitWalletRequest(
request = lnrpc.InitWalletRequest(
wallet_password=wallet_password.encode(),
cipher_seed_mnemonic=[x.encode() for x in seed_words],
recovery_window=5000,
@ -218,7 +214,7 @@ def main():
cert = open('/mnt/hdd/lnd/tls.cert', 'rb').read()
ssl_creds = grpc.ssl_channel_credentials(cert)
channel = grpc.secure_channel('localhost:10009', ssl_creds)
stub = lnrpc.WalletUnlockerStub(channel)
stub = rpcstub.WalletUnlockerStub(channel)
wallet_password, seed_words, seed_password, file_path_scb = parse_args()

View File

@ -77,6 +77,15 @@ fi
### REFRESH
if [ "$1" = "refresh" ]; then
echo "# checking if LND is running"
lndInactive=$(sudo systemctl is-active lnd | grep -c "inactive")
if [ ${lndInactive} -eq 1 ]; then
echo "# FAIL: lnd.tlscert.sh refresh"
echo "error='LND systemd service not activated'"
exit 1
fi
echo "# making sure services are not running"
sudo systemctl stop lnd 2>/dev/null

View File

@ -8,13 +8,20 @@ To generate the lnd RPC libs - login as admin and run:
cd
python3 -m pip install grpcio grpcio-tools googleapis-common-protos pathlib2
git clone https://github.com/googleapis/googleapis.git
curl -o rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
python -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. rpc.proto
mkdir protobuffs
curl -o ./rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
curl -o ./walletunlocker.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/walletunlocker.proto
python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=./protobuffs --grpc_python_out=./protobuffs ./rpc.proto ./walletunlocker.proto
cp ./*.proto ./protobuffs
````
*NOTE: If LND master branch is already a version ahead .. use the rpc.proto from the version tagged branch.*
Make sure the first 3 lines of the rpc_pb2_grpc.py look like the following for python3 compatibility:
Now copy the generated RPC libs per SCP over to your Laptop and add them to the `/home/admin/config.scripts/lndlibs`.
scp -r admin@192.168.X.X:/home/admin/protobuffs ./protobuffs
Make sure the first lines (ignore comments) of the `rpc_pb2_grpc.py` look like the following for python3 compatibility:
```
from __future__ import absolute_import
import grpc
@ -22,9 +29,26 @@ import grpc
from . import rpc_pb2 as rpc__pb2
```
Now copy the generated RPC libs per SCP over to your Laptop and add them to the `/home/admin/config.scripts/lndlibs`.
Make sure the first lines (ignore comments) of the `walletunlocker_pb2_grpc.py` look like the following for python3 compatibility:
```
from __future__ import absolute_import
import grpc
from . import walletunlocker_pb2 as walletunlocker__pb2
```
Make sure the first lines (ignore comments) of the `walletunlocker_pb2.py` look like the following for python3 compatibility:
```
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from . import rpc_pb2 as rpc__pb2
```
scp admin@192.168.X.X:/home/admin/rpc_pb2_grpc.py ./
scp admin@192.168.X.X:/home/admin/rpc.proto ./
scp admin@192.168.X.X:/home/admin/rpc_pb2.py ./

View File

@ -46,6 +46,11 @@ service Lightning {
/* lncli: `estimatefee`
EstimateFee asks the chain backend to estimate the fee rate and total fees
for a transaction that pays to multiple specified outputs.
When using REST, the `AddrToAmount` map type can be set by appending
`&AddrToAmount[<address>]=<amount_to_send>` to the URL. Unfortunately this
map type doesn't appear in the REST API documentation because of a bug in
the grpc-gateway library.
*/
rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
@ -355,6 +360,11 @@ service Lightning {
satoshis. The returned route contains the full details required to craft and
send an HTLC, also including the necessary information that should be
present within the Sphinx packet encapsulated within the HTLC.
When using REST, the `dest_custom_records` map type can be set by appending
`&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
to the URL. Unfortunately this map type doesn't appear in the REST API
documentation because of a bug in the grpc-gateway library.
*/
rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse);

View File

@ -362,6 +362,11 @@ class LightningServicer(object):
"""lncli: `estimatefee`
EstimateFee asks the chain backend to estimate the fee rate and total fees
for a transaction that pays to multiple specified outputs.
When using REST, the `AddrToAmount` map type can be set by appending
`&AddrToAmount[<address>]=<amount_to_send>` to the URL. Unfortunately this
map type doesn't appear in the REST API documentation because of a bug in
the grpc-gateway library.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
@ -777,6 +782,11 @@ class LightningServicer(object):
satoshis. The returned route contains the full details required to craft and
send an HTLC, also including the necessary information that should be
present within the Sphinx packet encapsulated within the HTLC.
When using REST, the `dest_custom_records` map type can be set by appending
`&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
to the URL. Unfortunately this map type doesn't appear in the REST API
documentation because of a bug in the grpc-gateway library.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')

View File

@ -0,0 +1,192 @@
syntax = "proto3";
import "rpc.proto";
package lnrpc;
option go_package = "github.com/lightningnetwork/lnd/lnrpc";
/*
* Comments in this file will be directly parsed into the API
* Documentation as descriptions of the associated method, message, or field.
* These descriptions should go right above the definition of the object, and
* can be in either block or // comment format.
*
* An RPC method can be matched to an lncli command by placing a line in the
* beginning of the description in exactly the following format:
* lncli: `methodname`
*
* Failure to specify the exact name of the command will cause documentation
* generation to fail.
*
* More information on how exactly the gRPC documentation is generated from
* this proto file can be found here:
* https://github.com/lightninglabs/lightning-api
*/
// WalletUnlocker is a service that is used to set up a wallet password for
// lnd at first startup, and unlock a previously set up wallet.
service WalletUnlocker {
/*
GenSeed is the first method that should be used to instantiate a new lnd
instance. This method allows a caller to generate a new aezeed cipher seed
given an optional passphrase. If provided, the passphrase will be necessary
to decrypt the cipherseed to expose the internal wallet seed.
Once the cipherseed is obtained and verified by the user, the InitWallet
method should be used to commit the newly generated seed, and create the
wallet.
*/
rpc GenSeed (GenSeedRequest) returns (GenSeedResponse);
/*
InitWallet is used when lnd is starting up for the first time to fully
initialize the daemon and its internal wallet. At the very least a wallet
password must be provided. This will be used to encrypt sensitive material
on disk.
In the case of a recovery scenario, the user can also specify their aezeed
mnemonic and passphrase. If set, then the daemon will use this prior state
to initialize its internal wallet.
Alternatively, this can be used along with the GenSeed RPC to obtain a
seed, then present it to the user. Once it has been verified by the user,
the seed can be fed into this RPC in order to commit the new wallet.
*/
rpc InitWallet (InitWalletRequest) returns (InitWalletResponse);
/* lncli: `unlock`
UnlockWallet is used at startup of lnd to provide a password to unlock
the wallet database.
*/
rpc UnlockWallet (UnlockWalletRequest) returns (UnlockWalletResponse);
/* lncli: `changepassword`
ChangePassword changes the password of the encrypted wallet. This will
automatically unlock the wallet database if successful.
*/
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse);
}
message GenSeedRequest {
/*
aezeed_passphrase is an optional user provided passphrase that will be used
to encrypt the generated aezeed cipher seed. When using REST, this field
must be encoded as base64.
*/
bytes aezeed_passphrase = 1;
/*
seed_entropy is an optional 16-bytes generated via CSPRNG. If not
specified, then a fresh set of randomness will be used to create the seed.
When using REST, this field must be encoded as base64.
*/
bytes seed_entropy = 2;
}
message GenSeedResponse {
/*
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
cipher seed obtained by the user. This field is optional, as if not
provided, then the daemon will generate a new cipher seed for the user.
Otherwise, then the daemon will attempt to recover the wallet state linked
to this cipher seed.
*/
repeated string cipher_seed_mnemonic = 1;
/*
enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
cipher text before run through our mnemonic encoding scheme.
*/
bytes enciphered_seed = 2;
}
message InitWalletRequest {
/*
wallet_password is the passphrase that should be used to encrypt the
wallet. This MUST be at least 8 chars in length. After creation, this
password is required to unlock the daemon. When using REST, this field
must be encoded as base64.
*/
bytes wallet_password = 1;
/*
cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
cipher seed obtained by the user. This may have been generated by the
GenSeed method, or be an existing seed.
*/
repeated string cipher_seed_mnemonic = 2;
/*
aezeed_passphrase is an optional user provided passphrase that will be used
to encrypt the generated aezeed cipher seed. When using REST, this field
must be encoded as base64.
*/
bytes aezeed_passphrase = 3;
/*
recovery_window is an optional argument specifying the address lookahead
when restoring a wallet seed. The recovery window applies to each
individual branch of the BIP44 derivation paths. Supplying a recovery
window of zero indicates that no addresses should be recovered, such after
the first initialization of the wallet.
*/
int32 recovery_window = 4;
/*
channel_backups is an optional argument that allows clients to recover the
settled funds within a set of channels. This should be populated if the
user was unable to close out all channels and sweep funds before partial or
total data loss occurred. If specified, then after on-chain recovery of
funds, lnd begin to carry out the data loss recovery protocol in order to
recover the funds in each channel from a remote force closed transaction.
*/
ChanBackupSnapshot channel_backups = 5;
}
message InitWalletResponse {
}
message UnlockWalletRequest {
/*
wallet_password should be the current valid passphrase for the daemon. This
will be required to decrypt on-disk material that the daemon requires to
function properly. When using REST, this field must be encoded as base64.
*/
bytes wallet_password = 1;
/*
recovery_window is an optional argument specifying the address lookahead
when restoring a wallet seed. The recovery window applies to each
individual branch of the BIP44 derivation paths. Supplying a recovery
window of zero indicates that no addresses should be recovered, such after
the first initialization of the wallet.
*/
int32 recovery_window = 2;
/*
channel_backups is an optional argument that allows clients to recover the
settled funds within a set of channels. This should be populated if the
user was unable to close out all channels and sweep funds before partial or
total data loss occurred. If specified, then after on-chain recovery of
funds, lnd begin to carry out the data loss recovery protocol in order to
recover the funds in each channel from a remote force closed transaction.
*/
ChanBackupSnapshot channel_backups = 3;
}
message UnlockWalletResponse {
}
message ChangePasswordRequest {
/*
current_password should be the current valid passphrase used to unlock the
daemon. When using REST, this field must be encoded as base64.
*/
bytes current_password = 1;
/*
new_password should be the new passphrase that will be needed to unlock the
daemon. When using REST, this field must be encoded as base64.
*/
bytes new_password = 2;
}
message ChangePasswordResponse {
}

View File

@ -0,0 +1,439 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: walletunlocker.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from . import rpc_pb2 as rpc__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='walletunlocker.proto',
package='lnrpc',
syntax='proto3',
serialized_options=b'Z%github.com/lightningnetwork/lnd/lnrpc',
serialized_pb=b'\n\x14walletunlocker.proto\x12\x05lnrpc\x1a\trpc.proto\"A\n\x0eGenSeedRequest\x12\x19\n\x11\x61\x65zeed_passphrase\x18\x01 \x01(\x0c\x12\x14\n\x0cseed_entropy\x18\x02 \x01(\x0c\"H\n\x0fGenSeedResponse\x12\x1c\n\x14\x63ipher_seed_mnemonic\x18\x01 \x03(\t\x12\x17\n\x0f\x65nciphered_seed\x18\x02 \x01(\x0c\"\xb2\x01\n\x11InitWalletRequest\x12\x17\n\x0fwallet_password\x18\x01 \x01(\x0c\x12\x1c\n\x14\x63ipher_seed_mnemonic\x18\x02 \x03(\t\x12\x19\n\x11\x61\x65zeed_passphrase\x18\x03 \x01(\x0c\x12\x17\n\x0frecovery_window\x18\x04 \x01(\x05\x12\x32\n\x0f\x63hannel_backups\x18\x05 \x01(\x0b\x32\x19.lnrpc.ChanBackupSnapshot\"\x14\n\x12InitWalletResponse\"{\n\x13UnlockWalletRequest\x12\x17\n\x0fwallet_password\x18\x01 \x01(\x0c\x12\x17\n\x0frecovery_window\x18\x02 \x01(\x05\x12\x32\n\x0f\x63hannel_backups\x18\x03 \x01(\x0b\x32\x19.lnrpc.ChanBackupSnapshot\"\x16\n\x14UnlockWalletResponse\"G\n\x15\x43hangePasswordRequest\x12\x18\n\x10\x63urrent_password\x18\x01 \x01(\x0c\x12\x14\n\x0cnew_password\x18\x02 \x01(\x0c\"\x18\n\x16\x43hangePasswordResponse2\xa5\x02\n\x0eWalletUnlocker\x12\x38\n\x07GenSeed\x12\x15.lnrpc.GenSeedRequest\x1a\x16.lnrpc.GenSeedResponse\x12\x41\n\nInitWallet\x12\x18.lnrpc.InitWalletRequest\x1a\x19.lnrpc.InitWalletResponse\x12G\n\x0cUnlockWallet\x12\x1a.lnrpc.UnlockWalletRequest\x1a\x1b.lnrpc.UnlockWalletResponse\x12M\n\x0e\x43hangePassword\x12\x1c.lnrpc.ChangePasswordRequest\x1a\x1d.lnrpc.ChangePasswordResponseB\'Z%github.com/lightningnetwork/lnd/lnrpcb\x06proto3'
,
dependencies=[rpc__pb2.DESCRIPTOR,])
_GENSEEDREQUEST = _descriptor.Descriptor(
name='GenSeedRequest',
full_name='lnrpc.GenSeedRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='aezeed_passphrase', full_name='lnrpc.GenSeedRequest.aezeed_passphrase', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='seed_entropy', full_name='lnrpc.GenSeedRequest.seed_entropy', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=42,
serialized_end=107,
)
_GENSEEDRESPONSE = _descriptor.Descriptor(
name='GenSeedResponse',
full_name='lnrpc.GenSeedResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='cipher_seed_mnemonic', full_name='lnrpc.GenSeedResponse.cipher_seed_mnemonic', index=0,
number=1, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='enciphered_seed', full_name='lnrpc.GenSeedResponse.enciphered_seed', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=109,
serialized_end=181,
)
_INITWALLETREQUEST = _descriptor.Descriptor(
name='InitWalletRequest',
full_name='lnrpc.InitWalletRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='wallet_password', full_name='lnrpc.InitWalletRequest.wallet_password', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cipher_seed_mnemonic', full_name='lnrpc.InitWalletRequest.cipher_seed_mnemonic', index=1,
number=2, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='aezeed_passphrase', full_name='lnrpc.InitWalletRequest.aezeed_passphrase', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='recovery_window', full_name='lnrpc.InitWalletRequest.recovery_window', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='channel_backups', full_name='lnrpc.InitWalletRequest.channel_backups', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=184,
serialized_end=362,
)
_INITWALLETRESPONSE = _descriptor.Descriptor(
name='InitWalletResponse',
full_name='lnrpc.InitWalletResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=364,
serialized_end=384,
)
_UNLOCKWALLETREQUEST = _descriptor.Descriptor(
name='UnlockWalletRequest',
full_name='lnrpc.UnlockWalletRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='wallet_password', full_name='lnrpc.UnlockWalletRequest.wallet_password', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='recovery_window', full_name='lnrpc.UnlockWalletRequest.recovery_window', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='channel_backups', full_name='lnrpc.UnlockWalletRequest.channel_backups', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=386,
serialized_end=509,
)
_UNLOCKWALLETRESPONSE = _descriptor.Descriptor(
name='UnlockWalletResponse',
full_name='lnrpc.UnlockWalletResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=511,
serialized_end=533,
)
_CHANGEPASSWORDREQUEST = _descriptor.Descriptor(
name='ChangePasswordRequest',
full_name='lnrpc.ChangePasswordRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='current_password', full_name='lnrpc.ChangePasswordRequest.current_password', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='new_password', full_name='lnrpc.ChangePasswordRequest.new_password', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=b"",
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=535,
serialized_end=606,
)
_CHANGEPASSWORDRESPONSE = _descriptor.Descriptor(
name='ChangePasswordResponse',
full_name='lnrpc.ChangePasswordResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=608,
serialized_end=632,
)
_INITWALLETREQUEST.fields_by_name['channel_backups'].message_type = rpc__pb2._CHANBACKUPSNAPSHOT
_UNLOCKWALLETREQUEST.fields_by_name['channel_backups'].message_type = rpc__pb2._CHANBACKUPSNAPSHOT
DESCRIPTOR.message_types_by_name['GenSeedRequest'] = _GENSEEDREQUEST
DESCRIPTOR.message_types_by_name['GenSeedResponse'] = _GENSEEDRESPONSE
DESCRIPTOR.message_types_by_name['InitWalletRequest'] = _INITWALLETREQUEST
DESCRIPTOR.message_types_by_name['InitWalletResponse'] = _INITWALLETRESPONSE
DESCRIPTOR.message_types_by_name['UnlockWalletRequest'] = _UNLOCKWALLETREQUEST
DESCRIPTOR.message_types_by_name['UnlockWalletResponse'] = _UNLOCKWALLETRESPONSE
DESCRIPTOR.message_types_by_name['ChangePasswordRequest'] = _CHANGEPASSWORDREQUEST
DESCRIPTOR.message_types_by_name['ChangePasswordResponse'] = _CHANGEPASSWORDRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GenSeedRequest = _reflection.GeneratedProtocolMessageType('GenSeedRequest', (_message.Message,), {
'DESCRIPTOR' : _GENSEEDREQUEST,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.GenSeedRequest)
})
_sym_db.RegisterMessage(GenSeedRequest)
GenSeedResponse = _reflection.GeneratedProtocolMessageType('GenSeedResponse', (_message.Message,), {
'DESCRIPTOR' : _GENSEEDRESPONSE,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.GenSeedResponse)
})
_sym_db.RegisterMessage(GenSeedResponse)
InitWalletRequest = _reflection.GeneratedProtocolMessageType('InitWalletRequest', (_message.Message,), {
'DESCRIPTOR' : _INITWALLETREQUEST,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.InitWalletRequest)
})
_sym_db.RegisterMessage(InitWalletRequest)
InitWalletResponse = _reflection.GeneratedProtocolMessageType('InitWalletResponse', (_message.Message,), {
'DESCRIPTOR' : _INITWALLETRESPONSE,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.InitWalletResponse)
})
_sym_db.RegisterMessage(InitWalletResponse)
UnlockWalletRequest = _reflection.GeneratedProtocolMessageType('UnlockWalletRequest', (_message.Message,), {
'DESCRIPTOR' : _UNLOCKWALLETREQUEST,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.UnlockWalletRequest)
})
_sym_db.RegisterMessage(UnlockWalletRequest)
UnlockWalletResponse = _reflection.GeneratedProtocolMessageType('UnlockWalletResponse', (_message.Message,), {
'DESCRIPTOR' : _UNLOCKWALLETRESPONSE,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.UnlockWalletResponse)
})
_sym_db.RegisterMessage(UnlockWalletResponse)
ChangePasswordRequest = _reflection.GeneratedProtocolMessageType('ChangePasswordRequest', (_message.Message,), {
'DESCRIPTOR' : _CHANGEPASSWORDREQUEST,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.ChangePasswordRequest)
})
_sym_db.RegisterMessage(ChangePasswordRequest)
ChangePasswordResponse = _reflection.GeneratedProtocolMessageType('ChangePasswordResponse', (_message.Message,), {
'DESCRIPTOR' : _CHANGEPASSWORDRESPONSE,
'__module__' : 'walletunlocker_pb2'
# @@protoc_insertion_point(class_scope:lnrpc.ChangePasswordResponse)
})
_sym_db.RegisterMessage(ChangePasswordResponse)
DESCRIPTOR._options = None
_WALLETUNLOCKER = _descriptor.ServiceDescriptor(
name='WalletUnlocker',
full_name='lnrpc.WalletUnlocker',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=635,
serialized_end=928,
methods=[
_descriptor.MethodDescriptor(
name='GenSeed',
full_name='lnrpc.WalletUnlocker.GenSeed',
index=0,
containing_service=None,
input_type=_GENSEEDREQUEST,
output_type=_GENSEEDRESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='InitWallet',
full_name='lnrpc.WalletUnlocker.InitWallet',
index=1,
containing_service=None,
input_type=_INITWALLETREQUEST,
output_type=_INITWALLETRESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='UnlockWallet',
full_name='lnrpc.WalletUnlocker.UnlockWallet',
index=2,
containing_service=None,
input_type=_UNLOCKWALLETREQUEST,
output_type=_UNLOCKWALLETRESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='ChangePassword',
full_name='lnrpc.WalletUnlocker.ChangePassword',
index=3,
containing_service=None,
input_type=_CHANGEPASSWORDREQUEST,
output_type=_CHANGEPASSWORDRESPONSE,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_WALLETUNLOCKER)
DESCRIPTOR.services_by_name['WalletUnlocker'] = _WALLETUNLOCKER
# @@protoc_insertion_point(module_scope)

View File

@ -0,0 +1,246 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
from __future__ import absolute_import
import grpc
from . import walletunlocker_pb2 as walletunlocker__pb2
class WalletUnlockerStub(object):
"""
Comments in this file will be directly parsed into the API
Documentation as descriptions of the associated method, message, or field.
These descriptions should go right above the definition of the object, and
can be in either block or // comment format.
An RPC method can be matched to an lncli command by placing a line in the
beginning of the description in exactly the following format:
lncli: `methodname`
Failure to specify the exact name of the command will cause documentation
generation to fail.
More information on how exactly the gRPC documentation is generated from
this proto file can be found here:
https://github.com/lightninglabs/lightning-api
WalletUnlocker is a service that is used to set up a wallet password for
lnd at first startup, and unlock a previously set up wallet.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GenSeed = channel.unary_unary(
'/lnrpc.WalletUnlocker/GenSeed',
request_serializer=walletunlocker__pb2.GenSeedRequest.SerializeToString,
response_deserializer=walletunlocker__pb2.GenSeedResponse.FromString,
)
self.InitWallet = channel.unary_unary(
'/lnrpc.WalletUnlocker/InitWallet',
request_serializer=walletunlocker__pb2.InitWalletRequest.SerializeToString,
response_deserializer=walletunlocker__pb2.InitWalletResponse.FromString,
)
self.UnlockWallet = channel.unary_unary(
'/lnrpc.WalletUnlocker/UnlockWallet',
request_serializer=walletunlocker__pb2.UnlockWalletRequest.SerializeToString,
response_deserializer=walletunlocker__pb2.UnlockWalletResponse.FromString,
)
self.ChangePassword = channel.unary_unary(
'/lnrpc.WalletUnlocker/ChangePassword',
request_serializer=walletunlocker__pb2.ChangePasswordRequest.SerializeToString,
response_deserializer=walletunlocker__pb2.ChangePasswordResponse.FromString,
)
class WalletUnlockerServicer(object):
"""
Comments in this file will be directly parsed into the API
Documentation as descriptions of the associated method, message, or field.
These descriptions should go right above the definition of the object, and
can be in either block or // comment format.
An RPC method can be matched to an lncli command by placing a line in the
beginning of the description in exactly the following format:
lncli: `methodname`
Failure to specify the exact name of the command will cause documentation
generation to fail.
More information on how exactly the gRPC documentation is generated from
this proto file can be found here:
https://github.com/lightninglabs/lightning-api
WalletUnlocker is a service that is used to set up a wallet password for
lnd at first startup, and unlock a previously set up wallet.
"""
def GenSeed(self, request, context):
"""
GenSeed is the first method that should be used to instantiate a new lnd
instance. This method allows a caller to generate a new aezeed cipher seed
given an optional passphrase. If provided, the passphrase will be necessary
to decrypt the cipherseed to expose the internal wallet seed.
Once the cipherseed is obtained and verified by the user, the InitWallet
method should be used to commit the newly generated seed, and create the
wallet.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def InitWallet(self, request, context):
"""
InitWallet is used when lnd is starting up for the first time to fully
initialize the daemon and its internal wallet. At the very least a wallet
password must be provided. This will be used to encrypt sensitive material
on disk.
In the case of a recovery scenario, the user can also specify their aezeed
mnemonic and passphrase. If set, then the daemon will use this prior state
to initialize its internal wallet.
Alternatively, this can be used along with the GenSeed RPC to obtain a
seed, then present it to the user. Once it has been verified by the user,
the seed can be fed into this RPC in order to commit the new wallet.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UnlockWallet(self, request, context):
"""lncli: `unlock`
UnlockWallet is used at startup of lnd to provide a password to unlock
the wallet database.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ChangePassword(self, request, context):
"""lncli: `changepassword`
ChangePassword changes the password of the encrypted wallet. This will
automatically unlock the wallet database if successful.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_WalletUnlockerServicer_to_server(servicer, server):
rpc_method_handlers = {
'GenSeed': grpc.unary_unary_rpc_method_handler(
servicer.GenSeed,
request_deserializer=walletunlocker__pb2.GenSeedRequest.FromString,
response_serializer=walletunlocker__pb2.GenSeedResponse.SerializeToString,
),
'InitWallet': grpc.unary_unary_rpc_method_handler(
servicer.InitWallet,
request_deserializer=walletunlocker__pb2.InitWalletRequest.FromString,
response_serializer=walletunlocker__pb2.InitWalletResponse.SerializeToString,
),
'UnlockWallet': grpc.unary_unary_rpc_method_handler(
servicer.UnlockWallet,
request_deserializer=walletunlocker__pb2.UnlockWalletRequest.FromString,
response_serializer=walletunlocker__pb2.UnlockWalletResponse.SerializeToString,
),
'ChangePassword': grpc.unary_unary_rpc_method_handler(
servicer.ChangePassword,
request_deserializer=walletunlocker__pb2.ChangePasswordRequest.FromString,
response_serializer=walletunlocker__pb2.ChangePasswordResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'lnrpc.WalletUnlocker', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class WalletUnlocker(object):
"""
Comments in this file will be directly parsed into the API
Documentation as descriptions of the associated method, message, or field.
These descriptions should go right above the definition of the object, and
can be in either block or // comment format.
An RPC method can be matched to an lncli command by placing a line in the
beginning of the description in exactly the following format:
lncli: `methodname`
Failure to specify the exact name of the command will cause documentation
generation to fail.
More information on how exactly the gRPC documentation is generated from
this proto file can be found here:
https://github.com/lightninglabs/lightning-api
WalletUnlocker is a service that is used to set up a wallet password for
lnd at first startup, and unlock a previously set up wallet.
"""
@staticmethod
def GenSeed(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/lnrpc.WalletUnlocker/GenSeed',
walletunlocker__pb2.GenSeedRequest.SerializeToString,
walletunlocker__pb2.GenSeedResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def InitWallet(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/lnrpc.WalletUnlocker/InitWallet',
walletunlocker__pb2.InitWalletRequest.SerializeToString,
walletunlocker__pb2.InitWalletResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def UnlockWallet(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/lnrpc.WalletUnlocker/UnlockWallet',
walletunlocker__pb2.UnlockWalletRequest.SerializeToString,
walletunlocker__pb2.UnlockWalletResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ChangePassword(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/lnrpc.WalletUnlocker/ChangePassword',
walletunlocker__pb2.ChangePasswordRequest.SerializeToString,
walletunlocker__pb2.ChangePasswordResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)