Browse Source

Added QR display on LCD-screen for fundWallet, createInvoice and addMobileWalletShango

dev
Raumi 6 years ago
parent
commit
c5669a9464
  1. 19
      home.admin/97addMobileWalletShango.sh
  2. 10
      home.admin/BBcreateInvoice.sh
  3. 15
      home.admin/BBfundWallet.sh
  4. 37
      home.admin/XXdisplayQR.sh

19
home.admin/97addMobileWalletShango.sh

@ -4,10 +4,7 @@
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
# make sure qrcode-encoder in installed
clear clear
echo "*** Setup ***"
sudo apt-get install qrencode -y
# get local IP # get local IP
myip=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') myip=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
@ -35,20 +32,20 @@ echo "On Setup Step 'Choose LND Server Type' connect to 'DIY SELF HOSTED'"
echo "(Or in the App go to --> 'Settings' > 'Connect to your LND Server')" echo "(Or in the App go to --> 'Settings' > 'Connect to your LND Server')"
echo "There you see three 3 form fields to fill out. Skip those and go right to the buttons below." echo "There you see three 3 form fields to fill out. Skip those and go right to the buttons below."
echo "" echo ""
echo "Click on the 'Scan QR' button" echo "Click on the 'Scan QR' button and PRESS ENTER"
echo "Make the this terminal as big as possible - fullscreen would be best."
echo "Then PRESS ENTER here in the terminal to generare the QR code and scan it with the app."
read key
read key
clear clear
echo "*** STEP 2 : SCAN MACAROON (make whole QR code fill camera) ***" echo "*** STEP 2 : SCAN MACAROON (make whole QR code fill camera) ***"
echo -e "${myip}:10009,\n$(xxd -p -c2000 ./.lnd/data/chain/${network}/${chain}net/admin.macaroon)," > qr.txt && cat ./.lnd/tls.cert >>qr.txt && qrencode -t ANSI256 < qr.txt
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." echo -e "${myip}:10009,\n$(xxd -p -c2000 ./.lnd/data/chain/${network}/${chain}net/admin.macaroon)," > qr.txt && cat ./.lnd/tls.cert >>qr.txt
read key
shred qr.txt ./XXdisplayQR.sh
clear clear
echo
echo "Now press 'Connect' within the Shango Wallet." echo "Now press 'Connect' within the Shango Wallet."
echo "If its not working - check issues on GitHub:" echo "If its not working - check issues on GitHub:"
echo
echo "https://github.com/neogeno/shango-lightning-wallet/issues" echo "https://github.com/neogeno/shango-lightning-wallet/issues"
echo "" echo ""

10
home.admin/BBcreateInvoice.sh

@ -79,10 +79,10 @@ if [ ${#error} -gt 0 ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "${error}" echo "${error}"
else else
echo "******************************" # echo "******************************"
echo "WIN" # echo "WIN"
echo "******************************" # echo "******************************"
echo "${result}" # echo "${result}"
echo "" echo ""
rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4) rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4)
payReq=$(echo "$result" | grep pay_req | cut -d '"' -f4) payReq=$(echo "$result" | grep pay_req | cut -d '"' -f4)
@ -96,3 +96,5 @@ else
fi fi
echo "" echo ""
echo -e "${payReq}" > qr.txt
./XXdisplayQR.sh

15
home.admin/BBfundWallet.sh

@ -65,17 +65,10 @@ echo "Send ${coininfo} to address --> ${address}"
if [ "$chain" = "test" ]; then if [ "$chain" = "test" ]; then
echo "get some testnet coins from https://testnet-faucet.mempool.co" echo "get some testnet coins from https://testnet-faucet.mempool.co"
fi fi
echo -e "$network:${address}" > qr.txt
/home/admin/XXdisplayQR.sh
echo "Whats next? --> Wait for confirmations. You can use info on LCD to check if funds have arrived." echo "Whats next? --> Wait for confirmations. You can use info on LCD to check if funds have arrived."
echo "If you want your lighting node to open channels automatically, activate the 'Autopilot' under 'Activate/Deactivate Services'" echo "If you want your lighting node to open channels automatically, activate the 'Autopilot' under 'Activate/Deactivate Services'"
echo "" echo ""
echo ""
echo "******************************"
echo "QR-Code? (Y/N)"
echo "******************************"
echo "Would you like to see a QR-code of this address? Press Y"
read -n1 key
if [ "$key" = "y" ]; then
/home/admin/XXdisplayQR.sh $network:${address}
fi

37
home.admin/XXdisplayQR.sh

@ -1,23 +1,36 @@
#!/bin/bash #!/bin/bash
# Display a QR code provided as parameter $1 # Display a QR code for the string in qr.txt
qrcode=$1 echo
echo "Please wait. Generating QR-code..."
echo
# make sure qrcode-encode and fbi are installed
sudo apt-get install qrencode fbi -y > /dev/null
# make sure qrcode-encoder in installed qrencode -l L -o /home/admin/qr.png < /home/admin/qr.txt > /dev/null
clear sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null
echo "*** Setup ***"
sudo apt-get install qrencode -y echo "************************************"
echo "Scan the QR-Code on the LCD-Display."
echo "************************************"
echo
echo "If you don't have access to the LCD, you can view it here."
echo "Make the this terminal window as big as possible - fullscreen would be best."
echo "Then PRESS ENTER here in the terminal to show QR code."
clear
echo "Make the this terminal as big as possible - fullscreen would be best."
echo "Then PRESS ENTER here in the terminal to generare the QR code and scan it with the app."
read key read key
clear clear
echo -e "$1" | qrencode -t ANSI256 qrencode -t ANSI256 < /home/admin/qr.txt
echo -e "$1" shred /home/admin/qr.txt
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished." rm -f /home/admin/qr.txt
echo "(To shrink QR code: macOS press CMD- / LINUX press CTRL-) Press ENTER when finished."
read key read key
clear clear
# remove the QR picture on the raspi LCD
sudo killall -3 fbi
shred /home/admin/qr.png
rm -f /home/admin/qr.png

Loading…
Cancel
Save