Author

Topic: Questions RE: setting up Lightning Node on Raspberry Pi with Stadicus' guide (Read 22082 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.
member
Activity: 112
Merit: 17
Hmm, I created those folders and tried to download Zap again with using sudo at the beginning (sudo go get -d github.com/LN-Zap/zapconnect) but now getting the original error message (package github.com/LN-Zap/zapconnect: cannot download, $GOPATH not set. For more details see: go help gopath)

Try running that command without sudo. Also, check what has happened to $GOPATH by typing in go env. If it has changed then use the previous two echo commands to set it again.

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.

Code:
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/admin/go"
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_arm"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build473268620=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
legendary
Activity: 1876
Merit: 3132
Hmm, I created those folders and tried to download Zap again with using sudo at the beginning (sudo go get -d github.com/LN-Zap/zapconnect) but now getting the original error message (package github.com/LN-Zap/zapconnect: cannot download, $GOPATH not set. For more details see: go help gopath)

Try running that command without sudo. Also, check what has happened to $GOPATH by typing in go env. If it has changed then use the previous two echo commands to set it again.
member
Activity: 112
Merit: 17
I then proceeded to try and download Zap Connect but now get the following output

Code:
package github.com/LN-Zap/zapconnect: mkdir /home/admin/go/src: permission denied

It looks like Go requires three more folders to work. Use sudo mkdir ~/go/bin ~/go/src ~/go/pkg. You can also run all the commands from Zap connect with sudo in the beginning just in case.

Hmm, I created those folders and tried to download Zap again with using sudo at the beginning (sudo go get -d github.com/LN-Zap/zapconnect) but now getting the original error message (package github.com/LN-Zap/zapconnect: cannot download, $GOPATH not set. For more details see: go help gopath)

legendary
Activity: 1876
Merit: 3132
I then proceeded to try and download Zap Connect but now get the following output

Code:
package github.com/LN-Zap/zapconnect: mkdir /home/admin/go/src: permission denied

It looks like Go requires three more folders to work. Use sudo mkdir ~/go/bin ~/go/src ~/go/pkg. You can also run all the commands from Zap connect with sudo in the beginning just in case.
member
Activity: 112
Merit: 17
That worked correctly this time so I continued to check the environment variables with input "go env" and noticed my output didn't match up with the guide

Some of the environment variables must be different in this case. Try the following commands

sudo mdkir ~/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile

Log out, connect again to your machine and then run go env to see whether or not GOPATH has changed. If so, try the command from Zap connect.

Ok followed those steps and the GOPATH was successfully changed. I get the following environment config now

Code:
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/admin/go"
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_arm"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build354012546=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

I then proceeded to try and download Zap Connect but now get the following output

Code:
package github.com/LN-Zap/zapconnect: mkdir /home/admin/go/src: permission denied
legendary
Activity: 1876
Merit: 3132
That worked correctly this time so I continued to check the environment variables with input "go env" and noticed my output didn't match up with the guide

Some of the environment variables must be different in this case. Try the following commands

sudo mdkir ~/go
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'PATH="$HOME/go/bin:$PATH"' >> ~/.profile

Log out, connect again to your machine and then run go env to see whether or not GOPATH has changed. If so, try the command from Zap connect.
member
Activity: 112
Merit: 17
I guess that you needn't have looked at the environment variables (go env) since it was installed in a different way. You should have moved on to the Zap connect part. Let's try to fix that. Type in the following commands.

sudo rm -r /usr/local/go - to make sure that the folder you have moved is completely deleted
sudo apt-get remove golang - completely getting rid of everything related to the Go. I don't think that purge command is necessary here.
sudo apt-get install golang

Please, let me know if this has worked for you. I am going to bed soon.

Edit: Oh, you have just changed your post. I will answer it in a moment.

Yes please disregard the original post, the edited version is where I'm at now
legendary
Activity: 1876
Merit: 3132
I guess that you needn't have looked at the environment variables (go env) since it was installed in a different way. You should have moved on to the Zap connect part. Let's try to fix that. Type in the following commands.

sudo rm -r /usr/local/go - to make sure that the folder you have moved is completely deleted
sudo apt-get remove golang - completely getting rid of everything related to the Go. I don't think that purge command is necessary here.
sudo apt-get install golang

Please, let me know if this has worked for you. I am going to bed soon.

Edit: Oh, you have just changed your post. I will answer it in a moment.
member
Activity: 112
Merit: 17
Will definitely try the second suggestion if the first one fails! What exactly does that command do? (sudo apt-get install golang)

sudo apt-get install golang automatically installs Go and other dependencies in case they are needed on your system. I wonder why it isn't mentioned in the tutorial. There is a slight chance that the repository won't be available for your OS (I can't recall which version it was) and the whole installation will fail. If you don't want to play around with the 32 bit version then you can try using this command first.

Ok I was able to revert back and reinstall Go and other dependencies with the command you suggested. After that I skipped back down to the Verify Go Installation section and entered input "go version". That worked correctly this time so I continued to check the environment variables with input "go env" and noticed my output didn't match up with the guide, so I backtracked to the beginning of the guide and moved the go folder again to /usr/local which gave the following error

Code:
mv: cannot stat 'go': No such file or directory

I skipped ahead assuming the folder was already moved and went to resetup the environment. After each command I noticed nothing really happens. When I check the environment details again I still see nothing has changed. I get the following output


Code:
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/go-1.7"
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_arm"
CC="gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build033723346=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

I decided to skip ahead all the way to the Zap Connect section to see if it allows me to download this time. I get the following output which leads me to believe the environment is still not setup correctly.

Code:
package github.com/LN-Zap/zapconnect: cannot download, $GOPATH not set. For more details see: go help gopath

Sorry for all the confusion  Huh
legendary
Activity: 1876
Merit: 3132
Will definitely try the second suggestion if the first one fails! What exactly does that command do? (sudo apt-get install golang)

sudo apt-get install golang automatically installs Go and other dependencies in case they are needed on your system. I wonder why it isn't mentioned in the tutorial. There is a slight chance that the repository won't be available for your OS (I can't recall which version it was) and the whole installation will fail. If you don't want to play around with the 32 bit version then you can try using this command first.
member
Activity: 112
Merit: 17
What do you mean by reverting everything though? How would I do that?

In this case, it means that you have to get rid of the version that you have currently installed. You can do it easily by typing in sudo rm -r /usr/local/go because you have installed it manually. If you get 'Unknown directory error' or something similar then you must have done something wrong in the first place. Don't forget about the second suggestion if the first one doesn't work for you.

Will definitely try the second suggestion if the first one fails! What exactly does that command do? (sudo apt-get install golang)
legendary
Activity: 1876
Merit: 3132
What do you mean by reverting everything though? How would I do that?

In this case, it means that you have to get rid of the version that you have currently installed. You can do it easily by typing in sudo rm -r /usr/local/go because you have installed it manually. If you get 'Unknown directory error' or something similar then you must have done something wrong in the first place. Don't forget about the second suggestion if the first one doesn't work for you.
member
Activity: 112
Merit: 17
There are two things that I would try if I were you:

1) Download the 32 bit version of Go instead of the 64 bit one. https://dl.google.com/go/go1.11.4.linux-386.tar.gz

2) If the first suggestion doesn't work then use the following command sudo apt-get install golang

Don't forget to revert everything you have done so far before trying out each of these.

Hey BitCryptex, appreciate the response as always!

I'll try downloading the 32bit version when I get home, definitely good call on that. What do you mean by reverting everything though? How would I do that?
legendary
Activity: 1876
Merit: 3132
There are two things that I would try if I were you:

1) Download the 32 bit version of Go instead of the 64 bit one. https://dl.google.com/go/go1.11.4.linux-386.tar.gz

2) If the first suggestion doesn't work then use the following command sudo apt-get install golang

Don't forget to revert everything you have done so far before trying out each of these.
member
Activity: 112
Merit: 17
Any ideas?

Try installing Go automatically by typing in sudo apt-get install golang. You must have done something wrong during the manual installation.

Edit:

I'm assuming I would skip straight to the "Zap Connect" section since everything before that seems to be instructions on setting up a node.

Ah, you shouldn't have skipped that much. The skipped part describes the installation process of LND and Go which is necessary.

Ah well that would explain it. I went back to the beginning, starting with section "Downloading Go" and was able to breeze through everything until I hit "Verify Go Installation". When I enter "go version" I get the following output

Code:
-bash: /usr/local/go/bin/go: cannot execute binary file: Exec format error

I tried reinstalling and going through the same steps but get the same issue. Any idea on went wrong?
legendary
Activity: 1876
Merit: 3132
Any ideas?

Try installing Go automatically by typing in sudo apt-get install golang. You must have done something wrong during the manual installation.

Edit:

I'm assuming I would skip straight to the "Zap Connect" section since everything before that seems to be instructions on setting up a node.

Ah, you shouldn't have skipped that much. The skipped part describes the installation process of LND and Go which is necessary.
member
Activity: 112
Merit: 17
Hey all, I'm back with another question. I'm trying to setup the Zap iOS wallet with my node but having trouble generating a QR code through LND. I'm following the guide below...

https://ln-zap.github.io/zap-tutorials/iOS-remote-node-setup.html

I'm assuming I would skip straight to the "Zap Connect" section since everything before that seems to be instructions on setting up a node. When I try downloading Zap Connect with LND, I put in command "go get -d github.com/LN-Zap/zapconnect" per the instructions but get "-bash: go: command not found" as an output.

Any ideas?
newbie
Activity: 4
Merit: 0
Ah! @BitCryptex! thanks! I didn’t get info about your reply in the first place  Huh sorry.
And was almost afraid my question was to dumb.

good thing about it:
I found out myself, that I ran LND with this autopilot config, —which as it happens— uploads 60% of total balance and opens up to 5 channels automatically! At least the balance question is solved. Smiley

Code:
# RaspiBolt: lnd configuration
# /home/bitcoin/.lnd/lnd.conf

[Application Options]
debuglevel=info
maxpendingchannels=5
alias=YOUR_NAME [LND]
color=#68F442

# Your router must support and enable UPnP, otherwise delete this line  
nat=true

[Bitcoin]
bitcoin.active=1

# enable either testnet or mainnet
bitcoin.testnet=1
#bitcoin.mainnet=1

bitcoin.node=bitcoind

[autopilot]
autopilot.active=1
autopilot.maxchannels=5
# here ist the 60% thingy!
autopilot.allocation=0.6

So as I get it, I have now locked this ~0.06 locked up in my channel — while the rest (~0.039) is still in my wallet.

Edited:
Of course I messed up the zeros: must be ~0.0006 and ~0.00039
legendary
Activity: 1876
Merit: 3132
I was thinking that there was some kind of autopilot thingy but maybe only for opening/searching channels?
sorry. completely new to all of this magic.

Actually, there is an autopilot and it might have just worked for you. According to this transaction, your address 2N5gfEWg4nMU1DS4uLRwqwCQfG8Yym3Jf7m received exactly 0.001 BTC. These coins were almost immediately split between two native SegWit addresses. This suggests that the autopilot has funded a channel for you. Use the following command to check whether or not your payment channel is active:

lncli listchannels

If there is anything listed there then you can try to pay for something over the Lightning Network because your transaction has already more than 6 confirmations.
newbie
Activity: 4
Merit: 0
thanks for lightning fast reply! Wink
since i am not even sure what a transaction-id is but here is the link
https://testnet.smartbit.com.au/tx/ee1755b974cbc8dfb8b673336973f0b0306cb34f6a10d49a82a1abc6076b59ae

If you executed only these three commands then you didn't open any channel. You have just funded on-chain wallet of your Lightning Network node. In order to open a channel, you have to execute the following commands:

I was thinking that there was some kind of autopilot thingy but maybe only for opening/searching channels?
sorry. completely new to all of this magic.


legendary
Activity: 1876
Merit: 3132
When I check the transaction on Blockexplorer it tells me that my channel is funded with 0.0006 / 60000 sat
It sums up to the total amount minus 177sat fee (even though it was announced with 166). But I totally do not get it.  Angry

If you executed only these three commands then you didn't open any channel. You have just funded on-chain wallet of your Lightning Network node. In order to open a channel, you have to execute the following commands:

lncli connect @:
lncli openchannel --node_key= --local_amt=

Could you share your txid with us? Since you are working on the testnet, it won't have any impact on your privacy.
newbie
Activity: 4
Merit: 0
Hi there, not sure if this is the right thread but I dont know where else to put it rn.
I followed this instruction and got it somehow running on testnet.

Now I funded my LN Wallet with 0.001 BTC

Code:
bitcoin@xxx:~ $ bitcoin-cli sendtoaddress 2N5gfEWg4nMU1DS4uLRwqwCQfG8Yym3Jf7m 0.001

Checked immediately after it looked like this (Which made sense to me):

Code:
bitcoin@xxx:~ $ lncli --network=testnet walletbalance
{
    "total_balance": "100000",
    "confirmed_balance": "0",
    "unconfirmed_balance": "100000"

Now the sourcery when tx where confirmed (which doesnt make any sense to me):

Code:
bitcoin@xxx:~ $ lncli --network=testnet walletbalance
{
    "total_balance": "39823",
    "confirmed_balance": "39823",
    "unconfirmed_balance": "0"

It’s getting even weirder:
When I check the transaction on Blockexplorer it tells me that my channel is funded with 0.0006 / 60000 sat
It sums up to the total amount minus 177sat fee (even though it was announced with 166). But I totally do not get it.  Angry

Can someone provide help? Thanks a lot!
member
Activity: 112
Merit: 17
Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist

It still looks like a permission problem to me. Let's try two different things and see which one will work.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

Check if this has fixed your problem. LND restart might (but should not) be needed. If it doesn't work, try deleting admin.macaroon (it will probably result in another error which you faced earlier).

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

EDIT: The second solution (deleting admin.macaroon) might work since you have switched from the testnet to the mainnet. LND should generate a new permission file compatible with the mainnet. Also, we assigned the "-hR" parameter to the chown earlier so it should have affected admin.macaroon as well.

Awesome, I got it working! Funding wallet now! Feel free to provide your node info, would like to repay you for all the help (same goes for Carlton)

Update: Thank you guys!

legendary
Activity: 1876
Merit: 3132
Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist

It still looks like a permission problem to me. Let's try two different things and see which one will work.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

Check if this has fixed your problem. LND restart might (but should not) be needed. If it doesn't work, try deleting admin.macaroon (it will probably result in another error which you faced earlier).

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon

EDIT: The second solution (deleting admin.macaroon) might work since you have switched from the testnet to the mainnet. LND should generate a new permission file compatible with the mainnet. Also, we assigned the "-hR" parameter to the chown earlier so it should have affected admin.macaroon as well.
member
Activity: 112
Merit: 17
Oh. I forgot that I asked you to create mainnet folder using sudo. User bitcoin probably did not have permission to create wallet.db file. The testnet one is obviously incompatible.

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chown -hR bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

Now you can try creating a new wallet again.

That did the trick, thank you!! Please provide your node info, would like to throw a lightning tip your way once my LND gets caught up with the mainnet blockchain

Edit: I spoke too soon, my LND is caught up but I can't generate a new wallet address. When I do "lncli newaddress np2wkh" I get the following error message

[lncli] rpc error: code = Unknown desc = cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist
legendary
Activity: 1876
Merit: 3132
Oh. I forgot that I asked you to create mainnet folder using sudo. User bitcoin probably did not have permission to create wallet.db file. The testnet one is obviously incompatible.

Code:
sudo rm /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chown -hR bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

Now you can try creating a new wallet again.
member
Activity: 112
Merit: 17
Gave that a try and got the following error message when I tried to unlock afterwards

It seems to be a small permission problem. These two commands should fix it.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db

The documentation seems to be a bit outdated.

Ok well that sorta seemed to work but brings me back to square one. I'm able to successfully unlock the wallet but when I monitor the LND startup process with the "sudo journalctl -f -u lnd" command, the following message pops up



After waiting a minute or two, this message eventually comes up


legendary
Activity: 1876
Merit: 3132
Gave that a try and got the following error message when I tried to unlock afterwards

It seems to be a small permission problem. These two commands should fix it.

Code:
sudo chown bitcoin /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db
Code:
sudo chmod 700 /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db

The documentation seems to be a bit outdated.
member
Activity: 112
Merit: 17
Any ideas?

You wallet might have been created in the testnet directory. Try copying wallet.db using the following command

Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/wallet.db /home/bitcoin/.lnd/data/chain/bitcoin/mainnet



Gave that a try and got the following error message when I tried to unlock afterwards

[lncli] rpc error: code = PermissionDenied desc = open /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/wallet.db: permission denied
legendary
Activity: 1876
Merit: 3132
Any ideas?

You wallet might have been created in the testnet directory. Try copying wallet.db using the following command

Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/wallet.db /home/bitcoin/.lnd/data/chain/bitcoin/mainnet

member
Activity: 112
Merit: 17
So I was able to get testnet fully operation and have started the migration process to mainnet. For some reason I'm having a hard time unlocking my LND wallet. Under "Mainnet > Restart bitcoind & lnd for mainnet" it has us create a new LND wallet using same password as testnet. Followed these steps without any issues but for some reason when I restart and unlock my wallet, I get the following error message

[lncli] rpc error: code = Unknown desc = wallet not found

Any ideas?
legendary
Activity: 1876
Merit: 3132
Also, how do I assign an alias to my node? That might make it easier to find.

You have to edit the configuration file using nano and restart your node to apply changes. "Alias" setting should be somewhere in the middle of the file and as far as I remember, it should not exceed 32 characters.

Code:
sudo nano /home/bitcoin/.lnd/lnd.conf
Code:
sudo systemctl restart lnd

ACINQ explorer is a bit outdated so I wouldn't be surprised if it was their fault. 1ML.com is often used by us, especially on the mainnet. If I were you, I would ignore that issue. Please note that 1ML.com might not update your node information instantly. On the left side of the page there should be "Last updated".
member
Activity: 112
Merit: 17
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/


From their site:
Quote
If you can't find your node, please make sure that your node or one of its peers has a connection or a channel opened to one of the nodes in the network.


So first make sure you are connected to at least one of these nodes.

Afterwards you can use the serach bar at the upper right to find your node either using your public key or IP address.

I can find my node on the 1ML testnet explorer but not on the acqing explorer. Link to my node on 1ML is below, I definitely have channels open with nodes listed on acqing

https://1ml.com/testnet/node/038c7b93518f30975d046a98dd1b369219abc77a17f804ee728402c9e0f3d65657

Also, how do I assign an alias to my node? That might make it easier to find.
legendary
Activity: 1624
Merit: 2481
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/


From their site:
Quote
If you can't find your node, please make sure that your node or one of its peers has a connection or a channel opened to one of the nodes in the network.


So first make sure you are connected to at least one of these nodes.

Afterwards you can use the serach bar at the upper right to find your node either using your public key or IP address.
member
Activity: 112
Merit: 17
How would I find my testnet node on a Lightning Network explorer like in the link below?

https://explorer.acinq.co/
member
Activity: 112
Merit: 17
Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Good to hear

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees.

Maybe a software bug? Reading up on lnd might help


Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)

Possibly the Pi. How long was the delay? And when you did 'lncli openchannel', was that to the starblocks node directly? If not, that may be one reason for the delay (BitCryptex is saying the same basic thing a different way).

One way it could slow right down is if the payment path failed multiple times, that would be pretty bad luck for a first attempt.

It took about 20 seconds per transaction on Starblocks but was near instant when I bought an article off Yalls.org. It's possible I'm not connected directly with the Starblocks channel, will have to double check when I get home.

Very happy that I finally have the testnet up and running, thank you again for all the help! Going to move onto mainnet tonight so I can buy this Blockstream sticker. Then it will all have been worth it Smiley

https://store.blockstream.com/product/lightning-sticker/
legendary
Activity: 3430
Merit: 3080
Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Good to hear

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees.

Maybe a software bug? Reading up on lnd might help


Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)

Possibly the Pi. How long was the delay? And when you did 'lncli openchannel', was that to the starblocks node directly? If not, that may be one reason for the delay (BitCryptex is saying the same basic thing a different way).

One way it could slow right down is if the payment path failed multiple times, that would be pretty bad luck for a first attempt.
legendary
Activity: 1876
Merit: 3132
Thank you! Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees. Also there is a bit of a delay when making the payment, thought it was supposed to be lightning fast  Smiley

Bitcoin Lightning Network transaction speed depends on the number of nodes that take part in the payment routing. LND might prefer to take a cheaper route over a shorter one. If you open a channel directly to Starblock then your payment will be confirmed instantly without any fees. Wallet balance is not the same as channel balance. You have to use the following command to check the state of your channels.

Code:
lncli listchannels
member
Activity: 112
Merit: 17
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands.

Code:
sudo mkdir /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/admin.macaroon /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/

Are you sure that your LND instance runs on the testnet?

@DOWN: Fixed

Nice that did the trick! Made my first successful payment on the testnet! Thank you!

Weird thing is my wallet balance hasn't changed after purchasing 3 Starblock coffees. Also there is a pretty significant delay when making the payment, thought it was supposed to be lightning fast Smiley (or maybe it's just the limited processing power of the Pi)
member
Activity: 112
Merit: 17
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands.

Code:
sudo mkdir /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo cp --parents /home/bitcoin/.lnd/data/chain/bitcoin/testnet/admin.macaroon .lnd/data/chain/bitcoin/mainnet/

Are you sure that your LND instance runs on the testnet?

Now I'm not so sure... After making the directory and entering that second command I get the following message

cp: with --parents, the destination must be a directory
Try 'cp --help' for more information.


Is it possible to remove the LND entirely and redo that part of the guide? At this point I'm probably better off with a clean install rather than troubleshooting to see what went wrong
legendary
Activity: 1876
Merit: 3132
Looks like there is still an issue with the macaroon files/path  Huh

Use the following commands to create missing mainnet directory and copy files over there.

Code:
sudo mkdir /home/bitcoin/.lnd/data/chain/bitcoin/mainnet
Code:
sudo cp /home/bitcoin/.lnd/data/chain/bitcoin/testnet/admin.macaroon /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/

Are you sure that your LND instance runs on the testnet?

@Down: Fixed the command. Now it should work.
member
Activity: 112
Merit: 17
I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

You have to fund a channel first. Below you will find an example how to do it. Here you can browse testnet nodes.

Code:
lncli connect 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f@197.155.6.38:9735
Code:
lncli openchannel 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f 20000

20000 is number of satoshis. One satoshi equals 0.00000001 BTC. As far as I remember, six confirmations are needed for channels to work. I might be wrong.

Looks like there is still an issue with the macaroon files/path  Huh

legendary
Activity: 3430
Merit: 3080
^^^ Right

1. Make LN connection
2. Open channel
3. Pay someone through channel
legendary
Activity: 1876
Merit: 3132
I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

You have to fund a channel first. Below you will find an example how to do it. Here you can browse testnet nodes.

Code:
lncli connect 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f@197.155.6.38:9735
Code:
lncli openchannel 0269a94e8b32c005e4336bfb743c08a6e9beb13d940d57c479d95c8e687ccbdb9f 20000

20000 is number of satoshis. One satoshi equals 0.00000001 BTC. As far as I remember, six confirmations are needed for channels to work. I might be wrong.
legendary
Activity: 3430
Merit: 3080
You checked that the transaction is confirmed?

Also, you might need to manually initiate the first connection, the lnd autopilot possibly doesn't do that part (but auto opens after the first connection is made).
member
Activity: 112
Merit: 17
When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.


Press Q to get the prompt back


Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"



Probably a typo in the original guide. Let Stadicus know, he'd appreciate it if that turns out to be the case.

Yeah I think it might be a mistake because I have the macaroon files in testnet just not mainnet. So when I change the command below from mainnet to testnet, I'm able to continue with the rest of the steps

$ cd /home/bitcoin/
$ sudo cp --parents .lnd/data/chain/bitcoin/mainnet/admin.macaroon /home/admin/ (Changed this to testnet)
$ sudo cp /home/bitcoin/.lnd/tls.cert /home/admin/.lnd
$ sudo chown -R admin:admin /home/admin/.lnd/


I got some testnet BTC from a faucet and successfully deposited into my LND wallet, but for some reason unable to make a payment to Starblocks. See image below... LND is supposedly on "Autopilot" by default so it should be opening channels on its own, yet I don't see any channels open when I enter "lncli --network=testnet listchannels"

legendary
Activity: 3430
Merit: 3080
When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.


Press Q to get the prompt back


Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"



Probably a typo in the original guide. Let Stadicus know, it would be appreciated it if that turns out to be the case.
member
Activity: 112
Merit: 17
Hmm looks like those files do exist. Not sure why they don't appear when I do "ls -la /home/bitcoin/.lnd/"

legendary
Activity: 1876
Merit: 3132
What would the command be to check that directory?

It's very similar to the command you have used previously. The following one will tell you whether or not folders mainnet and testnet exist.

Code:
ls -la /home/bitcoin/.lnd/data/chain/bitcoin/

If these folders exist you can check what's inside them by adding either testnet or mainnet after /bitcoin/. By the way, you were not able to use the touch command earlier because you forgot to add sudo before it.

member
Activity: 112
Merit: 17
Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Everything is fine. You can use the following command to check whether or not your public IP is detected correctly.

Code:
cat /run/publicip

As for the permission files problem, you should have mainnet and testnet folders in the .lnd/data/chain/bitcoin directory. You should find admin.macaroon and other needed files there.

What would the command be to check that directory?
legendary
Activity: 1876
Merit: 3132
Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Everything is fine. You can use the following command to check whether or not your public IP is detected correctly.

Code:
cat /run/publicip

As for the permission files problem, you should have mainnet and testnet folders in the .lnd/data/chain/bitcoin directory. You should find admin.macaroon and other needed files in them.
member
Activity: 112
Merit: 17
ls -la /home/bitcoin/.lnd/

That command just lists files in /home/bitcoin/.lnd/, 'ls' is the list command.

To create those files... either running lnd will do that (i haven't used lnd), or you could do it yourself (the command would be touch /home/bitcoin/.lnd/admin.macaroon). But it makes more sense that lnd would do it, the idea is that a macaroon file is similar to a cookie file (both are biscuits IRL, a curious metaphor IMO). Checking the documentation for lnd should tell you more (at this stage, you've probably done most of what the guide can tell you).

Hmm not sure why the lnd didn't create them. Ran through the steps again just to make sure I didn't miss anything but still not seeing the macaroon files. Actually have a question about the "Public IP script" portion of the guide. When I run the command "sudo systemctl status getpublicip" I get the following screen. Not sure what I'm supposed to do here, I just Ctrl +C'd out and continued with the rest of the steps.

Also, when I tried touch /home/bitcoin/.lnd/admin.macaroon I got "Permission denied"



legendary
Activity: 3430
Merit: 3080
ls -la /home/bitcoin/.lnd/

That command just lists files in /home/bitcoin/.lnd/, 'ls' is the list command.

To create those files... either running lnd will do that (i haven't used lnd), or you could do it yourself (the command would be touch /home/bitcoin/.lnd/admin.macaroon). But it makes more sense that lnd would do it, the idea is that a macaroon file is similar to a cookie file (both are biscuits IRL, a curious metaphor IMO). Checking the documentation for lnd should tell you more (at this stage, you've probably done most of what the guide can tell you).
member
Activity: 112
Merit: 17
I've been cruising through the rest of the guide but just hit another road block (under Lightning > Assign LND permissions to "admin"). It asks us to check to see if files admin.macaroon and readonly.macaroon have been created by using the following command

ls -la /home/bitcoin/.lnd/

When I execute this command I get everything in the screenshot except those two files. Do I have to wait for them to be created or am I doing something wrong?
legendary
Activity: 1624
Merit: 2481
When would I enter that? After the "chmod -R 700 .ssh/" command?

Usually, you shoudn't enter this command at all.
Inside of the .ssh directory, there are files which are fine to be read by non-root users (e.g. known_hosts).

All you have to protect inside of the directory are the private keys of the machine from reading and the public key from connecting clients from manipulation.


Back to your question. Usually you enter this command to move the public key of your machine you use to login into the .ssh directory of your server (the machine you want to connect to).
You just need a valid private-/public- ssh keypair on your machine used to login before executing this command.
legendary
Activity: 3430
Merit: 3080
member
Activity: 112
Merit: 17
Finally got it working! Was able to narrow it down and realized I did something wrong during the "Enabling the Uncomplicated Firewall" step. Should be good for now!
legendary
Activity: 1876
Merit: 3132
Ok I can try again changing the nickname to just LightNode, but what about the "2048 37" at the beginning of the public key. Will the spaces there also create a problem? Also what are your thoughts on just skipping this step altogether?

You can skip this step and use a strong password instead. I have been using only passwords for a long time and nothing bad has happened yet. Here is how my public key looks like in ".ssh/authorized_keys".

Code:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAouIC+YCXpx9dnUsjg6pROV6pTMKJBkoHEB4vy/R9XL+WHdKQbLGm7wt9kQ4soI15oHDAaHScm6lAnAirGzRFIGGLOfgBVGJygaptqz2Q9iw3
+giUoeXvFeluxKtMSEeDfjSH1s1u991/KhWso6N/t5tcqlqB5gurLc5Bc/W7TRTqTnZzAohWOqsm5HYo8F/
0gaHwDCZWb7cKZVJlzVegw1JL40hox0sKnCNV6aooh1Qdog5e1d8m2BKwDasc1mKdcFgg82MB+FmnxlYRTwLi3
dW0hwEC+hIq+vF4AdBGrmskxaI/n1wMxAHJ9egJi5dwzHGCSp0QRlCeFbIIGtWlLw== rsa-key-20181004

Of course it would be better if you managed to get it worked out.
member
Activity: 112
Merit: 17
Once this opened I added the public key, saved by hitting Ctrl + O, enter, and then exiting with Ctrl + X. Below is an example of the public key I put in, I'm wondering if I was supposed to include the entire string?

Yes, you have to include the entire string.

Usually, after creating your keypair you simply move it to your server (your PI in this case).
This works with this command:

Code:
ssh-copy-id -i .ssh/key_rsa.pub [email protected] 

with PI-USERNAME being your username on the PI and 192.168.56.101 being the IP of your PI.


Afterwards you will be able to authenticate using public key cryptography, without entering your password.

When would I enter that? After the "chmod -R 700 .ssh/" command?

chmod -R 700 .ssh/ (Nothing happened after doing this)
exit

chmod doesn't give you any output if it succeeds, so don't worry about that. If you did ls -l before chmod, then again after chmod, you'd notice the file permissions change, which is chmod's purpose.


For example, at the very end it has the nickname I gave the key "LightNode Keys". Should I omit that?

"LightNode Keys" has a space character in it, but you're not using double quotes around the nickname in the example public key string you gave. I'm not saying that's the overall problem, but it's likely a problem. Avoid putting spaces in anything that's going to get parsed by a command line tool, a space is treated like an indication that a new parameter is after the space from the perspective of parsing commands.

Ok I can try again changing the nickname to just LightNode, but what about the "2048 37" at the beginning of the public key. Will the spaces there also create a problem? Also what are your thoughts on just skipping this step altogether?
legendary
Activity: 3430
Merit: 3080
chmod -R 700 .ssh/ (Nothing happened after doing this)
exit

chmod doesn't give you any output if it succeeds, so don't worry about that. If you did ls -l before chmod, then again after chmod, you'd notice the file permissions change, which is chmod's purpose.


For example, at the very end it has the nickname I gave the key "LightNode Keys". Should I omit that?

"LightNode Keys" has a space character in it, but you're not using double quotes around the nickname in the example public key string you gave. I'm not saying that's the overall problem, but it's likely a problem. Avoid putting spaces in anything that's going to get parsed by a command line tool, a space is treated like an indication that a new parameter is after the space from the perspective of parsing commands.
legendary
Activity: 1624
Merit: 2481
Once this opened I added the public key, saved by hitting Ctrl + O, enter, and then exiting with Ctrl + X. Below is an example of the public key I put in, I'm wondering if I was supposed to include the entire string?

Yes, you have to include the entire string.

Usually, after creating your keypair you simply move it to your server (your PI in this case).
This works with this command:

Code:
ssh-copy-id -i .ssh/key_rsa.pub [email protected] 

with PI-USERNAME being your username on the PI and 192.168.56.101 being the IP of your PI.


Afterwards you will be able to authenticate using public key cryptography, without entering your password.
member
Activity: 112
Merit: 17
Well I gave it another shot and ran into the same problem. Keep getting "Network error: Connection timed out" after setting up the public key in the .ssh/authorized_keys nano folder. I'm wondering if I'm somehow entering the public key wrong? Here is the step by step breakdown...

mkdir .ssh
nano .ssh/authorized_keys


Once this opened I added the public key, saved by hitting Ctrl + O, enter, and then exiting with Ctrl + X. Below is an example of the public key I put in, I'm wondering if I was supposed to include the entire string? For example, at the very end it has the nickname I gave the key "LightNode Keys". Should I omit that?

2048 37 2926877905057611927715148755727399686143855056397930910268176155544486039903026 9544216676050916922797437140181990936326704389571868101556788023723768028376095 5286411580936916507661787551554794150308211487587558445878082396130423946260024 8111988870557270960212891785752620587821289007077391612815577729744490956103657 8035117814798023232369059318931194448904566627840072531959805969875272348281735 9168228175348840554340892749717238557819322595421624901736023679109546926141029 5819236374715075005051553089587916223334468614057099430914344001508210336312229 0965589886136372605871099014869596718038391900923041721911870683 LightNode Keys

After I saved and exited, I entered the following commands...

chmod -R 700 .ssh/ (Nothing happened after doing this)
exit


Really not sure what to do at this point. How critical is this step? I'm thinking of just skipping it altogether but of course don't want to leave my node vulnerable.
legendary
Activity: 3430
Merit: 3080
That sounds off.

If you've reflashed the Debian image, there's no conceivable reason that pinging the Pi works, yet SSH login won't. Either the ethernet hardware on your Pi works or it doesn't. Are you using ethernet, or wifi?



Cool. I hope you get it working, this is all good experience you're building up.
member
Activity: 112
Merit: 17
The first thing I'd do is try pinging the IP of the Pi and other devices on your home network, it sounds like the problem is to do with your router

Already tried pinging, it's working fine

Edit: Nevermind, forgot to recreate the "ssh" file in the boot drive of my MicroSD. I'm back in and going to give this whole thing another whirl, I'll keep you guys posted.
legendary
Activity: 3430
Merit: 3080
The first thing I'd do is try pinging the IP of the Pi and other devices on your home network, it sounds like the problem is to do with your router
member
Activity: 112
Merit: 17
Another thing I noticed was the guide stated we should have 3 documents at this point; the public key, private key, and the authorized key text file. Right now I have everything but the text file. Is the text file just where we pasted the public key from PuTTYgen or is this something else?

I don't have a text file either. You should still be able to access your Raspberry Pi by simply typing in only IP address in the host name. Use "nano .ssh/authorized_keys" to access your saved keys. Save it using CTRL + O. I copied my public key from the window in which I had to move a cursor a bit.

Appreciate the quick response. Unfortunately I'm no longer able to access my Pi by just using the IP address. I get the same error message I mentioned previously, "Network error: Connection timed out"

Hopefully this doesn't mean I have to start from scratch

Update: I just wiped the SD card with SDFormatter and rewrote the "Raspberry Pi Lite" disk image back onto the SD hoping to start from the beginning. When I tried logging into the Pi from PuTTY with my static IP I got a different error message, this time "Network error: Connection refused"... Any ideas?  Huh
legendary
Activity: 1876
Merit: 3132
Another thing I noticed was the guide stated we should have 3 documents at this point; the public key, private key, and the authorized key text file. Right now I have everything but the text file. Is the text file just where we pasted the public key from PuTTYgen or is this something else?

I don't have a text file either. You should still be able to access your Raspberry Pi by simply typing in only IP address in the host name. Use "nano .ssh/authorized_keys" to access your saved keys. Save it using CTRL + O. I copied my public key from the window in which I had to move a cursor a bit.
member
Activity: 112
Merit: 17
I tried that and had the same problem. PuTTY window opens blank and then eventually get a message "Network error: Connection timed out"

I followed the tutorial on my VPS and everything works fine. If this was a problem with the key configuration, you would get a "Server refused our key" error. Are you sure that you have put a public key in ".ssh/authorized_keys"? Make sure that your router hasn't changed the local IP of your Raspberry Pi. It may happen if you didn't configure it to be persistent.


IP definitely hasn't changed since I set a static IP for the Pi. I'm positive I put the public key in ".ssh/authoized_keys" but maybe it didn't save? Is there anyway to go back in and check or am I locked out? Another thing I noticed was the guide stated we should have 3 files at this point; the public key, private key, and the authorized key text file. Right now I have everything but the text file. Is the text file just where we pasted the public key from PuTTYgen or is this something else?
legendary
Activity: 1876
Merit: 3132
I tried that and had the same problem. PuTTY window opens blank and then eventually get a message "Network error: Connection timed out"

I followed the tutorial on my VPS and everything works fine. If this was a problem with the key configuration, you would get a "Server refused our key" error. Are you sure that you have put a public key in ".ssh/authorized_keys"? Make sure that your router hasn't changed the local IP of your Raspberry Pi. It may happen if you didn't configure it to be persistent.
member
Activity: 112
Merit: 17
I tried that and had the same problem. PuTTY window opens blank and then eventually get a message "Network error: Connection timed out"

Which user did you choose? You should probably choose "root". For that, you'll need whatever the default password is for the root user on Debian (possibly the password is literally "root", but that's a guess). Search for "default Debian root password" maybe.

I chose the user “admin” which is what I’d been using for the rest of the setup. So for host name I put [email protected] and then loaded the private key. Where would I enter the password? I don’t see a field for it
legendary
Activity: 3430
Merit: 3080
I tried that and had the same problem. PuTTY window opens blank and then eventually get a message "Network error: Connection timed out"

Which user did you choose? You should probably choose "root". For that, you'll need whatever the default password is for the root user on Debian (possibly the password is literally "root", but that's a guess). Search for "default Debian root password" maybe.
member
Activity: 112
Merit: 17
Assuming my servin login user is "admin" and the server IP address is 192.168.1.2, would I be putting admin;192.168.1.2 into the "Host Name" field? I tried just using the IP address and loading the private key but the SSH window opens blank and doesn't allow me to type anything. Once again, any help would be much appreciated! Would really like to get this thing up and running

Your problem is that your system doesn't know as which user you are trying to log in. The solution is quite simple. Enter "[email protected]" in the host name, add your keys and save your session again.

I tried that and had the same problem. PuTTY window opens blank and then eventually get a message "Network error: Connection timed out"
legendary
Activity: 1876
Merit: 3132
Assuming my servin login user is "admin" and the server IP address is 192.168.1.2, would I be putting admin;192.168.1.2 into the "Host Name" field? I tried just using the IP address and loading the private key but the SSH window opens blank and doesn't allow me to type anything. Once again, any help would be much appreciated! Would really like to get this thing up and running

Your problem is that your system doesn't know as which user you are trying to log in. The solution is quite simple. Enter "[email protected]" in the host name, add your keys and save your session again.
member
Activity: 112
Merit: 17
Appreciate the help. I finally got past that step and am now stuck again with a new problem. Under "Raspberry Pi" > "Login with SSH keys" it instructs us to use private key encryption to login to our Pi and provides the following guide:

https://www.tecmint.com/ssh-passwordless-login-with-putty/

I followed everything without any issues until getting to Step 8, which shows how to login to our Pi with the private key. It gives the following instructions:

"Open Putty and add your server login user followed by your server IP Address or FQDN on Host Name field in the form of [email protected], enter your server SSH Port number if it was changed."

Assuming my servin login user is "admin" and the server IP address is 192.168.1.2, would I be putting admin;192.168.1.2 into the "Host Name" field? I tried just using the IP address and loading the private key but the SSH window opens blank and doesn't allow me to type anything. Once again, any help would be much appreciated! Would really like to get this thing up and running
legendary
Activity: 3430
Merit: 3080
I already have the UUID of my hard disk, I know to replace the "123456" with it. I'm confused about the first part though. Where/how do I access the fstab file? Is this something done in PuTTY or somewhere else?

fstab file is in the directory /etc/, so sudo nano /etc/fstab should open the fstab file in the nano editor. If it doesn't, then maybe that's because PuTTY won't let you use nano for some reason. You should see the contents of the fstab file when you execute sudo nano /etc/fstab . If not, you should get an error message of some kind.
legendary
Activity: 1876
Merit: 3132
As you can see there are two separate lines, how do I add the second line in PuTTY so both commands execute at the same time?

You got that wrong. What the author of the tutorial actually does, is opening a file (sudo nano etc/fstab) and then replacing "UUID=123456" manually. CTRL + O lets you save the file.

You can try this automatic installer if you find it too difficult to install it on your own.

Where/how do I access the fstab file? Is this something done in PuTTY or somewhere else?

Yes, you have to use nano which is a text editor as a person above mentioned. Use "sudo nano /etc/fstab" and save your file using CTRL + O.
member
Activity: 112
Merit: 17
As you can see there are two separate lines, how do I add the second line in PuTTY so both commands execute at the same time? I tried using the "^" symbol after the first line but that didn't seem to work.

That's not what the guide means.

nano is a text file editor, like... the Windows file editor (which I can't even remember the name of)

The line
Code:
UUID=123456 /mnt/hdd ext4 noexec,defaults 0 0

is supposed to be inserted into the fstab file. Probably at the end of the file, but you should check the implications of that beforehand.

And you need to use fdisk (or suchlike command) to discover the actual UUID for your external disk, and replace "123456" with that.

I already have the UUID of my hard disk, I know to replace the "123456" with it. I'm confused about the first part though. Where/how do I access the fstab file? Is this something done in PuTTY or somewhere else?
legendary
Activity: 3430
Merit: 3080
As you can see there are two separate lines, how do I add the second line in PuTTY so both commands execute at the same time? I tried using the "^" symbol after the first line but that didn't seem to work.

That's not what the guide means.

nano is a text file editor, like... the Windows file editor (which I can't even remember the name of).

The line
Code:
UUID=123456 /mnt/hdd ext4 noexec,defaults 0 0

is supposed to be inserted into the fstab file. Probably at the end of the file, but you should check the implications of that beforehand. It's not a command, it's a config value.

And you need to use fdisk (or suchlike command) to discover the actual UUID for your external disk, and replace "123456" with that.
member
Activity: 112
Merit: 17
I'm in the process of setting up a Bitcoin/Lightning node on a Raspberry Pi following Stadicus' walkthough and have some pretty rudimentary questions (since I've never used Linux or a Raspberry Pi before). Link to the guide is below...

https://github.com/Stadicus/guides/blob/master/raspibolt/README.md

First question is really simple, I'm almost embarrassed to ask but I had no luck finding an answer on google. Under the "Raspberry Pi" > "Mounting external hard disk" section of the guide, it instructs us to "Edit the fstab file and the following as a new line (replace UUID=123456) at the end." He does this by putting in the following command line (this is all being done in a CMD window through a SSH client, in this case PuTTY)...

sudo nano /etc/fstab
UUID=123456 /mnt/hdd ext4 noexec,defaults 0 0


As you can see there are two separate lines, how do I add the second line in PuTTY so both commands execute at the same time? I tried using the "^" symbol after the first line but that didn't seem to work.

I'm sure I'll have more questions as I get deeper into the guide but this is currently what I'm stuck on. Any help would be much appreciated
!

Appreciate the help. I finally got past that step and am now stuck again with a new problem. Under "Raspberry Pi" > "Login with SSH keys" it instructs us to use private key encryption to login to our Pi and provides the following guide:

https://www.tecmint.com/ssh-passwordless-login-with-putty/

I followed everything without any issues until getting to Step 8, which shows how to login to our Pi with the private key. It gives the following instructions:

"Open Putty and add your server login user followed by your server IP Address or FQDN on Host Name field in the form of [email protected], enter your server SSH Port number if it was changed."

Assuming my servin login user is "admin" and the server IP address is 192.168.1.2, would I be putting admin;192.168.1.2 into the "Host Name" field? I tried just using the IP address and loading the private key but the SSH window opens blank and doesn't allow me to type anything. Once again, any help would be much appreciated! Would really like to get this thing up and running


I've been cruising through the rest of the guide but just hit another road block (under Lightning > Assign LND permissions to "admin"). It asks us to check to see if files admin.macaroon and readonly.macaroon have been created by using the following command

ls -la /home/bitcoin/.lnd/

When I execute this command I get everything in the screenshot except those two files. Do I have to wait for them to be created or am I doing something wrong?


Update: Testnet seems to be fully operational now, going to move onto mainnet tonight. Thank you for all the help!
Jump to: