Difference between revisions of "RaspberryPi"
From Ravencoin Wiki
Jump to navigationJump to search (Saving first bit of the guide) |
|||
Line 43: | Line 43: | ||
#*''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. | #*''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. | #*''raven-cli'': which is the command line interface for Ravencoin that you can use to send instructions to ravend. | ||
− | #Next up is starting the deamon (ravend) process to start the Ravencoin node. | + | #Next up is starting the deamon (''ravend'') process to start the Ravencoin node. |
#:<pre> | #:<pre> | ||
#::Ravend & </pre> | #::Ravend & </pre> | ||
Line 51: | Line 51: | ||
#Additionally, we are going to make a configuration file to set up ravencoin optimally for the raspberry pi. | #Additionally, we are going to make a configuration file to set up ravencoin optimally for the raspberry pi. | ||
#:<pre> | #:<pre> | ||
− | #::touch ~/.raven/raven.conf nano ~/.raven/raven.conf </pre> Enter the following script: <br /> | + | #::touch ~/.raven/raven.conf nano ~/.raven/raven.conf </pre> Enter the following lines: |
− | + | #:<pre>server=1 upnp=1 dbcache=800 maxmempool=50 disablewallet=1 logips=1 maxconnections=40 prune=42000 maxuploadtarget=5000 </pre> '''Note:''' It is important to set <code>server=1</code> otherwise you will not get incoming connections and <code>prune</code> lets your pi look at the last X MB of the chain. Adjust this value based on your SD size. <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> | ||
+ | #::Ravend & </pre> | ||
+ | # Ok, so suppose you are as impatient as I am and you want to know more about the progress of ''ravend'' downloading the block chain. To make this insightful we are going to make use a little script that I found using google and slightly adapted ([https://bitcoin.stackexchange.com/users/83847/hiding-ninja original creator]). It will use ''raven-cli'' to get information from the deamon and we will extract the most useful information from it. | ||
+ | #:<pre> | ||
+ | #::touch ~/check_status.sh nano ~/check_status.sh </pre> Enter the following lines: | ||
+ | #:<pre>#!/bin/bash count=$(/usr/local/bin/raven-cli getblockcount); /bin/echo "block count: $count"; hash=$(/usr/local/bin/raven-cli getblockhash $count); /bin/echo "block hash: $hash"; t=$(/usr/local/bin/raven-cli getblock "$hash" | grep '"time"' | awk '{print $2}' | sed -e 's/,$//g'); /bin/echo "block timestamp is: $t"; cur_t=$(date +%s); diff_t=$[$cur_t - $t]; /bin/echo -n "Difference is: "; /bin/echo $diff_t | /usr/bin/awk '{printf "%d days, %d:%d:%d\n",$1/(60*60*24),$1/(60*60)%24,$1%(60*60)/60,$1%60}'; </pre> To save: CTRL+O ENTER, To exit: CTRL+X. <br /> And to make it executable: | ||
+ | #:<pre> chmod +x ~/check_status.sh </pre> You can now use the script to check the blockchain download status of ''ravend''. I noticed that it spits out an error if ''ravend'' is still indexing the blockchain (after startup) and that the first call to it is rather slow: | ||
+ | #:<pre> ~/check_status.sh </pre> | ||
== Connections and Security == | == Connections and Security == | ||
== Final checks == | == Final checks == |
Revision as of 13:01, 27 October 2018
By Jeroz - Oct 27th, 2018
Contents
Before you start
Before you start, you will need:
- A working internet connection (cable or WIFI)
- A PC with an SD card reader
- A Mouse, keyboard, and monitor
Raspberry Pi hardware
My Pi hardware:
- $54.99, Canakit Raspberry Pi 3 B+ (Pi + Case + heat sinks + power cable)
My reasoning for this option: I rather have everything in 1 go. - $15.20, 64 GB Samsung 64GB MicroSDXC EVO Plus Memory Card.
Obviously I forgot to buy this initially (oops...)
My reasoning for this option: I chose 64GB instead of 32 to have enough room for the future.
Note: formatting a 64GB (or larger) card takes extra steps, see below
Setting up Pi hardware and OS software
- Follow the instructions that shipped with the Raspberry Pi to build it.
- Download the OS Zip file (NOOBS for beginners).
- The Raspberry Pi only reads FAT32 formatted partitions on the SD card. So you will need to format it using SD Memory Card Formatter
Note: If your SD card is 64GB (or larger), it will automatically be formatted as exFAT, which is not compatible with NOOBS. You need to force your SD card to format as FAT32 to use NOOBS[1].- Linux and Mac OS: The standard formatting tools built into these operating systems are able to create FAT32 partitions; they might also be labeled as FAT or MS-DOS. Simply delete the existing exFAT partition and create and format a new FAT32 primary partition.
- Windows: The standard formatting tools built into Windows are limited, as they only allow partitions up to 32GB to be formatted as FAT32, so to format a 64GB partition as FAT32 you need to use a third-party formatting tool. A simple tool to do this is FAT32 Format.
- 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 to the Raspberry Pi to let it boot. If you run into trouble, walk trough the 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.
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 Core Ravencoin developers, Under who is also an active developer, compiled static versions of the Ravencoin wallet/node. Static means that this version works straight out of the box for each operating system. For the Raspberry Pi, you need the ARM-linux version of Ravencoin. Open a console and use the following code:
- cd ~/ wget https://github.com/underdarkskies/Ravencoin/releases/download/v2.1.1/raven-2.1.1-arm-linux-gnueabihf.tar.gz gunzip ./raven-2.1.1-arm-linux-gnueabihf.tar.gz
- 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.
- cd raven-2.1.1/bin sudo cp ./* /usr/local/bin
- 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.
- Next up is starting the deamon (ravend) process to start the Ravencoin node.
- Ravend &
- Ravend runs entirely in the background, so you cannot see what is happening. The process will create wallet and blockchain files in
~/.raven/
. Subsequently, it will start downloading the Ravencoin blockchain. This will take forever! So, what we are going to do is stop ravend after ~5 minutes and thank Cryptoslo for sharing a link that contains 1.8GB of the blockchain already.- raven-cli stop cd ~/raven wget http://147.135.10.45/blockchains/current/Raven_blockchain.zip unzip Raven_blockchain.zip
- Additionally, we are going to make a configuration file to set up ravencoin optimally for the raspberry pi.
- touch ~/.raven/raven.conf nano ~/.raven/raven.conf
server=1 upnp=1 dbcache=800 maxmempool=50 disablewallet=1 logips=1 maxconnections=40 prune=42000 maxuploadtarget=5000
Note: It is important to setserver=1
otherwise you will not get incoming connections andprune
lets your pi look at the last X MB of the chain. Adjust this value based on your SD size.
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).
- Ravend &
- Ok, so suppose you are as impatient as I am and you want to know more about the progress of ravend downloading the block chain. To make this insightful we are going to make use a little script that I found using google and slightly adapted (original creator). It will use raven-cli to get information from the deamon and we will extract the most useful information from it.
- touch ~/check_status.sh nano ~/check_status.sh
#!/bin/bash count=$(/usr/local/bin/raven-cli getblockcount); /bin/echo "block count: $count"; hash=$(/usr/local/bin/raven-cli getblockhash $count); /bin/echo "block hash: $hash"; t=$(/usr/local/bin/raven-cli getblock "$hash" | grep '"time"' | awk '{print $2}' | sed -e 's/,$//g'); /bin/echo "block timestamp is: $t"; cur_t=$(date +%s); diff_t=$[$cur_t - $t]; /bin/echo -n "Difference is: "; /bin/echo $diff_t | /usr/bin/awk '{printf "%d days, %d:%d:%d\n",$1/(60*60*24),$1/(60*60)%24,$1%(60*60)/60,$1%60}';
To save: CTRL+O ENTER, To exit: CTRL+X.
And to make it executable:chmod +x ~/check_status.sh
You can now use the script to check the blockchain download status of ravend. I noticed that it spits out an error if ravend is still indexing the blockchain (after startup) and that the first call to it is rather slow:~/check_status.sh