Pages:
Author

Topic: Questions RE: setting up Lightning Node on Raspberry Pi with Stadicus' guide (Read 22070 times)

legendary
Activity: 1876
Merit: 3132
Hey i managed to save the whole .lnd folder in my desktop pc but can't I just use all the info stored in the ExtHdisk when restarting the system on the SD card from scratch?  I mean as far as im concerned the Harddisk didnt suffer any issues, the bitcoin blockchain and the .lnd files were all there impecable.

@Papucho contacted me on Telegram so this post is for people who are following this thread. His Bitcoin and LND nodes data were stored on an external hard drive so I recommended him reinstalling the operating system on the SD card. He will be able to recover his channels since all data is stored in the .lnd folder on that hard drive.
newbie
Activity: 3
Merit: 0
This shouldn't have happened unless you included '*' after golang* which causes the deletion of all packages. We would be able to access your funds remotely if we had your admin.macaroon and tls certificate. Without them, the only solution I can think of is to shut down your Pi completely and copy the wallet and the channel state files. Technically, backing up .lnd folder should be enough and I would advise you to copy the whole folder once you shut down your Pi. Channel.db is located in /home/username/.lnd/data/graph/mainnet and wallet.db in /home/username/.lnd/data/chain/bitcoin/mainnet

Hey i managed to save the whole .lnd folder in my desktop pc but can't I just use all the info stored in the ExtHdisk when restarting the system on the SD card from scratch?  I mean as far as im concerned the Harddisk didnt suffer any issues, the bitcoin blockchain and the .lnd files were all there impecable.
legendary
Activity: 1876
Merit: 3132
Are you familiar with the raspiblitz environment? Is it possible to start from scratch then with my .lnd files recover the info of my channels using the comfigutation of the raspiblitz guide? Is it possible? If so, could you please walk me theu the steps?

I have never set up RaspiBlitz but it shouldn't be a problem. I managed to help @Zand_ even though I still don't own a Raspberry Pi. RaspiBlitz uses LND v.0.5.2 so there won't be any problems with using your .lnd backup. Make sure that all files inside .lnd have been copied correctly. RaspiBlitz has a good tutorial on their GitHub. I can help you in case you face any problems during the installation process. If you won't have any problems then we will proceed with using your backup.
newbie
Activity: 3
Merit: 0
This shouldn't have happened unless you included '*' after golang* which causes the deletion of all packages. We would be able to access your funds remotely if we had your admin.macaroon and tls certificate. Without them, the only solution I can think of is to shut down your Pi completely and copy the wallet and the channel state files. Technically, backing up .lnd folder should be enough and I would advise you to copy the whole folder once you shut down your Pi. Channel.db is located in /home/username/.lnd/data/graph/mainnet and wallet.db in /home/username/.lnd/data/chain/bitcoin/mainnet

Don't install Go using apt-get golang. Do it manually. Enter the following commands as a root:

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.5.linux-armv6l.tar.gz
sudo tar -xvf go1.11.5.linux-armv6l.tar.gz

Now, run these commands as the user in whose directory you want to use Go and log in again.

export GOROOT=/usr/local/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile


Hey thanks a lot for the heads up... Indeed something went stupidly bad for the wrong use of the wildcard... I have another question, im gonna start the whole process again. I will shitdown that Pi and sace all the .lnd info i have stored in yhe SD, i wanted to ask as well... Are you familiar with the raspiblitz environment? Is it possible to start from scratch then with my .lnd files recover the info of my channels using the comfigutation of the raspiblitz guide? Is it possible? If so, could you please walk me theu the steps?

Thanks for your patience.
legendary
Activity: 1876
Merit: 3132
This shouldn't have happened unless you included '*' after golang* which causes the deletion of all packages. We would be able to access your funds remotely if we had your admin.macaroon and tls certificate. Without them, the only solution I can think of is to shut down your Pi completely and copy the wallet and the channel state files. Technically, backing up .lnd folder should be enough and I would advise you to copy the whole folder once you shut down your Pi. Channel.db is located in /home/username/.lnd/data/graph/mainnet and wallet.db in /home/username/.lnd/data/chain/bitcoin/mainnet

Don't install Go using apt-get golang. Do it manually. Enter the following commands as a root:

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.5.linux-armv6l.tar.gz
sudo tar -xvf go1.11.5.linux-armv6l.tar.gz

Now, run these commands as the user in whose directory you want to use Go and log in again.

export GOROOT=/usr/local/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile
newbie
Activity: 3
Merit: 0
I am afraid that the package (golang) is a bit out-of-date (it's a common thing, unfortunately). Can you tell me which version of Go is currently installed? (go version) If it's lower than 1.11.1 then we will have to proceed with the manual installation again. Try the following commands anyway.

sudo apt-get remove golang* - '*' is necessary
sudo apt-get autoremove
sudo rm -r /usr/local/go - just in case you accidentally moved the old version

I try running these commands (after an unsuccessfully installation of GO )  and after i ran
Code:
sudo apt-get remove golang*[/tt] - '*'
my PI started to remove ton of necessary data for the pi, at the end of the process it asked me to accept by typing a phrase which i did ( kindda stupid ik ) and now It wouldn't let me log in again, stating that PAM selected was missing.

I terminated my CLI and now whenever i try to shh into my pi i get: ssh: connect to host 192.168.1.10 port 22: Connection refused

The most hilarious thing is that both my bitcoin node and lightning node both keep running smooth in the back but i completely lost access to my PI thru ssh and im afraid of force it off and brick the sd card. Any ideas how to fix this issue? Or at least how to close all those opened channels without ssh'ing into the pi so i can start from scratch?

legendary
Activity: 1876
Merit: 3132
After a long time, we managed to get it to work about a week ago. Actually, we have no idea how. Zap iOS didn't want to connect even though Zap desktop was working properly. However, we had to change a few things before Zap desktop started working.

Firstly, we forwarded port 10009 in the router settings and added a firewall exception (sudo ufw allow 10009).

A few changes in the config were needed (sudo nano /home/bitcoin/.lnd/lnd.conf). The following lines were added under the [Application Options] section.

tlsextraip=PUBLIC_IP
rpclisten=0.0.0.0:10009
externalip=PUBLIC_IP

After saving the file and rebooting the node, Zap desktop started to work properly while Zap iOS did not. Why? We have no idea. @Zand_ wanted to try another iOS Lightning Network wallet compatible with an external LND instance. 'Union 7' worked for us after the first try. Surprisingly, after setting up 'Union 7' wallet, Zap iOS app also started to work.
legendary
Activity: 1876
Merit: 3132
Some people might be following this thread or might find my answer useful in the future. It turned out that zapconnect was out-of-date and had been replaced with lndconnect. Also, the installation process of Go for Raspberry Pi is a bit different. Note: the following commands are supposed to be used by user 'admin'.

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.5.linux-armv6l.tar.gz
sudo tar -xvf go1.11.5.linux-armv6l.tar.gz
echo 'PATH="/usr/local/go/bin:$PATH"' >> ~/.profile - reconnect after typing in this command

Now, it's time to build lndconnect and use it to generate the QR code needed in the Zap iOS app.

cd ~ && go get -d github.com/LN-Zap/lndconnect
cd /home/admin/src/github.com/LN-Zap/lndconnect
make
cd ~/go/bin
./lndconnect —adminmacaroonpath=/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon —lnddir=/home/bitcoin/.lnd/ --configfile=/home/bitcoin/.lnd/lnd.conf -j

This command should return a text which needs to be converted to a QR code. This website seems to be a fairly good one to do that.

Right now, we are facing the 'Can't connect to server' error. However, I have just provided @Zand_ a possible solution (related to LND config; port forwarding and ufw rules have been changed correctly). I will add another post once he confirms if my suggestion has worked.
legendary
Activity: 1876
Merit: 3132
Speaking of which, do you know of a way I can connect to my node from an outside network? This way I can play around with it when I have free time at work.

Yes, I do. You have to set up port forwarding on your router (this includes assigning fixed internal IP to your Raspberry Pi and then forwarding port 22 (SSH) to that IP). However, it depends on your ISP whether or not it is possible and the whole process looks different on each device. I can help you set it up but you might have to disclose some sensitive information so I would recommend you to contact me on Telegram or send me a private message/an e-mail. You might find a tutorial on-line for your router, though.
member
Activity: 112
Merit: 17
Should I delete what I have and paste your copy?

No, that will probably break something. We have to get rid of everything related to Go. Remove the following lines and save the file.

Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"

Now, you can use echo 'PATH="$PATH:/usr/local/go/bin"' >> ~/.profile. Log out and try to use the command from Zap connect.

Ok sounds good, will have to try this when I get home. Speaking of which, do you know of a way I can connect to my node from an outside network? This way I can play around with it when I have free time at work.
legendary
Activity: 1876
Merit: 3132
Should I delete what I have and paste your copy?

No, that will probably break something. We have to get rid of everything related to Go. Remove the following lines and save the file.

Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"

Now, you can use echo 'PATH="$PATH:/usr/local/go/bin"' >> ~/.profile. Log out and try to use the command from Zap connect.
member
Activity: 112
Merit: 17
Okay, I have just tested it on my VPS and we have to do one more thing.

cd ~ && nano .profile - I assume that you have nano installed. If not then run sudo apt-get install nano

There is probably a lot of mess there. Delete everything EXCEPT the code below

Code:
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true

Press CTRL+O at the same time and then enter to save the file. Press CTRL+X to leave the editor.

echo 'PATH="$PATH:/usr/local/go/bin"' >> ~/.profile - Log out after this command and try using the command from Zap connect

By the way, does snap command work for you? I am running Ubuntu 18.04 on my VPS and it suggested using sudo snap install go -classic (it would download the latest version). Give it a try if the rest doesn't work!

By the way, when I installed go the first time around with "sudo apt-get install golang" I got go version go1.7.4 linux/arm. Not sure if that helps

It proves that the package was out-of-date (1.7.4 was released at the end of 2016!).

This is what I have when opening up nano. Mine seems a bit different than yours, particularly the beginning "# ~/.profile: executed by Bourne-compatible login shells."

Should I delete what I have and paste your copy?

Code:
GNU nano 2.7.4                                                                                                  File: .profile

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
PATH="$HOME/go/bin:$PATH"
legendary
Activity: 1876
Merit: 3132
Okay, I have just tested it on my VPS and we have to do one more thing.

cd ~ && nano .profile - I assume that you have nano installed. If not then run sudo apt-get install nano

There is probably a lot of mess there. Delete everything EXCEPT the code below

Code:
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true

Press CTRL+O at the same time and then enter to save the file. Press CTRL+X to leave the editor.

echo 'PATH="$PATH:/usr/local/go/bin"' >> ~/.profile - Log out after this command and try using the command from Zap connect

By the way, does snap command work for you? I am running Ubuntu 18.04 on my VPS and it suggested using sudo snap install go -classic (it would download the latest version). Give it a try if the rest doesn't work!

By the way, when I installed go the first time around with "sudo apt-get install golang" I got go version go1.7.4 linux/arm. Not sure if that helps

It proves that the package was out-of-date (1.7.4 was released at the end of 2016!).
member
Activity: 112
Merit: 17
I am afraid that the package (golang) is a bit out-of-date (it's a common thing, unfortunately). Can you tell me which version of Go is currently installed? (go version) If it's lower than 1.11.1 then we will have to proceed with the manual installation again. Try the following commands anyway.

sudo apt-get remove golang* - '*' is necessary
sudo apt-get autoremove
sudo rm -r /usr/local/go - just in case you accidentally moved the old version

Now, after typing in go version you should see 'Unknown command error'.

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.4.linux-armv6l.tar.gz - not the 32 bit version as I recommended earlier but the ARM one
sudo tar -xvf go1.11.4.linux-armv6l.tar.gz
sudo rm go1.11.4.linux-armv6l.tar.gz - let's keep things clean

The $GOPATH should not change but let's make sure that it will work properly. Don't forget to log out after using the commands below.

export GOROOT=/usr/local/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile

Run go version and you should see go version g1.11.4 linux/arm. Run the command from Zap connect.

I don't want to hold you up from sleep so maybe take a look in the morning when you wake up. Also sent a long overdue BTC tip your way (to the address in your profile) for all the help you've provided.

I fell asleep immediately after making my previous post. Thank you for your generous tip! Now I am considering buying a Raspberry Pi for myself Wink

Ok I gave this a try but after doing everything I ended up with the "-bash: go: command not found" output when checking the go version.

By the way, when I installed go the first time around with "sudo apt-get install golang" I got go version go1.7.4 linux/arm. Not sure if that helps
member
Activity: 112
Merit: 17
Hey, going to try all of this when I get home. Quick question though - should I do anything to reverse the "sudo chmod -R 777 ~/go" command I entered last night? Or will that automatically happen when I reinstall Go?

It won't happen automatically since these folders were created manually by you. You don't have to change anything. Let's keep these folders with 777 permissions for now. By the way, is there anything beside LND that you run on your Raspberry Pi?

Just LND and Bitcoin Core (serves as both a Lightning node and a Bitcoin full node)
legendary
Activity: 1876
Merit: 3132
Hey, going to try all of this when I get home. Quick question though - should I do anything to reverse the "sudo chmod -R 777 ~/go" command I entered last night? Or will that automatically happen when I reinstall Go?

It won't happen automatically since these folders were created manually by you. You don't have to change anything. Let's keep these folders with 777 permissions for now. By the way, is there anything beside LND that you run on your Raspberry Pi?
member
Activity: 112
Merit: 17
I am afraid that the package (golang) is a bit out-of-date (it's a common thing, unfortunately). Can you tell me which version of Go is currently installed? (go version) If it's lower than 1.11.1 then we will have to proceed with the manual installation again. Try the following commands anyway.

sudo apt-get remove golang* - '*' is necessary
sudo apt-get autoremove
sudo rm -r /usr/local/go - just in case you accidentally moved the old version

Now, after typing in go version you should see 'Unknown command error'.

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.4.linux-armv6l.tar.gz - not the 32 bit version as I recommended earlier but the ARM one
sudo tar -xvf go1.11.4.linux-armv6l.tar.gz
sudo rm go1.11.4.linux-armv6l.tar.gz - let's keep things clean

The $GOPATH should not change but let's make sure that it will work properly. Don't forget to log out after using the commands below.

export GOROOT=/usr/local/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile

Run go version and you should see go version g1.11.4 linux/arm. Run the command from Zap connect.

I don't want to hold you up from sleep so maybe take a look in the morning when you wake up. Also sent a long overdue BTC tip your way (to the address in your profile) for all the help you've provided.

I fell asleep immediately after making my previous post. Thank you for your generous tip! Now I am considering buying a Raspberry Pi for myself Wink

Hey, going to try all of this when I get home. Quick question though - should I do anything to reverse the "sudo chmod -R 777 ~/go" command I entered last night? Or will that automatically happen when I reinstall Go?

Also you should definitely buy the Pi!
legendary
Activity: 1876
Merit: 3132
I am afraid that the package (golang) is a bit out-of-date (it's a common thing, unfortunately). Can you tell me which version of Go is currently installed? (go version) If it's lower than 1.11.1 then we will have to proceed with the manual installation again. Try the following commands anyway.

sudo apt-get remove golang* - '*' is necessary
sudo apt-get autoremove
sudo rm -r /usr/local/go - just in case you accidentally moved the old version

Now, after typing in go version you should see 'Unknown command error'.

cd /usr/local/ && sudo wget https://dl.google.com/go/go1.11.4.linux-armv6l.tar.gz - not the 32 bit version as I recommended earlier but the ARM one
sudo tar -xvf go1.11.4.linux-armv6l.tar.gz
sudo rm go1.11.4.linux-armv6l.tar.gz - let's keep things clean

The $GOPATH should not change but let's make sure that it will work properly. Don't forget to log out after using the commands below.

export GOROOT=/usr/local/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile

Run go version and you should see go version g1.11.4 linux/arm. Run the command from Zap connect.

I don't want to hold you up from sleep so maybe take a look in the morning when you wake up. Also sent a long overdue BTC tip your way (to the address in your profile) for all the help you've provided.

I fell asleep immediately after making my previous post. Thank you for your generous tip! Now I am considering buying a Raspberry Pi for myself Wink
member
Activity: 112
Merit: 17
When I try downloading Zap without sudo I get the other error (package github.com/LN-Zap/zapconnect: mkdir /home/admin/go/src/github.com: permission denied). I checked environment details again and they look to be the same, details below.

Okay, that's great. For some reason permissions are not working properly so we will have to do it in a bit insecure way. Use sudo chmod -R 777 ~/go (this will allow every single user to modify the contents of folders and files inside go) and then run go get -d github.com/LN-Zap/zapconnect. I am too sleepy to think of a better solution.

Went ahead and tried the less secure method but unfortunately I was presented with a new error, as seen below

Code:
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)

I don't want to hold you up from sleep so maybe take a look in the morning when you wake up. Also sent a long overdue BTC tip your way (to the address in your profile) for all the help you've provided. The bitcoin community could really benefit from more people like you. Thanks again for your support!
legendary
Activity: 1876
Merit: 3132
When I try downloading Zap without sudo I get the other error (package github.com/LN-Zap/zapconnect: mkdir /home/admin/go/src/github.com: permission denied). I checked environment details again and they look to be the same, details below.

Okay, that's great. For some reason permissions are not working properly so we will have to do it in a bit insecure way. Use sudo chmod -R 777 ~/go (this will allow every single user to modify the contents of folders and files inside go) and then run go get -d github.com/LN-Zap/zapconnect. I am too sleepy to think of a better solution.
Pages:
Jump to: