How to build multichain for Raspberry pi? Any build instructions?

+2 votes
I'm trying to build multichain for Raspberry PI. I'm looking for any documentation or build instructions on the same. If anyone tried this? please suggest. I have built multichain on ubuntu 12.04 machine and now trying to cross compile for Raspberry Pi.
asked Aug 17, 2017 by Ram

1 Answer

+3 votes
Hi Ram,

 

i have successfully compiled and run MultiChain on Raspberry/openSuse 64 bits:

 

- https://en.opensuse.org/HCL:Raspberry_Pi3

- compile instructions:

zypper in -t pattern devel_C_C++
zypper in libdb-4_8-devel
zypper in libopenssl-devel

wget https://github.com/MultiChain/multichain/archive/master.zip
unzip master.zip

./autogen.sh
./configure
make

Compilation take some time, so be ready to wait for it.

This was a couple of months ago, so may be it is still compiling or not :-)

 

have fun

 

Sebastien
answered Aug 18, 2017 by sgaide
This is great - thanks for sharing this!
Hi Sebastien,

I am trying to run OpenSuse on Raspberry pi 3 b as per the instructions you shared. I used the Opensuse image file openSUSE-Leap42.2-ARM-E20-efi.aarch64-2017.02.02-Build1.119.raw.xz  downloaded from - https://en.opensuse.org/HCL:Raspberry_Pi3.
I used Etcher tool to flash this image into my SD card. The image flashing is successful but the Board is not booting after that. I am not getting any display once i boot the board. Not sure what is wrong?

Can you please suggest me, which OpenSuse image file you are using? Which Version of RBPi 3 you have? How you are flashing your OS image to SD card? Any issues you faced doing this? etc. I will try the same way and see if it works for me. I didn't find any help related to this in OpenSuse forum.

Thanks in advance.
-Ram
Hi Ram,

sorry to hear that.
actually at the time i have used the latest stable image, and flashed it using the 'dd' command on my mac using the shell. no problem with that, and boot was successful. I was using the standard Pi 3 B (1 GB ram)

S.
i have spent some time today to try to compile the latest version of MultiChain on a Raspberry Pi 3, here are the steps i have used with success:

# MultiChain on Raspberry Pi 3

## openSUSE install

Get the smallest/lightest  openSUSE image, [Leap 42.2 (JeOS)](http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/appliances/openSUSE-Leap42.2-ARM-JeOS-raspberrypi3.aarch64.raw.xz)

(i tried also the E20 image, but the GUI is really too heavy for the Pi and there is not enough ram left to compile MultiChain anyway...)

## Flash the image to an sd card

On my mac i used these commands in a terminal :

``` bash
diskutil list
```

insert the sd card, then again

``` bash
diskutil list
```

note the name of the new listed device (here let's use /dev/disk3)

``` bash
diskutil unmountDisk /dev/disk3
xzcat openSUSE-Leap42.2-ARM-JeOS-raspberrypi3.aarch64-2017.02.02-Build1.73.raw.xz | sudo dd of=/dev/rdisk3 bs=16m && sync
diskutil eject /dev/disk3
```

Of course you have to use the correct device id (here /dev/disk3) depending on your configuration, or better use a GUI flash tool, it should work.
Don't call me if you flash your boot disk instead of the sd card ;-)

## Boot the Raspberry

insert the sd card, plug an ethernet cable, a keyboard, an hdmi cable attached to a monitor, then the usb power cord.

you should see a boot screen, with a choice: normal boot, failsafe boot, let the default choice automatically happen.

and then ... wait ;-) the screen will go blank for a few minutes, the system is expanding the filesystem and installing some mandatory stuff, just wait a little.

after a few minutes, you should get a login prompt.

## Install the necessary dev dependencies

Log into the system (user=root/password=linux), or better ssh to it using another computer after retrieving the Pi lan address.

install the dependencies, like this:

``` bash
zypper in -t pattern devel_C_C++
zypper in libdb-4_8-devel
zypper in libopenssl-devel
```

this will take a long time, especially the first line, there are a lot of packages to install since we start from a JeOS version.

## Get MultiChain sources

here, i'm using the 1.0-release branch:

``` bash
wget https://github.com/MultiChain/multichain/archive/1.0-release.zip
unzip 1.0-release.zip
```

## Add some swap space

to workaround some very low memory conditions, add some swap space:

``` bash
dd if=/dev/zero of=/swap_1 bs=1024 count=1000000
mkswap /swap_1
swapon /swap_1
```

to get rid of it, reboot the Raspberry after the compilation and

```bash
rm -rf /swap_1
```

## Compile the thing

``` bash
cd multichain-1.0-release/
./autogen.sh
./configure
make
```

I got no error during `autogen.sh` and `configure` execution, and only warnings during the `make`.

Be prepared to wait during the `make` it takes several hours...

##  Install the binary

First strip the binaries to get rid of debug info:

``` bash
strip src/multichaind
strip src/multichaind-cold
strip src/multichain-util
strip src/multichain-cli
```

then copy the binaries somewhere in the path for example :

``` bash
cp src/multichaind /usr/local/bin/
cp src/multichaind-cold /usr/local/bin/
cp src/multichain-util /usr/src/local/bin/
cp src/multichain-cli /usr/src/local/bin/
```

## Enjoy

``` bash
multichain-util create chain1
multichaind chain1 -rpcuser=multichain -rpcpassword=multichain -daemon
multichain-cli -rpcuser=multichain -rpcpassword=multichain chain1 getinfo
```
...