Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bisq works fine on Raspberry Pi, though there are issues and some patches are required #2861

Closed
leshik opened this issue Jun 3, 2019 · 32 comments

Comments

@leshik
Copy link
Contributor

leshik commented Jun 3, 2019

Hi,

I was able to run Bisq on Raspberry Pi (3B+ in my case) successfully, but I had to patch some libs:

  1. netlayer and tor-binary (most important.) There is no official port of TOR for armhf, but there is an ongoing effort and unofficial builds are published on sourceforge. My patches (not perfect, I know) are here and here.
  2. scrypt transient dependency – while it falls back to native Java implementation, it is slow as hell, thus native support is needed (it's 7 times faster), the patch is here.
  3. the Bisq itself gradle build scripts to use these patched versions – here.

There is no jpackager for ARM thus Bisq should be launched from command line using several options. I tried Bellsoft JDK build 10.0.2 and Zulu JDK 11.0.3, both with Gluon JFX 11.0.2. It works with Monocle embedded platform as well as with GTK frontend.

There are some issues with popup windows (which show notices and help messages), sometimes they are just black rectangles, but minimizing then maximizing helps, it's unclear why. The Monocle platform draws windows directly on Pi hardware on top of X, thus no window manager support (but should be faster as it uses the prism es2 pipeline).

The speed is, well, not fast, but I can't say that it's unusable – after the initial sync it can be used fine. In my opinion on Zulu JDK 11 it's faster, though I didn't conduct any benchmarking.

Is anybody interested or willing to try Bisq on RPi? Not sure if it's worth the effort...

@huey735
Copy link
Contributor

huey735 commented Jul 4, 2019

Hi, @leshik I'd like to try it but I think I have knowledge enough to install it. Would it be more difficult than a Raspiblitz?

@leshik
Copy link
Contributor Author

leshik commented Jul 5, 2019

@huey735 well it's not user-friendly nor production ready at all for now. You can either checkout and build v1.1.1-arm branch from my repo, either try to apply gradle patch to the current. You can build on any platform, building on RPi itself is not required. Then you run jar file manually as described here, either with Monocle or GTK frontend (both work on RPi, but only GTK integrates nicely into Raspbian desktop).

@freimair
Copy link
Contributor

freimair commented Jul 13, 2019

@leshik well thanks for your contribution! I only got aware of your work now.

Being responsible for the netlayer-part of Bisq (and having an always-up RPi3 at home) I have been thinking about getting tor for arm as well. For Bisq we need to discuss and decide on whether unofficial builds are ok (or if we can build for arm ourselves). Would you, in the meantime, file a pull-request for netlayer (external-tor branch)/tor-binary?

ad if it is worth the effort: well, as Bisq has an API coming up, I can see a real use case in having a "headless" Bisq running on a low-power, always-on device and using the API to control Bisq from a mobile device for example.

@leshik
Copy link
Contributor Author

leshik commented Jul 14, 2019

@freimair yeah, looks like for now, the only way to get tor working on arm is to use these unofficial binaries. Starting from v8.5, they added arm64, I have to redo my patches then.

Another thing is scrypt, and while it falls back to Java implementation when no C library is found, it's 7 times slower. I have to adapt it to both armhf and arm64 too.

@leshik
Copy link
Contributor Author

leshik commented Jul 18, 2019

@freimair I've created pull-requests for netlayer and tor-binary. My fork of scrypt with support of armhf and arm64 is here.

@wiz
Copy link
Contributor

wiz commented Jul 19, 2019

@leshik Thanks for your notes and patches in this issue, they were very helpful. I'm currently writing a guide to setting up Bitcoin, Lightning, etc. on a RPI4 and I hope to include Bisq in the guide as well, so I'd like to work with you on merging any necessary ARM related patches if I can help in any way. I actually hacked together a virtual frame buffer to run Bisq in, with a mobile VNC app to remote into the RPI and control Bisq, we should compare notes ;)

@OrfanMiner
Copy link

Hi @leshik I have spent a few days tearing my hair out trying to get bisq working on a rpi4. I compiled from your source code on my mac (had to skip the testing because it would make it fail). Transferred over the RPI4, followed the java guide, but still no cigar. I probably shouldn't be posting this here so apologies if it's the wrong place.

@leshik
Copy link
Contributor Author

leshik commented Jul 20, 2019

@OrfanMiner I only have RPi 3+ but it works ok for me. How do you launch it? Bisq has quite detailed logs, it should print to stdout/stderr what's happening. Would you mind to share logs?

@leshik
Copy link
Contributor Author

leshik commented Jul 20, 2019

@jmaurice

I actually hacked together a virtual frame buffer to run Bisq in, with a mobile VNC app to remote into the RPI and control Bisq, we should compare notes ;)

You mean, Xvfb with traditional VNC to make it headless? I thought about it but didn't experiment yet as I think it should work the same way as with the HDMI screen. What might be interesting is to make JavaFX render directly to RPi hardware with Monocle in conjunction with VNC. I tried dispmanx_vnc but there are issues with the mouse (cursor is hidden), also there are black rectangles instead of notifications. I'm pretty sure it's the OpenJFX issue and not Bisq though.

@OrfanMiner
Copy link

It's the last stage of the java guide you posted that fails: https://docs.gluonhq.com/embedded/

sudo /opt/jdk-11/bin/java --module-path=/opt/armv6hf-sdk/lib --add-modules=javafx.controls -cp classes/ -Dprism.verbose=true -Dembedded=monocle -Dglass.platform=Monocle sample.Main

i get the message:

GLFactory using com.sun.prism.es2.MonocleGLFactory

  • failed to add service - already in use?

when trying to run the compiled binary on my rpi4 i get:

Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline foundjava.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
(there's more but doesn't seem useful to post)

@leshik
Copy link
Contributor Author

leshik commented Jul 20, 2019

@OrfanMiner try with Liberica 10.0.2 first and GTK backend to be sure it launches, then you may experiment with jdk11 and Monocle. Here is what works 100%:

/opt/jdk-10.0.2/bin/java --module-path=/opt/armv6hf-sdk/lib -Djavafx.platform=gtk -jar desktop-1.1.1-all.jar

@leshik
Copy link
Contributor Author

leshik commented Jul 20, 2019

I can't remember now what I did (and why) to make it launch on JDK11, but in my .bash_history I found this:

/opt/zulu11.31.16-ca-jdk11.0.3-linux_aarch32hf/bin/java --module-path /opt/armv6hf-sdk/lib --add-modules javafx.base --add-modules javafx.controls --add-modules javafx.fxml --add-modules javafx.graphics --add-opens javafx.base/com.sun.javafx.runtime=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.binding=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.event=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED -Djavafx.platform=gtk -jar desktop-1.1.1-all.jar

@OrfanMiner
Copy link

Thanks for the response!

I installed JDK10 using this guide:

https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/9bb3ae09-c2f9-4e93-a579-575347a27446/File/43af450d88c87cfb08e197f50699b16a/openjdk_10_build_rpi3.txt

and end up with this error:

Error: Unable to access jarfile desktop-1.1.1-all.jar

@leshik
Copy link
Contributor Author

leshik commented Jul 21, 2019

desktop-1.1.1-all.jar is what you get in your desktop/build/libs/ folder after you build Bisq on your mac.
As for JDK10, no need to compile from sources, you can get prebuilt one from https://download.bell-sw.com/java/10.0.2/bellsoft-jdk10.0.2-linux-arm32-vfp-hflt.tar.gz

@OrfanMiner
Copy link

for some reason all i have in that folder is desktop-1.1.1-SNAPSHOT-all.jar and desktop-1.1.1-SNAPSHOT.jar. perhaps my build didn't go correctly on the mac?

@leshik
Copy link
Contributor Author

leshik commented Jul 21, 2019

Did you build from v1.1.1-arm tag?

@OrfanMiner
Copy link

yes, absolutely.

@leshik
Copy link
Contributor Author

leshik commented Jul 21, 2019

Idk then, try desktop-1.1.1-SNAPSHOT-all.jar maybe.

@OrfanMiner
Copy link

will do, thanks :)

@OrfanMiner
Copy link

I think my compile on my mac that is what's wrong. I'm a bit out of the loop with the scope of discussions on here, but feel it's probably inappropriate for me to be asking these types of questions here. Are you on the bisq slack?

@leshik
Copy link
Contributor Author

leshik commented Jul 21, 2019

yes, and also on Telegram

@wiz
Copy link
Contributor

wiz commented Jul 24, 2019

@leshik would it be possible for you to get Bisq working in Docker on Raspberry Pi ? If so, I can add the X11 virtual framebuffer VNC stuff and then we could merge the Dockerfile into BTCPay-Docker for easy setup by newbies. They could use the VNC interface to remotely access Bisq and we could get a lot more users quickly.

@leshik
Copy link
Contributor Author

leshik commented Jul 27, 2019

@jmaurice sure, I'll publish it maybe Monday or Tuesday, after the new release comes up. Just doing some testing now.

@leshik
Copy link
Contributor Author

leshik commented Jul 27, 2019

@jmaurice here is the Dockerfile, you can play meanwhile if you wish. BTW it also works on PC (x86_64.)

@leshik
Copy link
Contributor Author

leshik commented Jul 28, 2019

Tested 1.1.3 w/patches on ARM64 (Ubuntu 19.04 on Raspberry Pi 3 B+) and it works too. It has slightly greater memory consumption though. Had to add swap space, otherwise, Bisq is being killed by OOM. GUI is a true performance killer, we need to decouple API badly...

@leshik
Copy link
Contributor Author

leshik commented Jul 30, 2019

@jmaurice @OrfanMiner I've put Docker images for 1.1.4 with VNC to https://hub.docker.com/r/leshik/bisq
Supported architectures are x86_64, armhf (Raspberry Pi) and arm64. Anybody willing to test, please do and post feedback here.

@wiz
Copy link
Contributor

wiz commented Aug 5, 2019

@leshik Thanks, I am planning to add Bisq as an optional component to BTCPayServer-Docker so this is a huge help. I'll test it soon and report back

@wiz
Copy link
Contributor

wiz commented Aug 5, 2019

@leshik Actually, can you do a pull-request to Bisq to add the Dockerfile? I'd like to request that Bisq officially support the configuration of running in Docker using VNC

@stale
Copy link

stale bot commented Nov 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Nov 4, 2019
@stale
Copy link

stale bot commented Nov 11, 2019

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@tmakerman
Copy link

Just sharing - I've had success getting v1.9.6 built from source running on Raspberry Pi 4. I have a branch with tweaks for build dependencies and write-up including setting up tor hidden service to get it working...

https://gist.github.com/tmakerman/ee53a94c3cfc8362192ad9df20709547

Thanks @leshik for all the work shared which led me to the solution.

@richardalg
Copy link

just a keep-alive comment. I've had bisq-1.9.9 up and running for a few months using a download as described by tmakerman (above) (thanks) (bisq-on-rpi)
I can build 1.9.12 with a couple of patches etc, but it seems to have got some X8-64 code in somewhere. And I now I need to run bisq-1.9.12 to trade. I'll think about a bug report if I can't get something together in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants