# 2 BTC bounty for improving performance of Bitsquare on Raspberry Pi

**URL:** <https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295>\
**Category:** Uncategorized\
**Created:** [July 11, 2016, 9:54pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295 "2016-07-11T21:54:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [July 11, 2016, 9:54pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/1 "2016-07-11T21:54:08Z")

</div>

**Edit: Bounty [has been paid](https://forum.bitsquare.io/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/31?u=thekozitwo).**

The [previous bounty](https://forum.bitsquare.io/t/1-btc-edit-now-3-25-btc-bounty-for-bitsquare-on-raspberry-pi/209) for getting bitsquare to run on raspberry was pretty successful and got bitsquare to compile, install and run on raspberry pi. Unfortunately it runs too slow, and the bounty did not include any requirement for that.

This bounty is to improve the performance so that bitsquare will run smoothly on raspberry pi.

As I am the bounty creator I’ll be testing the scripts on my **Raspberry Pi 2 Model B**. So that’s the model it needs to work on.

**The bounty requirements:**

- _Making a script that compiles and installs (and updates) bitsquare on rpi2b (with Rasbian Jessie 4.x as OS) successfully with all dependencies and prerequisites included. (This is already done in the previous bounty, grab the script(s) needed from [that topic](https://forum.bitsquare.io/t/1-btc-edit-now-3-25-btc-bounty-for-bitsquare-on-raspberry-pi/209) and build on that… or create your own if you want)_
- Bitsquare needs to run smoothly, which means it needs to be fully usable and functional and the GUI should respond quickly. Since “quickly” may be a bit diffuse, let’s make it a requirement that the GUI updates/redraws should not take longer than 3 seconds. So if I click for example “portfolio”, it should appear within 3 seconds.
- Maybe this bounty will require some optimization of the bitsquare code itself to get it working, if so, include that patch in the install script and submit a pull request.
- The launch time should be reasonable, and syncing should not take more than 24 hours.
- The code should be open source and free so that it can be enjoyed by the entire community

**Bounty BTC address is:**  
[1LeFs5miVA6aYTr6XsqCocnC6fDycNJpWb](https://blockchain.info/address/1LeFs5miVA6aYTr6XsqCocnC6fDycNJpWb)

I can also pay the bounty as Monero if preferred.

Anyone can contribute to the bounty by sending BTC to the address above or reply that they want to pledge an amount (and pay after bounty is fulfilled). The address is secure in my cold storage.

I have transferred **1 BTC** to the address. So that is the current bounty, keep an eye on the address or the topic for new contributions.

Since we don’t know if this bounty can be accomplished or not there will be an expiration date for the bounty. If the bounty is not claimed by July 1st 2017 all funds will be returned to the identified donators or forwarded to bitsquare, or upon my discretion with input from other donators the expiration date will be extended.

---

<div class="post-metadata">

**Author:** ![mepistol](https://bisq.community/user_avatar/bisq.community/mepistol/32/39_2.png) [@mepistol](https://bisq.community/u/mepistol)\
**Post date:** [July 11, 2016, 10:12pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/2 "2016-07-11T22:12:08Z")

</div>

I added 0.5 **BTC** to this important bounty. I agree to Manfreds recommendations for bounties and let TheKoziTwo decide if the task has been accomplished to satisfaction.

---

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [July 11, 2016, 10:35pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/3 "2016-07-11T22:35:41Z")

</div>

Pinging the previous contributors in case they want to try and claim this new bounty  
@metabit  
@pteron  
@amustafa  
@robzon  
@mdpauley  
@Frederic94500  
@sainth  
@sjon  
@avgeca

---

<div class="post-metadata">

**Author:** ![ManfredKarrer](https://bisq.community/user_avatar/bisq.community/manfredkarrer/32/26_2.png) [@ManfredKarrer](https://bisq.community/u/ManfredKarrer)\
**Post date:** [July 11, 2016, 11:22pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/4 "2016-07-11T23:22:00Z")

</div>

Please note that you can disable animations under Settings, so popups are displayed without animation which causes slow rendering on weak machines.  
I added 0.5 BTC as well.

---

<div class="post-metadata">

**Author:** ![mdpauley](https://bisq.community/user_avatar/bisq.community/mdpauley/32/103_2.png) [@mdpauley](https://bisq.community/u/mdpauley)\
**Post date:** [July 11, 2016, 11:33pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/5 "2016-07-11T23:33:10Z")

</div>

I’ll start looking at this and pick up a rpi B in the morning.

---

<div class="post-metadata">

**Author:** ![Frederic94500](https://bisq.community/user_avatar/bisq.community/frederic94500/32/97_2.png) [@Frederic94500](https://bisq.community/u/Frederic94500)\
**Post date:** [July 12, 2016, 4:12pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/6 "2016-07-12T16:12:36Z")

</div>

Hello,

I don’t know where is the problem of optimisation but I think if we add some memory in the application, maybe the problem is resolved.

And, I don’t have a raspberry pi to test my Script so can you test for me?

[Github](https://github.com/Frederic94500/Script_Bitsquare)

---

<div class="post-metadata">

**Author:** ![maehdrescher](https://bisq.community/user_avatar/bisq.community/maehdrescher/32/131_2.png) [@maehdrescher](https://bisq.community/u/maehdrescher)\
**Post date:** [August 5, 2016, 10:52am UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/7 "2016-08-05T10:52:50Z")

</div>

As suggested by Frederic94500 I tried the obvious idea to increase heap memory allocation pool with the “-Xmx” switch but it didn’t help, it takes still 10+ minutes to start. It’s kind of funny that during this start phase both the CPU load and RAM usage are quite low, so one wonders what’s acutally going on here. Maybe OpenJFX is just very lame for ARM arch. respectively the Pi… will take further look within the next days.

---

<div class="post-metadata">

**Author:** ![ManfredKarrer](https://bisq.community/user_avatar/bisq.community/manfredkarrer/32/26_2.png) [@ManfredKarrer](https://bisq.community/u/ManfredKarrer)\
**Post date:** [August 5, 2016, 11:09am UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/8 "2016-08-05T11:09:06Z")

</div>

I am improving performance atm in teh development branch (prob. there will be a new release soon). So if you test better use that build instead of master.

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 10, 2016, 12:09pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/9 "2016-08-10T12:09:09Z")

</div>

After some trial and error I managed to get it running relatively smoothly. I’d say within the specification, it is well usable. There might be some privacy disadvantages for now.

I used metabit’s version of the installation script as it uses the oracle java sdk which is way faster on arm. (I would give 25% of any bounty received to him, maybe he has even more performance improving ideas).

Step-by-step

- start install script and wait a long time: [https://github.com/phosphorit/bitsquare-on-raspberry-pi](https://github.com/phosphorit/bitsquare-on-raspberry-pi)
- In raspi-config set video memory to 128mb (leave opengl off as it can cause errors)
- `sudo su` # this openjfx version will run in full screen and only as root (could not yet get around that)
- start like this:  
`/usr/bin/java -Dsun.java2d.opengl=True -Xmx256m -jar /home/pi/bitsquare/gui/target/shaded.jar --useTorForHttp false --useTorForBtc false --maxConnections 6 --logLevel OFF`
- you might have to manually create a missing folder as in the error message and try again

  
 I also did this but probably not all is necessary:
- use a fast sd card
- set cpu frequency governor to `performance`
- set swap file size to 0
- use cable lan instead of wifi

Now on to some more testing and clean up.

p.s.: if someone here can pm or email metabit please do so as I don’t seem to be able.  
p.s.2.: I also disabled animations from the settings but it does not seem to stick. I really would prefer an editable config file.  
p.s.3 edited: opengl should stay turned off in raspi-config (it still works on my setup with the option alone but has little impact anyway)  
p.s.4: path corrected (no /src/)  
p.s. 5: added new script

---

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [August 10, 2016, 2:30pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/10 "2016-08-10T14:30:53Z")

</div>

I ran it, but got this error when trying to launch:

`root@raspberrypi:/home/pi# /usr/bin/java -Dsun.java2d.opengl=True -Xmx256m -jar /home/pi/bitsquare/gui/target/shaded.jar --useTorForHttp false --useTorForBtc false --maxConnections 6 --logLevel OFF Exception in thread "main" java.lang.UnsupportedClassVersionError: io/bitsquare/app/BitsquareAppMain : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:803) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) root@raspberrypi:/home/pi#`

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 10, 2016, 3:01pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/11 "2016-08-10T15:01:07Z")

</div>

odd, I will try it from a fresh image

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 10, 2016, 9:42pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/12 "2016-08-10T21:42:45Z")

</div>

@TheKoziTwo there is a java 7 version on that image so you need to choose the correct java version jdk1.8.0…:  
`sudo update-alternatives --config java`

I have created an updated install script: [https://github.com/phosphorit/bitsquare-on-raspberry-pi/blob/master/bitsquare.sh](https://github.com/phosphorit/bitsquare-on-raspberry-pi/blob/master/bitsquare.sh)

The path was wrong in the start command above (‘src’), fixed now.

---

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [August 11, 2016, 9:37am UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/13 "2016-08-11T09:37:13Z")

</div>

I launched it 15 minutes ago, but so far nothing has happened. How long did the launch take for you?

 ![](https://bisq.community/uploads/default/original/1X/af9c1b383fae2cebbb8a359c0ab527d839c4ee94.jpg)

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 11, 2016, 5:43pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/14 "2016-08-11T17:43:17Z")

</div>

It should not take longer than a minute.

Did you make yourself root? `sudo su`?

Were there any errors above the blue text? In white?

With the script above it worked for me with a fresh install with only a few commands. I will do it again and write down every step.

---

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [August 11, 2016, 6:43pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/15 "2016-08-11T18:43:37Z")

</div>

I ran it again now…

Above the blue text it says:

> Dispman: Cannot open display

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 11, 2016, 10:01pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/16 "2016-08-11T22:01:07Z")

</div>

This only works with a screen directly attached. Otherwise it sounds like you may have opengl activated in raspi-config? Contrary to what I wrote at the beginning opengl needs to be (left) deactivated in raspi-config.

Sorry you run into so much trouble. I will try to streamline things a bit more tomorrow.

---

<div class="post-metadata">

**Author:** ![TheKoziTwo](https://bisq.community/user_avatar/bisq.community/thekozitwo/32/25_2.png) [@TheKoziTwo](https://bisq.community/u/TheKoziTwo)\
**Post date:** [August 11, 2016, 11:01pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/17 "2016-08-11T23:01:18Z")

</div>

OK, I disabled OpenGL. It works now. UI updates are ok, maybe 2-3 sec. Looks very good so far, I think you may have nailed it. Good job

---

<div class="post-metadata">

**Author:** ![ManfredKarrer](https://bisq.community/user_avatar/bisq.community/manfredkarrer/32/26_2.png) [@ManfredKarrer](https://bisq.community/u/ManfredKarrer)\
**Post date:** [August 12, 2016, 10:04am UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/18 "2016-08-12T10:04:40Z")

</div>

Wow congrats guys!!!

---

<div class="post-metadata">

**Author:** ![phosphor](https://bisq.community/letter_avatar/phosphor/32/5_5575768a8748004e209b776fc1b2916d.png) [@phosphor](https://bisq.community/u/phosphor)\
**Post date:** [August 12, 2016, 11:28am UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/19 "2016-08-12T11:28:03Z")

</div>

Step by step instructions:

- start with fresh standard jessie image: [https://www.raspberrypi.org/downloads/raspbian/](https://www.raspberrypi.org/downloads/raspbian/)
- set up wifi in GUI / check LAN connection
- `sudo raspi-config` --\> advanced --\> memory split --\> 128 --\> reboot
- `git clone https://github.com/phosphorit/bitsquare-on-raspberry-pi`
- `cd bitsquare-on-raspberry-pi`
- chmod 777 [bitsquare.sh](http://bitsquare.sh)
- ./bitsquare.sh # this will take about an hour; can also be used to update bitsquare & bitcoinj
- sudo su
- ./start.sh

---

<div class="post-metadata">

**Author:** ![mepistol](https://bisq.community/user_avatar/bisq.community/mepistol/32/39_2.png) [@mepistol](https://bisq.community/u/mepistol)\
**Post date:** [August 12, 2016, 5:54pm UTC](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295/20 "2016-08-12T17:54:07Z")

</div>

It was not expected this would work, but you proved the world wrong. Congrats!!

[Next page](https://bisq.community/t/2-btc-bounty-for-improving-performance-of-bitsquare-on-raspberry-pi/295.md?page=2)
