/blog

About life, thoughts and things I do



How to install Golem in Debian 10 (Buster) - shijuleon/blog

How to install Golem in Debian 10 (Buster)

The Golem project is certainly an interesting effort on the idea of using the computing resources of peers in a decentralized network. This concept has been long hinted but there hasn’t been any major advancements. With the rise of Blockchain, Golem looks promising in achieving the feat. I’m personally very interested in the challenges of achieving scalability, security and performance.

The alpha release 0.10.0 was released two days ago on 20th of December, 2017. There is an .tar.gz archive downloadable for Linux distros which contains the golemapp and the golemcli along with applications for rendering graphics.

If you are using Debian Buster, you will probably run into a couple of errors, atleast for now.

Trying to execute the golemapp will give you

File "/Projects/golem/venv/lib/python3.5/site-packages/pyelliptic/openssl.py", line 528, in <module>
File "/Projects/golem/venv/lib/python3.5/site-packages/pyelliptic/openssl.py", line 180, in __init__
File "/usr/lib/python3.5/ctypes/__init__.py", line 360, in __getattr__
File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in __getitem__
setattr(self, name, func)
AttributeError: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: ECDH_OpenSSL
[26930] Failed to execute script golemapp

The reason for the error is golem uses openssl version 1.0.0 while Debian Buster has openssl v1.1.0.

You can rectify the error and run golem by downgrading or changing the libcrypto.so.1.1 to libcrypto.so.1.0 in /usr/lib/x86_64-linux-gnu/ but this will break a lot of other applications in your system. For example,

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

If you are using the Electron GUI provided by golem then you will notice it stuck on “Starting Golem”. Also, if you fix the error by playing with .so files, you will notice it won’t be able to download the Docker images.

You have to download Docker from the official website and install it for golem to work. Make sure your user is in the docker group by running $ groups <username>. You can add yourself to the group by executing $ sudo usermod -aG docker <username>

Sometimes you may get Got permission denied while trying to connect to the Docker daemon socket error on Docker. In that case, log out and log in into your system after adding your current user to the docker group.

You can verify yourself if you can obtain the Docker image by running $ docker pull golemfactory/base:latest and terminating it halfway to make sure you don’t get errors.

Install scrypt, if it complains. $ pip install scrypt

Alright, now to run golem without breaking your applications you have to work a little. You have to compile the source from the repository.

First, make sure you have virtualenv and python3. Even though the golem build is configured to use Python 2.7 the codebase uses Python 3.

$ sudo apt-get install virtualenv python3

Create a new virtual environment preferably in a new folder. Make sure you have the latest pip3.

$ virtualenv golem

Activate the virtualenv by running $ source golem/bin/activate

Make a new directory and enter it. Then run, $ git clone https://github.com/golemfactory/golem to avoid conflict with the virtualenv directory.

Download the requirements for running, $ pip download -r requirements.txt. We do it since we will be modifying a couple of packages.

Now install the packages, $ pip3 install -r <YOUR DIRECTORY>/golem/requirements.txt. You will probably run into an error when trying to build the cryptography package.

$ pip3 install -r <YOUR DIRECTORY>/golem/requirements.txt

$ python3 <YOUR DIRECTORY>/golem/setup.py develop

Open the file golem/lib/python3.6/site-packages/pyelliptic/openssl.py and modify the line 522 from

libname = ctypes.util.find_library('crypto')

to

libname = '/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0'

Next, you will run into errors on secp256k1

So, let’s build it from source separately.

$ git clone https://github.com/ludbb/secp256k1-py

$ cd secp256k1-py

Modify the setup.py on line 187 by adding "--enable-openssl-tests=no"

cmd = [
        absolute("libsecp256k1/configure"),
        "--enable-openssl-tests=no",
        "--disable-shared",</code>
        .....

Now run $ python3 setup.py install

If it finished successfully, run

$ pip3 install -r <YOUR DIRECTORY>/golem/requirements.txt

$ python3 <YOUR DIRECTORY>/golem/setup.py develop

If you get an error,

***************************************************************
Building TaskCollector failed<br>
b'make: g++-5: Command not found\nmake: *** [Release/taskcollector] Error 127\n'
***************************************************************

You have to modify <YOUR DIRECTORY>/golem/apps/rendering/resources/taskcollector/Makefile to remove the -5 in the g++ command.

After that download the libfreeimage-dev_3.17.0 and install it using dpkg. You should now have a working Golem installation.

GNTs are appreciated due to the hassle of obtaining them.

0x299BeB8E221C744748b7D8F7784a3EB003C0e554

comments powered by Disqus