Building steemd on Debian 9

in #steemdev9 years ago (edited)

I had some trouble getting steemd to compile on Debian 9 (Stretch) so I'm documenting the process that finally worked for me in the hopes that it will save someone else a bit of time.

I think this guide will work for Ubuntu 17 as well, YMMV.

flyturtle.jpg


First make sure you got the basics for building by running:

apt-get build-essential git autoconf automake cmake python-dev autotools-dev

Boost 1.60

Stretch comes only with packages for boost 1.62 which is not supported yet, so we need to build our own version. Download and extract boost 1.60:

wget https://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2
tar xjfv boost_1_60_0.tar.bz2
cd boost_1_60_0

🐢

Then we need to patch it to work with gcc 6.3.0 that comes with sterch:

wget https://github.com/boostorg/multiprecision/commit/f9c8f9ec091ad232c0a291904f7839d665d098e0.patch
patch boost/multiprecision/cpp_int.hpp f9c8f9ec091ad232c0a291904f7839d665d098e0.patch

🐢

Get the dependencies:

apt-get install libbz2-dev libicu-dev

🐢

Finally build & install it (replace -j 32 with the number of cpu cores you have):

mkdir -p /opt/steem
./bootstrap.sh --prefix=/opt/steem
./b2 --with=all -j 32 install

🐢

This will take a while so open up a new terminal and star preparing for the next step.

OpenSSL 1.0.2

Sterch comes with OpenSSL 1.1.something and that does not work, so we need 1.0.2, not sure what version is recommended but the latest 1.0.2l works fine.

https://www.openssl.org/source/openssl-1.0.2l.tar.gz
tar xvzf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
./config --prefix=/opt/steem
make -j32
make install

🐢

Finally, we can build steemd

Grab the dependencies

apt-get install  libtool pkg-config python3 python3-jinja2 doxygen libncurses5-dev libreadline-dev perl

🐢

Get the source, pay attention here and make sure to check out the v0.19.0 tag before pulling the submodules!

git clone https://github.com/steemit/steem
cd steem
git checkout v0.19.0
git submodule update --init --recursive
mkdir build && cd build

🐢

You probably want to have a look at the different flags over at
https://github.com/steemit/steem/blob/master/doc/building.md
the ones I'm using in this example is for a witness node.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/steem -DLOW_MEMORY_NODE=YES -DSKIP_BY_TX_ID=YES ..

🐢

Moment of truth! If you did everything right steemd should compile without errors. The perl export is needed for the doxygen target install depends on, if you just want to build the steemd binary you can skip it.

export PERL_USE_UNSAFE_INC=1
make -j32 steemd
make -j32 install

🐢

Now you have all the steem binaries in /opt/steem/bin.

Sort:  

Finally a linux tutorials showing as hot. Thanks for sharing..will try this later this week...

This post received a 3.7% upvote from @randowhale thanks to @almost-digital! For more information, click here!

I liked your post and would like to do some hands on and see how it goes... thanks for sharing

I'm new to this community so I must ask: can anyone just install a witness server? is it profitable enough to pay a VPS? I live for Linux Administration :) following and upvoting ... Thanks in advance

I'm new as well but yeah, anyone can run a witness node. You need confidence from the community in order to receive blocks and get paid (https://steemit.com/~witnesses) and you need beefy hardware to run it. So I imagine you need to be pretty high up the witness list for it to be worth it. I'm planning to find out :)