Changes

Jump to navigation Jump to search
1,239 bytes added ,  11:08, 19 April 2021
|description=Building a Ravencoin full node on Raspberry Pi
}}
<div class="floatright"><img src="https://i.gyazo.com/3d630d1f995efdb8ffdd04865a6a12c0.png"><br>By [@]Pathfinder#0001</div>
''By Jeroz - Oct 27th, 2018 -- Updated by [https://twitter.com/pathfinder @Pathfinder] for v4.3.2.1''
 
''By Jeroz - Oct 27th, 2018''
== General Introduction ==
#https://www.raspberrypi.org/documentation/
#https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1
 
== Before you start ==
#Extract the NOOBS zip file and copy its contents on the memory card.
#When this process has finished, safely remove the SD card and insert it into your Raspberry Pi.
#Connect the power cable to the Raspberry Pi to let it boot. If you run into trouble, walk trough through the [https://www.raspberrypi.org/learning/hardware-guide/ Raspberry Pi hardware guide]
#If you are using NOOBS and this is the first time your Raspberry Pi and SD card have been used, then you'll have to select an operating system and let it install (Choose the default: Raspbian).
#Don't forget to set a password for login when prompted. Otherwise it is too easy for someone else to get in.
 
== A High-End RPi4 Build with SATA SSD ==
(by [https://twitter.com/pathfinder @Pathfinder])
 
If you'd like a higher-end hardware setup that's optimized for expandability and speed (microSD cards are notoriously slow), see my [https://bit.ly/smol-guide-rpi4 smol guide].
<p>
You'll end up building something that looks like this:
<br>
[https://i.gyazo.com/f0eb138514580314976a21a68b8fc68c.jpg <img src="https://i.gyazo.com/f0eb138514580314976a21a68b8fc68c.jpg" width="350">]<br>
 
My [https://bit.ly/smol-guide-rpi4 smol guide] focuses on running Urbit, but the specified hardware config is also ideal for running a Ravencoin or Bitcoin node!
<p>
 
For optimal speed and expanadabilty, I suggest using the SATA SSD as the data storage location for the Ravencoin blockchain as well as the Ravencoin binaries.
<p>
Create a directory on the SSD called <b>/media/pi/SSD/Ravencoin</b> and put the directory with the Ravencoin binaries in there.
<p>
Then create a directory on the SSD called <b>/media/pi/SSD/Ravencoin/RavencoinData</b> for the blockchain and reference it like this:
 
<p>
 
<b>To START the node:</b>
<pre>./ravend -daemon --datadir=/media/pi/SSD/Ravencoin/RavencoinData</pre>
 
<b>To STOP the node:</b>
<pre>./raven-cli -datadir=/media/pi/SSD/Ravencoin/RavencoinData stop</pre>
 
<b>To CHECK the node:</b>
<pre>./raven-cli -datadir=/media/pi/SSD/Ravencoin/RavencoinData -getinfo</pre>
 
When you're done, it should all look like this:
 
[https://i.gyazo.com/8c02cd94d8012643c2ce2ec5dc5163f7.jpg <img src="https://i.gyazo.com/8c02cd94d8012643c2ce2ec5dc5163f7.jpg" width="800">]
== Setting up the Ravencoin node - The quick way ==
Now that you got the OS running, it is time for the fun part: setting up the Ravencoin node. Normally, installing Ravencoin will take hours and syncing to the network will take days. However, I found some nice shortcuts for you.
#Instead of the repository of the The Core Ravencoin developersprovide binaries for ARM architecture, which are needed for the Raspberry Pi. The latest ravencoin core wallet binaries can be found [https://github.com/underdarkskies Under] who is also an active developer, compiled static versions of the RavenProject/Ravencoin wallet/node. Static means that this version works straight out of the box for each operating systemreleases here]. For the Raspberry a Pi, you always need the [https://github.com/underdarkskies/Ravencoin/releases a version that has ARM-linux version of Ravencoin]in its name. Open a terminal and use the following codecommands to get it:
#:<pre>
#::cd ~/ &#10;wget https://github.com/underdarkskiesRavenProject/Ravencoin/releases/download/v2v4.13.2.1/raven-4.3.2.1-arm32v7.zip &#10;unzip raven-4.3.2.1-arm-linux-gnueabihfarm32v7.tar.gz zip &#10;cd arm32v7 &#10;tar -xvzf raven-4.3.2.1.1-arm-linux-gnueabihf.tar.gz </pre> '''Note:''' Under and I just saved you hours of headaches and 2 hours of compiling!# There is no working Ravencoin GUI for the Raspberry Pi. So you will need to get everything working from the command line. I like to put binaries into my default local user binary location so that I can globally access them from anywhere.
#:<pre>
#::cd sudo cp ./raven-4.3.2.1.1/bin &#10;sudo cp ./* /usr/local/bin </pre> Two files in this directory are important:
#*''ravend'': which is the Ravencoin deamon, a program that implements the Ravencoin protocol for remote procedure calls (RPCs). In simple terms: it will run a wallet/node as a background process and you can send instructions to it.
#*''raven-cli'': which is the command line interface for Ravencoin that you can use to send instructions to ravend.
#:<pre>
#::ravend & </pre>
#OPTIONAL: Ravend runs entirely in the background, so you cannot see what is happening. The process will create wallet and blockchain files in <code>~/.raven/</code>. Subsequently, it will start downloading the Ravencoin blockchain. This will take forever ('''Unfortunately, this may take over a week''')! So, what we are going due to do is stop ''ravend'' after ~5 minutes and thank [https://www.youtube.com/channel/UCTGFgr_1P8jdiM1Xend0ELw/featured Cryptoslo] for sharing a link that contains 1.8GB the cpu speed of the blockchain alreadypi. <br />'''Disclaimer:''' I decided More advanced users may want to trust this source at the moment of this writingcopy a pre-verified blockchain (i. It saves a lot of timee. However, if you rather go for maximum security skip this stepa bootstrap) from their PC and copy it to their Pi.#:Make sure to stop ravend first (<precode>#::raven-cli stop &#10;cd </code>) before moving all blockchain files to <code>~/.raven &#10;wget http://147.135.10.45/blockchains/current/Raven_blockchain.zip &#10;unzip Raven_blockchain.zip </precode>.
#Additionally, we are going to make a configuration file to set up ravencoin optimally for the raspberry pi.
#:<pre>
#::touch ~/.raven/raven.conf &#10;nano ~/.raven/raven.conf </pre> Enter the following lines, and adjust user/login settings accordingly:
#:<pre>rpcuser=rpcuser #optional &#10;rpcpassword=SETYOURPASSWORDHERE #optional &#10;rpcallowip=IP_ADDRESS_OF_HOST_YOU_ACCESS_RAVEN-CLI_FROM 127.0.0.1 #optional &#10;serverdaemon=1 &#10;upnp=1 &#10;listen=1 &#10;dbcache=800 &#10;maxmempool=50 &#10;disablewallet=1 &#10;logips=1 &#10;maxconnections=40 125 &#10;prune=42000 &#10;maxuploadtarget=5000 &#10;server=1 </pre> '''NoteNote1:''' It is important If you are are planning to set <code>server=1only access your node from your pi itself, skip the first 3 optional settings <br /code> otherwise you will not get incoming connections and <code>prune</code> lets '''Note2''': Opening up the RPC port to hosts outside your pi look at local trusted network is NOT RECOMMENDED, because the last X MB of rpcpassword is transmitted over the chain. Adjust this value based on your SD sizenetwork unencrypted. <br /> To save: CTRL+O ENTER, To exit: CTRL+X.
#Now you can start start ravend again to index the blockchain that you downloaded and to download the remaining bit (which may still take a day depending on your connection).
#:<pre>
== Connections and Security ==
First, if you are connecting your Pi with the internet trough through WIFI (and not an UTP cable), it is important to know that Raspbian power management turns off wifi after a couple of hours idling. Obviously, we don't want that to happen so you need to turn of WIFI power management (and ensure everything is up to date, which seems to have fixed some wifi problems I was having): <pre>sudo apt-get update && sudo apt-get -y dist-upgrade &#10;sudo iwconfig wlan0 power off </pre>
Ok, now that the blockchain is downloading, we are going to work on listening ports (to contribute to the Ravencoin network) and security.
# To make sure the necessary ports are open in your Raspberry Pi: <pre>sudo iptables -A INPUT -p tcp --dport 8767 -j ACCEPT &#10;sudo iptables -A INPUT -p udp --dport 8767 -j ACCEPT</pre>
# You also need to set port forwarding in your router. The necessary steps to do this differs per router and therefore I need to refer you to the manual of your router. Be sure to forward the port to the IP address of your Raspberry Pi and the port you are forwarding is 8767. You can find the IP address using the <code>ifconfig</code> command. It is either <code>192.168.X.X</code> or <code>10.0.X.X</code>.
#Next, we are going to install ''Uncomplicated Firewall'' (''ufw''). As mentioned in the introduction: this is highly recommended because you are opening a port to the outside world and you want to make sure it is only used for Ravencoin: <pre>sudo apt -get install ufw</pre> '''Note:''' ''ufw'' default rules allow for all outgoing connections, but block all incoming connections. <br /><br /> '''Optional:''' If you plan on using SSH to access your raspberry pi, make sure that ssh access is allowed (but limited): <pre>sudo apt install ufwlimit ssh</pre> '''Optional:''' You might want to add a few more limitations on ssh. For example if you’re planning on accessing your node from local network only. Depending on your local network: <pre>sudo ufw allow from 192.168.1.0/24 to any port 22</pre> Or <pre>sudo ufw allow from 10.0.0.0/24 to any port 22</pre> And/or if you have a dedicated static IP, for example: <pre>sudo ufw allow from 16.32.64.128 to any port 22</pre>
# To allow Ravencoin traffic: <pre>sudo ufw allow 8767 comment 'Ravencoin'</pre> You can preview the results using: <pre>sudo ufw status verbose &#10;&#10;Example output: &#10;To Action From&#10;-- ------ ----&#10;22/tcp LIMIT IN Anywhere&#10;8767 ALLOW IN Anywhere # Ravencoin&#10;22/tcp (v6) LIMIT IN Anywhere (v6) &#10;8767 (v6) ALLOW IN Anywhere (v6) # Ravencoin </pre>
# Enable Firewall: <pre>sudo ufw enable</pre>
Connections using port:8767 on the left side are incoming connections.
== What to do to after a reboot ==
I did not take you through steps that would make the node automatically start when you (re)boot your Raspberry Pi. In the case this does happen, execute the following commands to get everything back up: <pre> sudo iwconfig wlan0 power off &#10; ravend & </pre>
If you do like to have these commands executed during startup, you can follow the example given [http://thelowercasew.com/disabling-wifi-power-management-permanently-for-raspberry-pi-3-with-raspbian-jessie here], you only need to add an extra line <code>ravend &</code> in step 3.
And there you go, a full node on a Raspberry Pi! :)
Thanks to [@]unclear#0122, [@]Name#8397 and [@]Mapple#3283 (Discord handles) for giving valuable feedback. And [@]Under#7846 for sharing some thoughts on the static release and configuration settings.

Navigation menu