Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: coinrevo on December 30, 2013, 10:58:55 PM



Title: bitcoind buildscript
Post by: coinrevo on December 30, 2013, 10:58:55 PM
Ubuntu build script. Tested with ubuntu 13.04.

Work in progress. Latest version at the top.

Needed fixes:

* berkeley DB not working
* incompatible BerkeleyDB version.
* user management

Based on
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
http://bitcoin.stackexchange.com/questions/10010/how-to-install-a-bitcoin-client-on-ubuntu-server

Quote
#!/bin/bash
#
# bitcoind linux buildscript
#
# tested on ubuntu 13
# v.0.03
# last updated 3/1/2014
#
#

#----------------------------------------------------------
#required packages
#----------------------------------------------------------

apt-get -y upgrade
apt-get -y update
apt-get install -y git
apt-get install -y build-essential
apt-get install -y python-pip

apt-get install -y libssl-dev
apt-get install -y libboost-all-dev
apt-get install -y dh-autoreconf

apt-get install -y ccache
apt-get install -y pkg-config

#undocumented issues with bitcoin unix install
apt-get install -y libdb++-dev
apt-get install -y libprotobuf-dev
apt-get install -y alien


#----------------------------------------------------------
# Build berkley db4.8
#----------------------------------------------------------

cd $HOME/Downloads

if [ ! -e db-4.8.30 ]
then
wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
tar zxvf db-4.8.30.tar.gz
rm -f db-4.8.30.tar.gz
fi

cd db-4.8.30/build_unix
sh ../dist/configure --prefix=/usr/local --enable-cxx
make
sudo make install
cd $HOME/Downloads
rm -fr db-4.8.30/

#----------------------------------------------------------
#build bitcoin from source
#----------------------------------------------------------

mkdir $HOME/bitcoin; cd bitcoin
git clone git://github.com/bitcoin/bitcoin.git $HOME/bitcoin
/bin/bash $HOME/bitcoin/autogen.sh
 
#build without QT
cd $HOME/bitcoin && ./configure --without-qt
sudo make

#copy the binary. better perhaps a init script and change privs
cp $HOME/bitcoin/src/bitcoind /usr/local/bin

#----------------------------------------------------------
#create config
#----------------------------------------------------------

mkdir $HOME/.bitcoin
touch $HOME/.bitcoin/bitcoin.conf

echo "########### Creating config"
config=".bitcoin/bitcoin.conf"
touch $config
echo "server=1" > $config
echo "daemon=1" >> $config
echo "connections=40" >> $config
randUser=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
randPass=`< /dev/urandom tr -dc A-Za-z0-9 | head -c30`
echo "rpcuser=$randUser" >> $config
echo "rpcpassword=$randPass" >> $config

# other config

#echo "########### Firewall rules; allow 22,8333"
#ufw allow 22/tcp
#ufw allow 8333/tcp
#ufw --force enable

#echo "########### Creating Swap"
#dd if=/dev/zero of=/swapfile bs=1M count=1024 ; mkswap /swapfile ; swapon /swapfile
#echo "/swapfile swap swap defaults 0 0" >> /etc/fstab


#echo "########### Setting up autostart (cron)"
#crontab -l > tempcron
#echo "@reboot bitcoind -daemon" >> tempcron
#crontab tempcron
#rm tempcron
#rebootoot password!"
#passwd


Title: Re: bitcoind buildscript
Post by: coinrevo on January 01, 2014, 11:19:23 AM
see top


Title: Re: bitcoind buildscript
Post by: dewdeded on January 01, 2014, 03:49:30 PM
Works on Debian?


Title: Re: bitcoind buildscript
Post by: coinrevo on January 01, 2014, 04:23:57 PM
see top


Title: Re: bitcoind buildscript
Post by: dewdeded on January 01, 2014, 04:35:57 PM
So which script do we use now on Ubuntu? First or second post?


Title: Re: bitcoind buildscript
Post by: coinrevo on January 01, 2014, 04:51:12 PM
see top