Building Riecoin 0.9.1 on Ubuntu 14.04
I’ve been trying to host a forked version of the open-source Abe block explorer for Riecoin, but gave it up a while ago due to finals and other school stuff. Now I’m back at it again, but since the last time I built Riecoin from source, the developers have switched to using autotools instead of makefile. I had a little trouble with Berkeley DB version compatibility during the process, so I’ve decided to write out the steps I took for future reference. Keep in mind that this applies to building Bitcoin as well! Also note that BerkeleyDB.4.8 is only really necessary for wallet functionality, which you probably won’t need on a VPS.
First, you’ll want to install dependencies.
sudo apt-get update sudo apt-get install -y git make g++ build-essential libminiupnpc-dev sudo apt-get install -y libboost-all-dev libdb++-dev libgmp-dev libssl-dev automake libcurl4-openssl-dev
Then, grab the source and build it.
git clone https://github.com/riecoin/riecoin.git cd riecoin ./autogen.sh
Running “./configure” is the next step, but this error is the result:
configure: error: Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore)
If you don’t care about wallet functionality simply run “./configure”, with the following flag:
If you do care about wallet functionality, we’ll have to compile BerkeleyDB 4.8 ourselves, as well as tell the system where to find it.
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar -xzvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix ../dist/configure --enable-cxx make sudo make install
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include" export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib" sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so
Now we can run configure with the following flags, and follow up by running make.
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" make
If you run into “g++: internal compiler error: Killed (program cc1plus)” like I did on a 1GB RAM VPS, check out DigitalOcean’s guide on adding swap space. 2GB of swap did the trick for me.
Wait several minutes for the make process to finish.
Edit: The db4.8 process described above is probably unnecessary. If it works as is, great, but if it doesn’t, simply grab libdb4.8 with apt-get:
sudo apt-get install libdb4.8++
After make completes successfully, create the conf file.
mkdir ~/.riecoin nano ~/.riecoin/riecoin.conf
An example config is shown below. Press Ctrl+X after pasting into nano to save.
rpcuser=changethisusername rpcpassword=changethispassword rpcport=28332 port=28333 rpcallowip=127.0.0.1 addnode=126.96.36.199 addnode=188.8.131.52 addnode=184.108.40.206 addnode=220.127.116.11 addnode=18.104.22.168 addnode=22.214.171.124 addnode=126.96.36.199 addnode=188.8.131.52 addnode=184.108.40.206 server=1 daemon=1
Then run the Riecoin daemon by entering:
cd ~/riecoin/src ./riecoind
You will now be able to enter console commands in the following format (with mining info example):
./riecoind wallet_console_command ./riecoind getmininginfo
That’s it! If you found this tutorial helpful, please consider liking it, and be sure to leave a comment if you have any questions.