From 8e2744f048ddc10701514d54fafa3de9c4280cde Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 24 Jul 2019 12:51:46 +0100 Subject: [PATCH] fix format , add go.install.sh --- electrs/README.md | 5 ++-- lnd.updates/go.install.sh | 53 ++++++++++++++++++++++++++++++++++ lnd.updates/lnd.from.source.sh | 2 +- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 lnd.updates/go.install.sh diff --git a/electrs/README.md b/electrs/README.md index 8405485..4da7357 100644 --- a/electrs/README.md +++ b/electrs/README.md @@ -49,14 +49,13 @@ To stop running on boot: --- -To connect remotely to Electrs there is a encrypted connection needed. -See the guide from @cryptomulde to connect to a VPS through a reverse ssh tunnel: https://medium.com/@cryptomulde/private-electrum-server-electrs-for-your-raspiblitz-full-node-without-forwarding-ports-417e4c3af975 +A remote connection to Electrs should be encrypted. +See the guide from @cryptomulde to connect to a VPS through a reverse ssh tunnel: https://medium.com/@cryptomulde/private-electrum-server-electrs-for-your-raspiblitz-full-node-without-forwarding-ports-417e4c3af975 The more secure option is to continue with setting up the SSL connection as described in the next section. --- - ## RaspiBlitz: install Nginx and Certbot to connect over SSL For the SSL certificate to be obtained successfully a **dynamic DNS** and **port forwarding is necessary**. diff --git a/lnd.updates/go.install.sh b/lnd.updates/go.install.sh new file mode 100644 index 0000000..a362e11 --- /dev/null +++ b/lnd.updates/go.install.sh @@ -0,0 +1,53 @@ +echo "" +echo "*** CHECK BASE IMAGE ***" + +# armv7=32Bit , armv8=64Bit +echo "Detect CPU architecture ..." +isARM=$(uname -m | grep -c 'arm') +isAARCH64=$(uname -m | grep -c 'aarch64') +isX86_64=$(uname -m | grep -c 'x86_64') +isX86_32=$(uname -m | grep -c 'i386\|i486\|i586\|i686\|i786') +if [ ${isARM} -eq 0 ] && [ ${isAARCH64} -eq 0 ] && [ ${isX86_64} -eq 0 ] && [ ${isX86_32} -eq 0 ] ; then + echo "!!! FAIL !!!" + echo "Can only build on ARM, aarch64, x86_64 or i386 not on:" + uname -m + exit 1 +else + echo "OK running on $(uname -m) architecture." +fi + +# "*** Installing Go ***" +# Go is needed for ZAP connect later +# see https://golang.org/dl/ +goVersion="1.12.7" +if [ ${isARM} -eq 1 ] ; then + goOSversion="armv6l" +fi +if [ ${isAARCH64} -eq 1 ] ; then + goOSversion="arm64" +fi +if [ ${isX86_64} -eq 1 ] ; then + goOSversion="amd64" +fi +if [ ${isX86_32} -eq 1 ] ; then + goOSversion="386" +fi + +echo "*** Installing Go v${goVersion} for ${goOSversion} ***" + +# wget https://storage.googleapis.com/golang/go${goVersion}.linux-${goOSversion}.tar.gz +wget https://dl.google.com/go/go${goVersion}.linux-${goOSversion}.tar.gz +if [ ! -f "./go${goVersion}.linux-${goOSversion}.tar.gz" ] +then + echo "!!! FAIL !!! Download not success." + exit 1 +fi +sudo tar -C /usr/local -xzf go${goVersion}.linux-${goOSversion}.tar.gz +sudo rm *.gz +sudo mkdir /usr/local/gocode +sudo chmod 777 /usr/local/gocode +export GOROOT=/usr/local/go +export PATH=$PATH:$GOROOT/bin +export GOPATH=/usr/local/gocode +export PATH=$PATH:$GOPATH/bin +echo "" \ No newline at end of file diff --git a/lnd.updates/lnd.from.source.sh b/lnd.updates/lnd.from.source.sh index 2d26fdf..7a3b3e0 100644 --- a/lnd.updates/lnd.from.source.sh +++ b/lnd.updates/lnd.from.source.sh @@ -5,7 +5,7 @@ #### Build from Source # To quickly catch up get latest patches if needed -aarepo="github.com/lightningnetwork/lnd" +repo="github.com/lightningnetwork/lnd" echo "Paste the latest or desired commit ID to checkout from" echo "See the list at: https://github.com/lightningnetwork/lnd/commits/master" echo "Example:"