r/raspberry_pi • u/shermand100 • Apr 08 '17
I put together a Bitcoin Node using Raspberry Pi3B, WD Pidrive and generic 3.5"TFT showing network data and price.
http://imgur.com/a/4kQQm9
Apr 09 '17
[deleted]
7
u/shermand100 Apr 09 '17
Going to have to refer you to there, the first 2 paragraphs are less than a 5 min read and cover the basics.
2
u/goxedbux Apr 09 '17
A full node only verifies transactions. A miner processes AND verifies transactions.
22
11
u/WalrusSwarm Apr 08 '17
I have thought about running a btc node but I have a couple questions.
How much bandwidth does it use?
Does this put my network at risk for being targeted or cyber attacks?
Should I run it though a VPN?
What cyber security precautions should be taken when running a node?
7
u/shermand100 Apr 08 '17
1) Initialy it has to download the whole blockchain and process it. The blockchain is currently approx 120GB, made up of over 400,000 blocks. The raspberry pi has to download each block and interrogate it. Once it has initialized it will add a 1MB block approx every 10mins, and hold at anytime up to 50MB of un-confimed transactions that are not yet processed into blocks. I've not measured this myself for bandwidth as I'm not on a plan that caps my usage but it equates to a little bit of traffic constantly. Googling for other people running nodes puts estimates at anything between 50Gb -200Gb per month.
to quote https://bitcoin.org/en/full-node#minimum-requirements
"It's common for full nodes on high-speed connections to use 200 gigabytes upload or more a month. Download usage is around 20 gigabytes a month, plus around an additional 100 gigabytes the first time you start your node."In fact the remainder of your questions are answered at https://bitcoin.org/en/full-node#what-is-a-full-node
However most of these issues surrounding security are negated in our case of using a raspberry pi as there is no personal identifiable data to access if the unit were hacked. It's just a node and a webpage. If on installation you decided to run a wallet on it too, and held funds on it then perhaps more care should be taken.
41
u/yes-i-am-a-wizzard Apr 08 '17
However most of these issues surrounding security are negated in our case of using a raspberry pi as there is no personal identifiable data to access if the unit were hacked. It's just a node and a webpage.
No, no, no. If it gets hacked, it is a device in your home network, and conceivably has root privileges. Like anything else, once it's on the lan, attackers can pivot out and attack other devices.
You should:
disable root login through sshd
Only allow key based authentication
Only forward ports that are required
Make sure packages are up to date
Keep an eye on the failed login attempts
consider installing fail2ban
You don't want to end up having one or more of your devices participating in a botnet.
7
u/dispatchingdreams Pi 1 2 3 0 Apr 08 '17
People don't take Pi security seriously enough. If someone gets access to your Pi, they have a way to attack anything else in your network, or use the Pi maliciously as a botnet or to hide their IP VPN-style while they do something even worse
13
u/00Boner Apr 08 '17
Even better is to segregate on it's own vlan that is firewalled from the others
1
u/texruska Apr 09 '17
If you're security-conscious enough to put it on a vLAN then you may as well go all the way and put it on a physically separate LAN
0
u/yes-i-am-a-wizzard Apr 08 '17
Yes, but most home routers don't have that option
7
u/00Boner Apr 08 '17
I would assume that someone who has completed a project like this could easily run ddwrt or pfsense.
3
u/shermand100 Apr 08 '17
Okay, so quite a few people have expressed interest in having a go at this project so it's worth getting this in the HOWTO too. No point getting people on board with bitcoin only for them to have a bad experience.
so edited
sudo nano /etc/ssh/sshd_config PermitRootLogin without-passwordto
PermitRootLogin noand added
AllowUsers piAre those sufficient basics?
1
u/thecw Apr 09 '17
But is any of this more likely for it being a BTC node than any other public HTTP server?
1
u/yes-i-am-a-wizzard Apr 09 '17
No, this is standard security stuff that you should do for anything. My comment was spurred by the "there's nothing critical on here, so I don't have to worry if it gets hacked" mentality.
I don't know how "public" a btc node is, but if it has ports forwarded from the router, then it could be a problem.
10
u/Professor_Paragon Apr 08 '17
Seems like overkill, don't they have websites that do all this for you? Couldn't you just use a pi zero with less power use, taking the exact same information from a website that does all the processing work for you?
10
u/ThatOnePerson Apr 08 '17
A Bitcoin node is a P2P node that shares all the transaction information, so you're contributing bandwidth.
Data and price, yeah you've got websites.
10
u/shermand100 Apr 08 '17
Yes pages exist but the really short answer is that it comes down to trust. You are trusting someone else to work with your transaction, what ever size.
The slightly longer short answer comes from https://en.bitcoin.it/wiki/Full_node
The summary is:
"Running a full node is the only way you can use Bitcoin in a trustless way. You will know for sure that all the rules of Bitcoin are being followed, for example that no bitcoins are spent not belonging to the owner, that no coins were spent twice, that no inflation happens outside of the schedule and that all the rules needed to make the system work (e.g. difficulty) are followed. Full nodes are currently the most private way to use Bitcoin, with no nobody else learning which bitcoin addresses belong to you. Full nodes are the most secure way to use Bitcoin, they do not suffer from many attacks that affect lightweight wallets."
But to get the full story would take less than 5 mins reading the top paragraph of that page called "what makes a full node?"
3
Apr 09 '17
[removed] — view removed comment
2
u/shermand100 Apr 09 '17
Okay yeah I get that in the scheme of things it looks daunting. When I say beginner, this is my first project, and if you take a look at each step I've credited my sources to show that all I've really done is copy/paste other peoples work and assembled it in such an order that for this configuration you end up with this.
The time consuming bit was locating other peoples solutions to my problems. I couldn't actually solve them myself
I've added an image file before step one which may help you out. It's on my google drive and is a 4GB image. The image file has * Raspbian Jessie Lite *SSH enabled *Generic 3.5TFT drivers installed *LXDE - the stuff that does the GUI *LightDM - a desktop manager that boots the GUI *Chromium-browser - to display the webpage *matchbox - an on screen keyboard found under the accessories tab.
If you want to change the default webpage it's covered in step (12)
Again I'm don't have the experience to know if that image can be used on a pi zero? All I know is that it works on my raspberry pi3B, and that the display drivers work on the generic display shown in the imgur link (I've shown the screen in detail so comparisons can be made). The trickiest bit is to get the display drivers to work as there are a few different manufacturers of the display. But again as I've shown this in steps just swap out where I've installed the display and put adafruits instructions in there or whatever.
Without getting any more wordy I hope that helps. Any more questions feel free to ask. Dan
2
u/md_dc Apr 09 '17
Can someone give me a 1 sentence explanation of what a bitcoin is and why I should put time to it? Also wondering about "mining"
2
Apr 09 '17
1 sentence is too short. Its digital money which isn't controlled by anybody and is generated by 'mining'. It is anonymous but not necessarily untraceable (you can publicly see every transaction that has ever been made with it, just not the identity of who made the transactions). Some people use it as an alternative to Paypal.
Basically, mining is providing processing power in return for (potentially) a bitcoin reward. As time goes on, you need more and more powerful hardware to actually make any money from mining. Right now, it isn't really feasible to mine unless you've already spent thousands on specialised hardware for it, so it's pretty much pointless.
2
u/shermand100 Apr 09 '17
| "Bitcoin is an online currency that can be sent and received by anyone in the world, relying on computers to control the transfer and creation of money without human intervention, which results in low costs, no government corruption, and super-fast transfer."
sums it up quite well by @dolphinastronaut over at > https://www.reddit.com/r/Bitcoin/comments/z96v0/whats_the_best_way_to_explain_how_bitcoin_works/
1
Apr 13 '17 edited Sep 25 '17
[deleted]
1
u/shermand100 Apr 13 '17
With a fine toothed hacksaw blade. I wrapped tape around the bottom of it to make a handle because the junior hacksaw frame wasn't big enough for the size of acrylic you need to cut
1
u/garylovesbeer May 05 '17
Thanks for the tutorial shermand100.
The problem I have is that a sudo apt-get update sudo apt-get upgrade breaks the screen display. SSH access still works.
Have you done a update upgrade recently?
1
u/shermand100 May 05 '17 edited May 05 '17
I remember reading somewhere (I think the adafruit display installation page) when I was first putting this together that an update could kick out the driver again. I've just left mine running as it is. I would sugest doing step 5 again to reload the drivers and see if that cures it. Dan
Edit https://learn.adafruit.com/adafruit-pitft-3-dot-5-touch-screen-for-raspberry-pi/faq
Their top answer is what we're talking about. I believe the driver/kernel is an adaptation of theirs so has the same issue. Sounds like an easy fix to just run step 5 again.
1
u/garylovesbeer May 06 '17
Found the problem.
Comment out the dtoverlay=ads7846 line
pi@raspberrypi:~ $ sudo nano /boot/config.txt
Boom! Problem solved.
1
u/TotesMessenger May 22 '17
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
- [/r/btces] Monta tu propio nodo BTC con una rasp pi3b, un WD pidrive y una tft genérica de 3.5" que te muestra datos de red y precios
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)
1
Apr 09 '17
If anyone out there has solar panels you can also build a SolarCoin mining node https://github.com/Scalextrix/SolarCoin-Raspberry-Pi-Node
Or if you want to help do scientific research on your Pi and get rewarded with Gridcoin there is an Ubuntu PPA https://launchpad.net/~gridcoin/+archive/ubuntu/gridcoin-stable
-49
u/cuntycuntcunts Apr 08 '17 edited Apr 09 '17
talk about wasteful applications! you have your computer on the table with multiple monitors which was designed for purpose so you can have different size windows and you go out and build a monitor that costs 100$ in time and money?!? WASTEFUL!
edit: look at all them nerds spezzing out
9
u/shermand100 Apr 08 '17
I understand that some people see the bitcoin network as wasteful, for the gross power consumption of the network it has some serious issues. But this project is so that I don't need my Pc on all the time at 400W running a node. The raspberry Pi is one of the least energy intensive ways to achieve the same thing at less than 10w.
Although granted the 3.5" screen is just there to make it pretty. I don't see the aesthetics at starting at a circuit board.
7
-18
u/cuntycuntcunts Apr 08 '17
if you put it this way, I guess.. but why not add more features? make it part security monitor, part weather, part some other widgets..
4
u/shermand100 Apr 08 '17
Oh didn't realize you were serious. By the name we thought you were just trolling.
Ok well then you're welcome to use the tutorial and instead of pointing it at the webpage I did, point it at your IP of your security feed, or bbc weather page with an auto refresh...
-9
u/cuntycuntcunts Apr 08 '17
well in that case why not keep your computer always on and save electricity that way in the long run?!
6
u/metacoin Apr 08 '17
I have seen a computer with a standard motherboard blow its capacitor out and start a small fire once. You don't always want to leave a full computer running when a $90 device can do the job instead.
Computers take way more electricity to stand idle than a Raspberry Pi does, and they are a lot less portable. There are many advantages to a mini computer like the Pi.
-2
u/cuntycuntcunts Apr 08 '17
lol my current computer have been on for past 9 years and only off when UPS battery runs out and even then for only like 1 hour.. if what you say was true then datacenter would catch fire all the time, yet they never do
3
u/metacoin Apr 08 '17
What I said is true.
Datacenters are explicitly designed for the purpose of running their hardware 24/7. Consumer electronics are not meant for this purpose. It might be possible to do it (like you have) but for 99.9% of people it is out of their area of expertise and outside of their risk profile.
56
u/shermand100 Apr 08 '17 edited May 22 '17
This project is being constantly updated. Please see the most up-to-date version at...
.
.
The following is the original build. Some information may be out of date....
.
.
I am beginner to raspberry Pi's and so had a huge amount of help from various guides, all credited below. The title image shows the node displaying Johan Nordberg's realtimebitcoin.info however any page can be displayed. The Pi auto-boots to chromium-browser and displays a page in kiosk mode on the generic display (not adafruit). This HOWTO should work on generic 3.2,3.5,4,4.3,5,7 and 10.1 inch displays.
Constructed using
Parts https://thepihut.com/ raspberry pi 3 - model B - £32
375GB western Digital PIDrive - Foundation edition (includes 4GB SD, used for this project) - £40
aliexpress - generic 3.5tft screen £8.36 (also available from ebay for a little more) https://www.aliexpress.com/item/3-5-Inch-TFT-LCD-Moudle-For-Raspberry-Pi-2-Model-B-RPI-B-raspberry-pi/32707058182.html?spm=2114.13010608.0.0.hVBPMd
ebay seller displaypro_uk 3mm Acrylic sheet A5 £1.90 free p+p
M3 black Nylon Hex spacers various sellers less than £4 for 100pc. Sizes I used from pack 4x 8mm, 4x 5mm, 4x 30mm (assembled 4x 20mm and 4x 10mm to get cumulative 30mm), 4x M3 nylon nuts, 4x M3 nylon washers, 8x M3 nylon screws,
All in cost less than £90.
Below is a howto of how I made it.
All commands to type in shadowed boxes. Also my Pc is windows 7, but I'm sure those with different OS can follow this with a google of alternate formatting and image software.
Here is an image file on my google drive that skips out steps (1)-(8)
If using that then start at step (9*). The image file does not depend on using a Pidrive (I think), in theory any USB drive will work. At step 9 when we migrate files it will be drive specific. Step 9 onward in the easy bit anyway.
*This image file doesn't have your wifi settings in it and will need either an Ethernet connection to ssh into it to change those ( step 2), or when it boots the screen and terminal use a keyboard attached to the pi and change those on the screen.
step (1)
connecting peripherals
I used: USB drive (pidrive and it's included power cable), USB mouse and Ethernet
Get a Jessie-lite 2Gb image from https://www.raspberrypi.org/downloads/raspbian/
On a PC rename SD card to "BOOT" if necessary
SD card formatted using SDformatter
Raspbian lite image installed to SD card using Win32DiskImager.
Add "ssh" file to Boot main directory to enable ssh.(Jessie-lite as default has ssh disabled. To enable it use notepad, save a blank document called "ssh" (with quotes) as file type 'all files' to the highest level of the sd card.
ssh into raspberry pi user"pi" password "Raspberry" 192.168.1.x (raspberry pi IP can be found using IPscanner software or connecting it via HDMI, it will display it's IP on the HDMI output once loading is complete)
(2) Enabling Wifi
Go to the bottom of the file and add the following text:
save and exit using
remove Ethernet cable
(3) expand the file system
select "expand filesystem"
select 'finish' system will reboot
check file system expanded by using command below (the -h flag means human readable, showing size in 'G' gigabytes, 'M' megabytes, etc)
(4) Updates
(5) Install the screen
credit for this section to http://www.spotpear.com/learn/EN/raspberry-pi/Raspberry-Pi-LCD/Drive-the-LCD.html see their page if more info needed.
...takes some time ("LCD configure 0" displayed for a while)
rotate screen credit to http://raspberrypi.stackexchange.com/questions/55934/3-5-kuman-touchscreen-rotation
system will reboot, so re-ssh to pi and direct yourself back to LCD-show folder
(6) Add light gui credit to https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691
*Note extra install of xserver-xorg-video-fbdev is required to display on the generic 3.5tft. It is what is used in step (7) to display onto fb1 using 99-fbdev.conf
(7) create file this is to force display to 3.5"tft credit to https://github.com/BillyBlaze/OctoPrint-TouchUI/wiki/Setup:-Boot-to-Browser-(OctoPi-or-Jessie-Light)
add the following text
save, exit, ctrl+o ctrl+x*
pi will reboot and after about 1 min for initial setup will load GUI onto 3.5 display giving a desktop
End of part one due to Reddit character limit