r/Bitcoin • u/Stadicus • Nov 22 '18
Beginner’s Guide to ️⚡Lightning️⚡ on a Raspberry Pi
https://github.com/Stadicus/guides/blob/master/raspibolt/README.md
702
Upvotes
r/Bitcoin • u/Stadicus • Nov 22 '18
82
u/Stadicus Nov 22 '18 edited Dec 12 '18
I love to tinker and build stuff. I am also fascinated with digital currencies, so I built my own Bitcoin / Lightning Full Node with a simple low-cost Raspberry Pi. I now basically run my own bank using free open-source software and some cheap hardware.
This project was as much about the learning process as about the result. And I think I succeeded: I learned a lot and my node runs very well. This guide is my attempt to share my learnings and encourage you to run a node yourself.
You can follow me @Stadicus3000 on Twitter for updates.
17
u/[deleted] Nov 23 '18
I cannot emphasize enough how useful this guide has been in my learning curve on how bitcoin and lightning works.
It makes for a very nice hobby building up your own RPi node.
Thank you /u/Stadicus !
4
u/crypt0lover Nov 24 '18
You are the real MVP bro, I will try to setup a node following your guide and if i have free time can help you with the web interface. It will be a pleasure for me to give back to the community
3
u/Nursing_guy Nov 23 '18
Is this updated then? I've been using a previous version of this guide and have been having a lot of fun troubleshooting the outdated bits, but I got to some part where the macaroon protocol and have had to set it down for a bit to handle the other parts of my life.
3
u/Freeman001 Nov 25 '18
What kind of income are you seeing on this node?
3
u/catjewsus Nov 25 '18
We need a guide on setting up the most simple diy LN kit with lowest cost hardware possible. I know the raspi is cheap as it is, but there are cheaper dev boards out there, and I'm curious how cheap we can get a new lightning node made for.
3
u/whiteleppard Dec 12 '18
There's nothing mentioned in this guide about the public IP that I need to obtain from my ISP for LN-node to successfully function on my raspberry PI...
2
u/AAAdamKK Nov 23 '18
I'm considering buying a pi 3 to setup my own lightning node but I would also want to install pi-hole to block adds on the network level. Has anyone else done this or does anyone know whether the pi 3 will be able to handle this?
2
u/beinardus Nov 23 '18
Is txindex still required?
This issue was already solved in april:
https://github.com/lightningnetwork/lnd/pull/751/commits
2
u/ivanxuu Nov 26 '18
Is required to set a static port (8333) in the router?
I know it's not required for bitcoin core, but is it for LN?
Reason: I don't have access to the router
2
u/cryptoceelo Nov 26 '18
rpi and closed source driver binary blobs === something you shouldnt use to host money
2
u/[deleted] Nov 26 '18
This is awesome, thank you so much for putting in the work here. I plan on going through this using an attached HDD and a raspberry pi case that encloses it! Has anyone dockerized any of this work? (sorry if I missed it, I haven't read the entire guide yet).
2
u/trousercough Nov 27 '18
How does it handle power cuts? Does it corrupt anything or will it just fire back up, sync everything and resume as normal without any user interaction when the power comes back on?
2
u/Purplepunch36 Nov 28 '18
Read through this whole tutorial. Super detailed but kinda goes above my head. I would love to set up a node on a Pi, maybe if I have a good amount of time to really sit there and go through everything I could accomplish this. For now, I'm such a noob when it comes to programming anything like this.
2
u/[deleted] Nov 29 '18
So I had this working for about 6 months now. Originally on Bitcoin Core 0.16 then upgraded to 0.16.3 and that was fine.
I have now upgraded to Bitcoin Core 0.17.0.1 and I understand that the RaspberryPi needs to verify blocks again.
The github notes it could take a few hours but my sync has been at 0% for around 3 hours now
2
u/[deleted] Dec 05 '18
When will this be available outside “testnet”? In your opinion, what is holding Lightning back from being used? I understand Segwit is only 45% after 1.5 years. Is Lightning 1 year away? I know corporations and employers would love micropayments to ensure they get maximum profits. If adoption isn’t there peer to peer cause HODLers refuse to use it; than corporations will be the ones to make adoption. HODLers don’t get it that bitcoin and Lightning work at any price. We don’t care about price!; just private, fast, censorship resistant transactions.
We read a dev blog saying “There are 7 decimal places that we can use while speculators go nuts”. Than they went too technical to follow but we are glad devs are bypassing HODLers and aren’t allowing them to hold back the technology. Bitcoin at a $1 works the same as bitcoin at $100. We will keep funding devs so they don’t get discouraged cause their technology they spent so much time on is sitting on the shelf.
Devs are the reason we believe in this payment protocol. Without these great minds, bitcoin is useless. Please stay with bitcoin. These speculators will tire out eventually to the next big thing.
2
u/FederalCarob Dec 06 '18
I used a Raspberry Pi 2, is it bit faster than latest version?
2
u/10K9k3dXmJ86Xq5j Dec 09 '18
Is anybody running any stats on which operating system is the most common for bitcoin wallet users? I would guess it's Android followed by Windows. No development on lightweight LN wallet for Windows though it seems.
2
u/jmfronsee Dec 09 '18
Dumb-arsed-noob question. Does this get you coins in any way? Any financial benefit? Benefits other than being awesome & helping the network by running a full node & doing your crypto duty?
2
u/nolimitzman0 Jan 02 '19
I have another question about this node. From a total node newbie. Making one like this, is it any less useful to the network? Or is a “node a node” so to speak? If I built one with a more powerful computer somehow would that be able to handle more transactions or something.
12
u/CBDoctor Nov 23 '18
Another guide:
https://github.com/rootzoll/raspiblitz
8
u/wintercooled Nov 23 '18
Good to see this surface again :-)
I've developed a little node monitor website/tool for the Pi that people following this might find useful...
It creates a web page served by the RPi that can be accessed by any machine on your local network. It reports on bitcoin and lightning node status. Based on c-lightning but can be amended to use LND easily.
Here it is explained a bit more (written in Python and uses Django): https://github.com/wintercooled/NodeMonitor
5
u/greeniscolor Nov 23 '18
I followed your guide a few month ago and it works. thanks for the guide again (งツ)ว
4
u/Kizoshi Dec 07 '18
!lntip 5000
1
u/It_is_certain Nov 27 '18
If I follow this from step 4 on, can I use it with a normal Ubuntu installation too?
1
u/PinochetIsMyHero Nov 28 '18
How bad is it on a Pi Zero?
1
u/HuitlacocheBanana Dec 10 '18
Has anyone else experienced issues getting RaspiBlitz to boot?
I have a pi3B that boots other images just fine but when I boot raspiblitz it always locks up somewhere along the line. No errors are seen, just stops...
I have re-downloaded the image on two different machines, one Win10 one OSX, burned the image to SD on both machines, tried 3 different SD cards (2 verified working with other images)...
I am running out of ideas here...
Also, it doesn't even lockup at the same spot each time. Seems to be very random. Sometimes early on in boot and sometimes toward the end...
1
u/beinardus Dec 23 '18 edited Dec 23 '18
u/Stadicus I think there are some problems with the configuration of Tor in your guide:
According to the Tor site, i should just change "stretch" to "jessie". And when i do so, i can finish the installation with no problem. But when i test the version, it still shows the old 0.2.5.16 version. I build a 0.3.4.9 version using these instructions:
https://www.instructables.com/id/Anonymously-Browsing-With-Tor-installation-at-the-/
And then
i copied the tor executable over the version in /usr/bin.Read the README file in the tar:
./configure && make && make install
The directory structure is a little bit different. The config file is located in /usr/local/etc/tor and has to be renamed from torrc.example to torrc
1
u/Haso_04 Dec 31 '18
Happy New Years :)
Nothing like starting 2019 with that sense of having implemented my own full node and establishing some monetary sovereignty. Said it before while I was part way through - fantastic guide.
And as a guide I appreciate it has that balance between making progress with limited context. I’m just more curious now and after that further detail/context.
Not sure if something like this exists yet or is even relevant (and maybe the link below answers my questions) but I’m after something to give me further conceptual grounding and detail in how it all works.
http://dev.lightning.community/guides/
Eg, Have a clear conceptual view of the Linux file structure for holding all the necessary bitcoin backend and Lnd data/files
How to create/manage the Security certs and config files
Processing - ie what happens to the files/data structure when say:
Wallets are creates Peers connected/disconnected Channels opened/closed Transactions made Debugging tracking transactions and issues
Thinking about it, im probably after something similar to Andreas’s “Mastering Bitcoin” hehe but I’d guess for the moment it’s probably a matter of investigating various docs/links/material (including using the link above) to build up that picture.
3
u/FortuitousIdiom Nov 23 '18
Legit. Will start this next week, thanks!
3
u/Scarras86 Nov 26 '18
Thank you so much!!! I couldn't get my node running for more than a few hours at a time due to the initial sync and timeouts. You have inspired me to give an Rpi node another shot. Faith in r/Bitcoin restored
3
u/ctrlbreak Dec 05 '18
!lntip 1000
3
u/nolimitzman0 Dec 07 '18
What kind of internet bandwidth does this consume? Any affect on other devices?
Sorry for probably silly newb question. I’m currently into mining never considered a node but this guide has me thinking I have a new tinkering project to try...
3
u/[deleted] Dec 13 '18 edited Dec 13 '18
I run a bitcoin node on a raspberry pi, its all through the command-line, so once the daemon is running there is nothing to see. I was wondering if there is some kind of interesting display/ stats screen/ front end/ visualization/ dashboard/ graphs to see what was going on under the hood just to make it more visually appealing
3
u/janediscovers May 02 '19
I love Raspberry Pi for all the creative hacks it is able to handle.
This is a brilliant use of the device. Thanks for sharing the guide, Stadicus.
2
u/DavidCBlack Nov 26 '18
Amazing, well done. I shared your link.
2
u/Visayas8 Nov 27 '18
Woop
2
u/GonzosWhiteShark Dec 05 '18
In the process of building one on a 3b+ with 7" screen and 1TB HDD.
Hit a wall on power of all things... The 2.5A supply that came with the case I bought just isn't quite cutting it. Can't seem to get all the way through startup.
But I have a 3.5A showing up tomorrow... Excited to get this thing moving.
I know it's not going to make me a ton of money but it's a fun project and nice to be a part of something beneficial.
2
u/idiotdidntdoit Dec 07 '18
I just may have to try this. Will you leave it up until after New Years?
2
u/charlespax Dec 07 '18
!lntip 1000
2
u/ReilySiegel Dec 07 '18
!lntip 1000
2
u/Rattlesnake_Mullet Dec 08 '18
!lntip 100
2
u/52edc Dec 10 '18
Great job!
2
u/laddieri Dec 10 '18
Great guide! Easy to follow! !lntip 500
2
u/Rellim03 Dec 13 '18
Another example of the interesting and awesome things people do. Thank you.
This all adds to the network effect
2
u/beinardus Dec 15 '18
Finally finished this great tutorial. It really improved my Linux skills and understanding of the LND API.
I ran in problems with an USB powered drive. Experienced several disk corruptions probably due to the 2A power supply that was shipped with the Raspberry.
I don't know if a bigger power supply is the solution. Instead i switched over to an old hard drive with its own supply.
Mounted a NTFS formatted drive (using NTFS-3G), so no need to copy 200GB over the network:
https://raspberrypi.stackexchange.com/questions/32890/how-to-mount-ntfs-drive-on-a-raspberry-pi-b
I would strongly recommend to back up all of the files installed to the Raspberry including the blockchain.
2
u/ri0tist Dec 20 '18
Thanks for this have been wanting to build something with a Pi. This is perfect.
2
u/Haso_04 Dec 25 '18 edited Dec 25 '18
Awesome guide. I’m so close but keep getting the following for both testnet Starblocks and Y’alls:
“attempt to send payment failed...temporary channel failure”
And
“attempt to send payment failed...unknown NextPeer”
Anyone had the same issue?
2
u/Haso_04 Dec 29 '18
The Bonus section for Shango is great. Might possibly be worth having an option to connect to Testnet as the cli for the QR generation references mainnet.
2
u/blanquefort Jan 24 '19
!lntip 1000
Thnx for perfect guide. I enjoyed building my own bank :-).
1
u/TuringPerfect Nov 25 '18
On my to do list
1
u/skijak Dec 05 '18
Anybody know how to make a raspberry pi bitcoin ticker?
1
u/bcpv Dec 09 '18
Thanks for the guide !lntip 100
1
u/Cryptoliv Dec 11 '18
Cool stuff!
1
u/Cryptoliv Dec 11 '18
Wanchain Launched as well its 3.0 version-Cross-chain with Bitcoin! Very good stuf!
1
u/trigeralex Dec 14 '18
Good day sir so how do I get registered on the bit coin business so that I can be a testimony to others
1
u/caspertheghost100 Dec 15 '18
cool, i toe the line
1
u/Themillionthsub Dec 16 '18
!lntip 1000
1
u/alsomahler Dec 18 '18
!lntip 5000
1
u/Seisouhen Dec 18 '18
This is awesome, just some quick questions, so I can relay transactions when this is setup right, also can I push transactions from my own node using this, furthermore what's the difference to this and Thundroid?
1
u/spookiestevie Dec 20 '18
Hi, My Raspberry pi b+ is connected via Ethernet for me to ssh into. I can do this successfully however when I try to do a sudo apt-get upgrade, the putty connection dies. You can see a more detailed view of the problem in the gyazo. >>
https://gyazo.com/4a8c0c8e9e5109d066fb7d6503a75589
Any kind of help would be awesome
rpi b+ running on raspbian stretch lite
1
u/Septem_151 Dec 31 '18
/u/Stadicus , When copying over the mainnet chain, there are 3 folders in the data directory. One is “blocks”, another is “chainstate”, and the last is “indexes”. I do not see this referenced in the guide, nor do I see it in your screenshots for the guide. My question is, should I also transfer the “indexes” folder from local machine to the pi as well? I’m assuming yes, since this most likely contains txindex information which was stated as being required. However I’m not sure if this is simply because of a new organization structure that Bitcoin-qt recently implemented or not (since there was a recent release). I’ve also posted this question as an issue on the GitHub repository here . Cheers! !lntip 42
1
u/Haso_04 Jan 17 '19 edited Jan 17 '19
Anyone been able to implement the Auto Unlock feature? My node just enters a failed state each time.
If I back out the changes it fires up fine, but I obviously still have to manually unlock the wallet.
Edit: for what it’s worth it seems to be when I add this line to the lnd.service file under Execstart:
ExecStartPost=+/etc/lnd/unlock
I get the following error Lnd.service: control process exited code=exited status=203
1
u/pharmecist Apr 08 '19
!lntip 1000
0
u/CryptoBrandon Dec 19 '18
Top trading platform BitMax.io and data service platform COVA reached a strong alliance. Heard that there will be many activities and wellbeing of users@r/BitMax, welcome to use my invite link: https://bitmax.io/#/register?inviteCode=PDNU3S4G
-1
u/caspertheghost100 Dec 16 '18
cryptotrunks.com
-7
u/Shniper Nov 23 '18
But the lightning network is such a joke of an idea
The whole point of crypto was the be a self technology not requiring third party tools to Mae it actually work
So you built a third party tool to make it actually work
Good job
0
u/[deleted] Nov 24 '18
[deleted] — view deleted comment
0
u/[deleted] Nov 25 '18
[deleted] — view deleted comment
0
u/[deleted] Dec 06 '18
[deleted] — view deleted comment
0
u/[deleted] Dec 10 '18
[deleted] — view deleted comment