Peercoin on Raspberry Pi

Are you minting with exactly the same amount of UTXOs?
How many UTXOs?

You compiled it yourself, are you sure the optimizations are turned on?
There is a large difference when compiling with different compiler flags.

I just checked out v0.6.1ppc and make -f makefile.unix in src.

The number of utxo is more than one hundred but it hasn;t changed much.

Can you try the following makefile, it uses heavier optimization and targets the RPI2 CPU (compatible with RPI3). But if you have an RPI3, you can replace $(RPI2FLAGS) by $(RPI3FLAGS).

If you have an RPI1, we should probably figure out different flags. But you can also just remove $(RPI2FLAGS) and try if that makes a difference, because there are other optimizations already that should make a difference (removal of -g and change from -O2 to -O3)

Please let me know if you notice any difference.

If that doesn’t do much and you still want to reduce CPU load, the most effective method would be to reduce the amount of UTXOs (grouping them in larger UTXOs). A few hundred should not be too high though.

1 Like

The R-Pi I am using is R-Pi 2 model B Revision a21041. Maybe the make process can adjust according to /proc/cpuinfo in the future?

Anyway I got this error:

g++ -c -O3 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter "-mcpu=cortex-a7 -mfpu=neon-vfpv4" -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/home/pi/.ppcoin/peercoin/src -I/home/pi/.ppcoin/peercoin/src/obj -I/usr/local/BerkeleyDB.4.8/include -DUSE_UPNP=0 -DUSE_IPV6=1 -I/home/pi/.ppcoin/peercoin/src/leveldb/include -I/home/pi/.ppcoin/peercoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/alert.d -o obj/alert.o alert.cpp
g++: error: unrecognized argument in option ‘-mcpu=cortex-a7 -mfpu=neon-vfpv4’
g++: note: valid arguments to ‘-mcpu=’ are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale
makefile.rpi:180: recipe for target 'obj/alert.o' failed
make: *** [obj/alert.o] Error 1```

To fix I changed 
```RPI2FLAGS="-mcpu=cortex-a7 -mfpu=neon-vfpv4"```
 to 
```RPI2FLAGS=-mcpu=cortex-a7 -mfpu=neon-vfpv4```

After compiling I find no improvement in cpu usage unfortunately.

I just tried the 0.5.4ppc version. The CPU load is 34%.

1 Like

Hi all,

for those of you interested in a Raspberry Pi case in peercoin design, check out this peertalk thread:
Raspberry Pi enclosure in peercoin design

Hi guys, I’ve successfully installed a peerbox on my Banana PI, I know the project is closed, but if you can donate a little stuff, I’ll be very grateful for this act.
4Aq6BRXXPt9X
PJFJfzt9Fb5iZRbDyQbHwxKG1Cihg8Xehv


Thanks in advance !

Getting compiler errors, no clue why. I’ve attached a text document rather than copy/pasting since it’s rather large.

Compiler errors (16.8 KB)

Haven’t looked at your logs, but did you use the Jessie version of the OS. The newer ones have known issues.

I didn’t. I just grabbed whatever the raspberry pi page had available. Well, looks like I’m starting from scratch!

cant open the error log

It’s .dms format for the default writer included in Raspbian, you should be able to open it with any text editor, works in Word.

Either way, I’ve installed Jessie and it’s been compiling for a couple hours now. It’s definitely gotten past the point where I encountered the error so I think it will finish OK.

One thing I’m not sure of, will there be a desktop shortcut generated for Peercoin?

No luck, got compiler errors after 3 hours.
Here’s a text file.
Errors.txt (33.8 KB)
To clarify, I followed these instructions:

gcc-4.9, I would try to upgrade to at least 5.x

Via the install command I assume?
I ran the dist-upgrade command beforehand and nothing was listed as being outdated

yes, I have tested 5.4 and 7.x works

you might run out of memory because there wasn’t enough swap space.
this is my procedure to compile headless peercoind/ppcoind after downloading the source code

echo installing ufw firewall...
echo You can open the firewall manually by typing sudo ufw allow 9901
sudo apt-get -y install ufw

echo disabling ipv6 in ufw...
cd /home/pi
sudo cat /etc/default/ufw > ufw
sed -i '/IPV6=/d' ufw
echo "IPV6=no" >> ufw
sudo mv -f ufw /etc/default/ufw
sudo chmod 644 /etc/default/ufw
sudo chown root:root /etc/default/ufw

echo configuring ufw...
sudo ufw --force enable
sudo ufw allow 22/tcp
sudo ufw status verbose

sudo apt-get update

sudo apt-get -y upgrade

sudo apt-get -y install checkinstall subversion git git-core build-essential

sudo apt-get -y install libssl-dev libdb++-dev libminiupnpc-dev

sudo apt-get -y install libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libcurl4-openssl-dev

sudo ln -s /usr/lib/libminiupnpc.so.5 /usr/lib/libminiupnpc.so.10

sudo dd if=/dev/zero of=/swapfile bs=64M count=16 #provide some extra swap partition to speed up compilation time
chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

cd src
make -f makefile.unix
strip ppcoind
chmod 755 ppcoind
mkdir ~/.ppcoin
cp ppcoind ~/.ppcoin

sudo swapoff /swapfile
sudo rm /swapfile

I’ve increases the swap size hoping that will fix it. I ran the compile command via a remote ssh session. How can I check whether or not it succeeded?
I didn’t upgrade gcc for now … apparently it was going to take up 1GB to do so ?!?

you can make -f makefile.unix 2>&1 | tee log
so all messages have a copy in file log.

the compilation takes more than 1G of mem.

My Pi only has 512mb ram. Should I be setting the swap at 1024mb?

I’m about to throw the towel in and just use my Pi 2 and upgrade my OSMC to Pi 3 …

This is taking way too much effort than it should