Author

Topic: bitcoind buildscript (Read 1186 times)

member
Activity: 70
Merit: 10
January 01, 2014, 11:51:12 AM
#6
see top
legendary
Activity: 1232
Merit: 1011
Monero Evangelist
January 01, 2014, 11:35:57 AM
#5
So which script do we use now on Ubuntu? First or second post?
member
Activity: 70
Merit: 10
January 01, 2014, 11:23:57 AM
#4
see top
legendary
Activity: 1232
Merit: 1011
Monero Evangelist
January 01, 2014, 10:49:30 AM
#3
Works on Debian?
member
Activity: 70
Merit: 10
January 01, 2014, 06:19:23 AM
#2
see top
member
Activity: 70
Merit: 10
December 30, 2013, 05:58:55 PM
#1
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
Jump to: