Bitcoin Forum
May 08, 2024, 04:33:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Running bitcoin node with LN hub on a Raspberry Pi 3  (Read 803 times)
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
February 16, 2018, 07:32:05 PM
Merited by HeRetiK (1), wilwxk (1)
 #1

Hi experts,
I don't know if this is the right place to ask, but I'd like to start to play with Lightning network, but want to start small.
I've found this https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md on github, and I've made my first step, I've ordered the Raspberry Pi 3B.
I've found some threads about Raspberry Pi but it's usually about running some nodes (bitcoin, other alts) on PI but not about LN.
Do you have any experience with the LN node on the PI?
I'm not afraid of linux or anything, just wanted to ask in advance before the PI arrives, what to download, where to search for some info (I can use google, but this is something specific.)
Thanks in advance!
1715142823
Hero Member
*
Offline Offline

Posts: 1715142823

View Profile Personal Message (Offline)

Ignore
1715142823
Reply with quote  #2

1715142823
Report to moderator
1715142823
Hero Member
*
Offline Offline

Posts: 1715142823

View Profile Personal Message (Offline)

Ignore
1715142823
Reply with quote  #2

1715142823
Report to moderator
1715142823
Hero Member
*
Offline Offline

Posts: 1715142823

View Profile Personal Message (Offline)

Ignore
1715142823
Reply with quote  #2

1715142823
Report to moderator
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715142823
Hero Member
*
Offline Offline

Posts: 1715142823

View Profile Personal Message (Offline)

Ignore
1715142823
Reply with quote  #2

1715142823
Report to moderator
nitrousteam
Member
**
Offline Offline

Activity: 154
Merit: 15


View Profile
February 16, 2018, 11:13:01 PM
Merited by vlom (1)
 #2

Credit for tutorial goes to Stadicus:

https://medium.com/@stadicus/noobs-guide-to-%EF%B8%8F-lightning%EF%B8%8F-on-a-raspberry-pi-f0ab7525586e

             CONTRACTNET     |     At the intersection of Blockchain, IOT & SMART CONTRACTS             
|     WHITEPAPER     |     TWITTER     |      TELEGRAM     
████████████████████████  [  JOIN ICO   ●   10th MARCH  ] ████████████████████████
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
February 17, 2018, 08:27:44 AM
 #3

Thanks, I haven't found this one yet.
I have read it thru quickly, it uses the eclair version of lightning hub, the one I put it into the OP was referring to lnd which is a different build, according to my understanding, they are totally different.
I'll search for the differences, surely there's somewhere a comparison about the different LN nodes (there's 3 kind of LN nodes as I saw somewhere).
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
February 23, 2018, 09:40:48 PM
 #4

Status update:
I've received the Raspberry PI, I've managed to set it up, so it's working, but there's nothing installed yet in connection with bitcoin. I've used this install guide, it was really straightforward and was easy to follow.
https://medium.com/@stadicus/noobs-guide-to-️-lightning️-on-a-raspberry-pi-f0ab7525586e
What I'm reading now is a so called neutrino light client which is not a full node but something like a pruned one without the full blockchain, it connects to other nodes to gather the necessary information about blockchain. If I use this, the 16Gb SD card in the Raspberry PI will be enough to run a bitcoin node with LN hub installed. (I understand that running a full node will be necessary in the future, but now I would like to test only, so it's enough for that purpose.)
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
February 24, 2018, 09:21:15 PM
Merited by DarkStar_ (2)
 #5

Next status update:
I've just managed to set up the Raspberry PI 3 with a working minimal OS, but nothing installed which is connected with bitcoin.
Now I've decided to run a neutrino lightweight node to let the lnd connect to it because it doesn't require a full node running locally.
So I was about to install the lnd on the raspberry but failed with the GO language, which is a must to have lnd installed.
I was following this guide:
https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md
When I started to intall GO:
Code:
sudo apt-get install golang-1.10-go
I had an error message:
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package golang-1.10-go
E: Couldn't find any package by glob 'golang-1.10-go'
E: Couldn't find any package by regex 'golang-1.10-go'
So I read a bit, and found that for the raspberry linux, we only have go 1.8 available, which is OK for lnd, because 1.8 is the minimal required version of GO.
So I was about to install the 1.8 GO but no success:
Code:
sudo apt-get install golang-1.8-go
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package golang-1.8-go is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'golang-1.8-go' has no installation candidate
So now I'm searching for a workaround to be able to install GO on the raspberry to be able to continue the installation of lnd...

bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
February 25, 2018, 01:46:35 PM
 #6

Code:
sudo apt-get install golang-1.10-go
I had an error message:
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package golang-1.10-go
E: Couldn't find any package by glob 'golang-1.10-go'
E: Couldn't find any package by regex 'golang-1.10-go'
So I read a bit, and found that for the raspberry linux, we only have go 1.8 available, which is OK for lnd, because 1.8 is the minimal required version of GO.
So I was about to install the 1.8 GO but no success:
Code:
sudo apt-get install golang-1.8-go
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package golang-1.8-go is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'golang-1.8-go' has no installation candidate


You might try to add this repository and install 1.8 or 1.9:

Code:
$ sudo add-apt-repository ppa:gophers/archive
$ sudo apt-get update
$ sudo apt-get install golang-1.9-go

If apt-get won't find your desired version you might consider downloading it directly from https://golang.org/dl/

bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
February 25, 2018, 02:22:19 PM
Merited by DarkStar_ (2)
 #7

Thanks bob123, the direct download worked at the end:

So I've just managed to install the necessary GO languange on the Raspberry PI, using these guides (had to combine them to get it to work, but at last it works...)
https://tecadmin.net/install-go-on-debian/#
https://stackoverflow.com/questions/48348262/install-go-golang-on-raspbian

To make it easier for you, here are the steps:
1)
Code:
sudo apt-get update
sudo apt-get -y upgrade
2)
Code:
wget https://dl.google.com/go/go1.10.linux-armv6l.tar.gz

make sure you download the arm version for the Raspberry

3)
install an old version of GO

Code:
sudo apt-get install golang

this will install the 1.7 version, which is not good for us yet

4)
Uncompress the previously downloaded 1.10 version into your (pi) home directory

Code:
sudo tar -C /home/pi -xzf go1.10.linux-armv6l.tar.gz

5)
remove the old golang installation

Code:
sudo apt remove golang

remove the other unnecessary stuff after removing the old golang

Code:
sudo apt-get autoremove

6)
edit your .profile
insert these lines to let the system found your go language installation

Code:
export GOROOT=/home/pi/go
export GOPATH=$HOME/projects
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

7)
log out and log in again
check the version and the environment of your installed GO, should look like this:

Code:
go version
go version go1.10 linux/arm

Code:
go env
GOARCH="arm"
GOBIN=""
GOCACHE="/home/pi/.cache/go-build"
GOEXE=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pi/projects"
GORACE=""
GOROOT="/home/pi/go"
GOTMPDIR=""
GOTOOLDIR="/home/pi/go/pkg/tool/linux_arm"
GCCGO="gccgo"
GOARM="6"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-b                                                                                                 uild470418061=/tmp/go-build -gno-record-gcc-switches"

That's all Smiley

Now moving towards to lnd installation...

Just another tip:
If you're on a fresh installation of Raspbian, you won't have the 'git' to use the golang's built-in downloader part, to be able to install Glide, which is also necessary.
So to get this command working:

Code:
go get -u github.com/Masterminds/glide

you will need this:

Code:
sudo apt-get install git

After this, you can start downloading Glide with the above mentioned command
When it's done, you'll find Glide in the GOPATH/bin
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
March 04, 2018, 11:03:13 PM
 #8

Briefing the last steps I've just managed to take:
using this website:
http://dev.lightning.community/guides/installation/
I've managed to install lnd and btcd (roasbeef's edition)
Installing lnd:
Using the few commands on the website, the lnd installation was successfull (be aware that the testing of the installation took ~30 minutes, just take this into consideration if you're in a hurry while installing)
Installing btcd
It was also really simple, using the command on the above mentioned websites.

Next steps:
Starting the installed things, especially figuring out how to create a wallet on the PI, stay tuned Smiley
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
March 17, 2018, 12:45:18 PM
 #9

The Lightning network has moved to beta, so now it's possible to officially do testing on the mainnet. Until now, most of the mainnet testing was done without support from the developers, I hope that from now on the support will help the testers.
In connection with the thread, we need to upgrade the lnd because the changes compared to the previous version are not backward compatible because of the new beta version.
nicosey
Full Member
***
Offline Offline

Activity: 347
Merit: 109


View Profile
March 17, 2018, 08:46:00 PM
 #10

Does it have to be a full node?
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
March 18, 2018, 12:28:39 AM
 #11

Does it have to be a full node?
No, my idea is to have a so called neutrino version of the lnd. This means that it only takes 200-300 MegaBytes, because it's a kind of pruned node, so it doesn't download and keep the whole blockchain on site (and does not use 200-400 GigaBytes like a full node) but it connects to some full nodes on the network.
For testing purposes, it's fine for me, if I'll take it more seriously in the future, I just attach a USB external drive with a 500Gb HDD and it can act as a full node with the full blockchain on the HDD.
delpiero10
Full Member
***
Offline Offline

Activity: 270
Merit: 101


View Profile
March 18, 2018, 12:17:01 PM
 #12

Does it have to be a full node?
No, my idea is to have a so called neutrino version of the lnd. This means that it only takes 200-300 MegaBytes, because it's a kind of pruned node, so it doesn't download and keep the whole blockchain on site (and does not use 200-400 GigaBytes like a full node) but it connects to some full nodes on the network.
For testing purposes, it's fine for me, if I'll take it more seriously in the future, I just attach a USB external drive with a 500Gb HDD and it can act as a full node with the full blockchain on the HDD.


I'm running lightningd instead of lnd but my configuration is very similar: rasperry pi 3 + external HDD for full blockchain. Everything works fine so far.
Rath_
aka BitCryptex
Legendary
*
Offline Offline

Activity: 1876
Merit: 3131



View Profile
March 18, 2018, 05:46:28 PM
 #13

I'm running lightningd instead of lnd but my configuration is very similar: rasperry pi 3 + external HDD for full blockchain. Everything works fine so far.

Could you tell me what is the CPU and RAM usage when everything you need to run a full node is turned on? Can you still use the device for browsing the Internet while everything is running in the background? I was thinking of buying the latest Raspberry Pi 3B+ but I would to know more before doing so. I don't really need a full node since I use a hardware wallet but I would like to support Bitcoin network and try running a Lightning Network node on the mainnet.
delpiero10
Full Member
***
Offline Offline

Activity: 270
Merit: 101


View Profile
March 18, 2018, 06:15:47 PM
 #14

I'm running lightningd instead of lnd but my configuration is very similar: rasperry pi 3 + external HDD for full blockchain. Everything works fine so far.

Could you tell me what is the CPU and RAM usage when everything you need to run a full node is turned on? Can you still use the device for browsing the Internet while everything is running in the background? I was thinking of buying the latest Raspberry Pi 3B+ but I would to know more before doing so. I don't really need a full node since I use a hardware wallet but I would like to support Bitcoin network and try running a Lightning Network node on the mainnet.



I'm running my raspberry in CLI mode and using it only as btc/ln node so I didn't try to browse the internet.
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
March 30, 2018, 08:31:15 PM
 #15

Because of the new beta version of LND, I've deleted the previously installed LND and BTCD from the PI and started from scratch. I would like to start a neutrino version of the LND, so according to my current understanding, BTCD is not necessary at all, but I'm not 100% sure yet. This can change in the future as I move forward with testing this thing.

Hint: if you want to start to risk your coins on the main net, you should modify the config.go file in the src directory:
Code:
		if cfg.Bitcoin.Node == "neutrino" && cfg.Bitcoin.MainNet {
str := "%s: neutrino isn't yet supported for " +
"bitcoin's mainnet"
err := fmt.Errorf(str, funcName)
return nil, err
}
If you comment these lines out (you put // at the beginning of the line) you won't have an error message  (and won't stop you) when you want to start your lnd client in neutrino mode on the mainnet.

After saving the config.go file, I have installed the new LND again (the process is the same as above, it just installs the new version).

Now I'm having issues with starting the LND, if I manage to start it (asking for wallet password), I'll post it here.
Code:
2018-03-30 22:16:18.654 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet.
delpiero10
Full Member
***
Offline Offline

Activity: 270
Merit: 101


View Profile
March 31, 2018, 05:01:19 AM
 #16

Because of the new beta version of LND, I've deleted the previously installed LND and BTCD from the PI and started from scratch. I would like to start a neutrino version of the LND, so according to my current understanding, BTCD is not necessary at all, but I'm not 100% sure yet. This can change in the future as I move forward with testing this thing.

Hint: if you want to start to risk your coins on the main net, you should modify the config.go file in the src directory:
Code:
		if cfg.Bitcoin.Node == "neutrino" && cfg.Bitcoin.MainNet {
str := "%s: neutrino isn't yet supported for " +
"bitcoin's mainnet"
err := fmt.Errorf(str, funcName)
return nil, err
}
If you comment these lines out (you put // at the beginning of the line) you won't have an error message  (and won't stop you) when you want to start your lnd client in neutrino mode on the mainnet.

After saving the config.go file, I have installed the new LND again (the process is the same as above, it just installs the new version).

Now I'm having issues with starting the LND, if I manage to start it (asking for wallet password), I'll post it here.
Code:
2018-03-30 22:16:18.654 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet.

did you run lncli create/unlock without errors?
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
March 31, 2018, 08:07:30 AM
 #17

...
Now I'm having issues with starting the LND, if I manage to start it (asking for wallet password), I'll post it here.
Code:
2018-03-30 22:16:18.654 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create wallet, or `lncli unlock` to unlock already created wallet.

did you run lncli create/unlock without errors?
No, it gave me some error, but I've managed to skip this with using the --noencryptwallet flag when starting lnd. It opens the wallet and lnd continues to start. (This leaves the wallet.dat unencrypted, but for testing purposes for the first start it's fine for me.)
Now I'm waiting for lnd to find some proper nodes, but it's struggling to find any. Maybe it's because of the beta upgrade, nodes needs to upgrade before they will be able to serve neutrino type nodes, so I'm trying to start it periodically, and also checking github, e.g.:
https://github.com/lightninglabs/lightning-app/issues/26
GameBitCEO
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
April 01, 2018, 10:17:33 PM
 #18

Really interested in that topic. Thanks for your replies
bitart (OP)
Hero Member
*****
Offline Offline

Activity: 1442
Merit: 629


Vires in Numeris


View Profile
April 11, 2018, 10:11:10 PM
 #19

So, lnd has been updated again, it's 0.4.1 now, so I thought why not to update on the PI too...
I'm writing this post because the update was not as easy as 1-2-3 (OK, maybe just for me, but anyway)
So I've logged in to the PI, and changed the working directory to the lnd source:
Code:
 cd $GOPATH/src/github.com/lightningnetwork/lnd
After, I've started the update with a git pull command, but got this error message:
Code:
pi@Lightning1:~/projects/src/github.com/lightningnetwork/lnd $ git pull         remote: Counting objects: 4, done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/lightningnetwork/lnd
   12cb35a6..bc029b9c  master     -> origin/master
Updating a0fe4fb7..bc029b9c
error: Your local changes to the following files would be overwritten by merge:
        Gopkg.lock
        config.go
Please commit your changes or stash them before you merge.
Aborting
So something has been changed locally, but I don't need those changes (I guess), so I was about to discard those changes and let the pull sync my local copy of the lnd code, but I had no clue what to do (this is my first time I've used git, so pardon me)
After heavy googling, I've found the solution here: https://techsparx.com/software-development/git/reset-local-changes.html
So I have used this:
Code:
git reset --hard
After, the
Code:
git pull
was OK, it run without any error.

My problem is that my lnd neutrino node can't find any node to connect to, so I'm still struggling with it, but somehow sometime I'll get it working...

delpiero10
Full Member
***
Offline Offline

Activity: 270
Merit: 101


View Profile
April 12, 2018, 05:23:06 PM
 #20

Quote
My problem is that my lnd neutrino node can't find any node to connect to, so I'm still struggling with it, but somehow sometime I'll get it working...

Can you upload log file? Is there any error?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!