2015-02-12 22:59:01 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-02-12 23:30:12 +01:00
|
|
|
cd ~
|
|
|
|
|
2015-02-12 22:59:01 +01:00
|
|
|
# let's install packages
|
2015-02-17 18:22:28 +01:00
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install language-pack-en-base
|
|
|
|
sudo dpkg-reconfigure locales
|
|
|
|
sudo apt-get -y install software-properties-common
|
|
|
|
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
|
|
sudo add-apt-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5-binaries main"
|
2015-02-12 22:59:01 +01:00
|
|
|
|
|
|
|
# Setup Ethereum repos
|
|
|
|
sudo add-apt-repository -y ppa:ethereum/ethereum
|
|
|
|
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
|
2015-02-17 18:22:28 +01:00
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y upgrade
|
|
|
|
|
2015-02-17 19:07:00 +01:00
|
|
|
sudo apt-get -y install build-essential g++-4.8 git cmake libboost-all-dev automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons libncurses5-dev libcurl4-openssl-dev wget qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev clang-3.5 lldb-3.5 nodejs npm
|
2015-02-12 22:59:01 +01:00
|
|
|
|
|
|
|
# add node symlink
|
|
|
|
sudo ln -s /usr/bin/nodejs /usr/bin/node
|
|
|
|
|
|
|
|
# create directories structure
|
|
|
|
[ ! -d "ethereum" ] && mkdir ethereum # ethereum dir maybe mapped from host machine
|
|
|
|
mkdir opt
|
|
|
|
mkdir bin
|
|
|
|
mkdir logs
|
|
|
|
|
|
|
|
# download cpp-ethereum if needed
|
|
|
|
cd ethereum
|
|
|
|
[ ! -d "cpp-ethereum" ] && git clone --depth=1 --branch develop https://github.com/ethereum/cpp-ethereum
|
|
|
|
|
|
|
|
# build ethereum
|
|
|
|
cd ~/opt
|
|
|
|
mkdir cpp-ethereum-build
|
|
|
|
cd cpp-ethereum-build
|
2015-02-17 20:04:11 +01:00
|
|
|
cmake ~/ethereum/cpp-ethereum -DHEADLESS=1 -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
# cmake ~/ethereum/cpp-ethereum -DHEADLESS=1 -DEVMJIT=1 -DCMAKE_BUILD_TYPE=Debug
|
2015-02-17 18:22:28 +01:00
|
|
|
make -j2
|
2015-02-12 22:59:01 +01:00
|
|
|
|
|
|
|
# now let's create bin folder in user's home dir and create symlinks to executables
|
|
|
|
cd ~
|
|
|
|
ln -s ~/opt/cpp-ethereum-build/eth/eth ~/bin/eth
|
|
|
|
|
2015-02-16 22:53:32 +01:00
|
|
|
# install cloud-utils to fetch instance meta-data
|
|
|
|
sudo apt-get -y install cloud-utils
|
|
|
|
|
2015-02-12 22:59:01 +01:00
|
|
|
# add node service
|
|
|
|
cd ~/bin
|
2015-02-17 19:29:35 +01:00
|
|
|
|
2015-02-12 23:35:22 +01:00
|
|
|
[ ! -d "www" ] && git clone https://github.com/cubedro/eth-net-intelligence-api www
|
2015-02-12 22:59:01 +01:00
|
|
|
cd www
|
|
|
|
sudo npm install
|
2015-02-17 19:07:00 +01:00
|
|
|
sudo npm install pm2 -g
|
|
|
|
|
2015-02-26 22:45:24 +01:00
|
|
|
cp -b ./processes.json ./..
|