raspiblitz/home.admin/97addMobileWalletZap.sh

98 lines
2.9 KiB
Bash
Raw Normal View History

2018-08-31 19:22:41 +02:00
#!/bin/bash
2018-12-21 01:59:26 +01:00
# load raspiblitz config data
2019-02-02 23:49:04 +01:00
source /home/admin/raspiblitz.info
2018-12-21 01:59:26 +01:00
source /mnt/hdd/raspiblitz.conf
2018-08-31 19:22:41 +02:00
2019-01-17 22:40:26 +01:00
# export go vars (if needed)
if [ ${#GOROOT} -eq 0 ]; then
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
fi
if [ ${#GOPATH} -eq 0 ]; then
export GOPATH=/usr/local/gocode
export PATH=$PATH:$GOPATH/bin
fi
2019-01-17 18:26:57 +01:00
2019-01-17 22:58:15 +01:00
# make sure go is installed
2019-03-14 11:39:56 +01:00
goVersion="1.11"
echo "### Check Framework: GO ###"
2019-01-17 22:58:15 +01:00
goInstalled=$(go version 2>/dev/null | grep -c 'go')
if [ ${goInstalled} -eq 0 ];then
2019-03-14 11:39:56 +01:00
echo "---> Installing GO"
wget https://storage.googleapis.com/golang/go${goVersion}.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go${goVersion}.linux-armv6l.tar.gz
2019-01-17 18:24:14 +01:00
sudo rm *.gz
sudo mkdir /usr/local/gocode
sudo chmod 777 /usr/local/gocode
2019-01-17 22:58:15 +01:00
goInstalled=$(go version 2>/dev/null | grep -c 'go')
2019-01-17 18:24:14 +01:00
fi
2019-01-17 22:58:15 +01:00
if [ ${goInstalled} -eq 0 ];then
2019-01-31 21:10:01 +01:00
echo "FAIL: Was not able to install GO (needed to run LndConnect)"
2019-03-14 11:39:56 +01:00
sleep 4
2019-01-17 18:24:14 +01:00
exit 1
fi
2019-03-14 11:39:56 +01:00
clear
correctGoVersion=$(go version | grep -c "go${goVersion}")
if [ ${correctGoVersion} -eq 0 ]; then
echo "WARNING: You work with a untested version of GO - should be ${goVersion} .. trying to continue"
go version
sleep 6
echo ""
fi
2019-01-17 18:24:14 +01:00
2018-08-31 19:22:41 +02:00
# make sure qrcode-encoder in installed
echo "*** Setup ***"
echo ""
2019-03-17 18:59:57 +01:00
echo "Installing zapconnect."
2018-08-31 19:22:41 +02:00
echo ""
2019-03-17 18:59:57 +01:00
echo "Getting github.com/LN-Zap/lndconnect (please wait - can take several minutes) ..."
2019-01-31 21:10:01 +01:00
go get -d github.com/LN-Zap/lndconnect
cd $GOPATH/src/github.com/LN-Zap/lndconnect
2018-08-31 19:22:41 +02:00
echo ""
2019-01-31 21:10:01 +01:00
echo "Building github.com/LN-Zap/lndconnect ..."
2018-12-21 03:03:06 +01:00
make
cd
sleep 3
2018-08-31 19:22:41 +02:00
clear
echo "******************************"
echo "Connect Zap Mobile Wallet"
echo "******************************"
echo ""
echo "GETTING THE APP"
echo "At the moment this app is in closed beta testing and the source code has not been published yet."
2019-03-14 12:07:38 +01:00
echo "1. Install the app 'TestFlight' from Apple Appstore. Open it and agree to all terms of services."
echo "2. Open on your iOS device https://github.com/LN-Zap/zap-iOS and follow 'Download the Alpha'"
2018-08-31 19:22:41 +02:00
echo ""
2019-03-14 12:07:38 +01:00
echo "*** PAIRING STEP 1 ***"
2018-12-21 02:48:25 +01:00
if [ ${#dynDomain} -eq 0 ]; then
echo "Once you have the app is running make sure you are on the same local network (WLAN same as LAN)."
fi
2018-12-21 02:49:03 +01:00
echo "During Setup of the Zap app you should get to the 'Connect Remote-Node' screen."
2018-08-31 19:22:41 +02:00
echo ""
2018-12-21 02:48:25 +01:00
echo "---> Click on Scan"
2018-08-31 19:22:41 +02:00
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
clear
2019-03-14 12:07:38 +01:00
echo "*** PAIRING STEP 2 : Click on Scan (make whole QR code fill camera) ***"
2018-08-31 19:22:41 +02:00
2018-12-21 02:36:24 +01:00
if [ ${#dynDomain} -eq 0 ]; then
2019-01-31 21:10:01 +01:00
# If you drop the -i parameter, lndconnect will use the external IP.
2019-01-31 21:17:55 +01:00
lndconnect -i
2018-12-21 01:59:26 +01:00
else
# when dynamic domain is set
2019-01-31 21:17:55 +01:00
lndconnect --host=${dynDomain}
2018-12-21 01:59:26 +01:00
fi
2018-08-31 19:22:41 +02:00
echo "(To shrink QR code: OSX->CMD- / LINUX-> CTRL-) Press ENTER when finished."
read key
clear
echo "If its not working - check issues on GitHub:"
echo "https://github.com/LN-Zap/zap-iOS/issues"
2019-01-31 21:10:01 +01:00
echo "https://github.com/LN-Zap/lndconnect/issues"
2018-08-31 19:22:41 +02:00
echo ""