ethstats-client/bin/build-go.sh

41 lines
1011 B
Bash
Raw Normal View History

2015-03-01 21:55:45 +01:00
#!/bin/sh
# update repository & install dependencies
2015-03-01 21:55:45 +01:00
sudo apt-get update -y
sudo apt-get upgrade -y
2015-04-02 20:11:55 +02:00
sudo apt-get install -y git mercurial build-essential software-properties-common wget pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev nodejs npm ntp
2015-03-01 21:55:45 +01:00
# add ethereum repos
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get update -y
2015-03-01 21:55:45 +01:00
2015-04-03 00:02:32 +02:00
# install ethereum
2015-04-03 00:09:17 +02:00
sudo apt-get install -y geth
2015-03-01 21:55:45 +01:00
# add node symlink
sudo ln -s /usr/bin/nodejs /usr/bin/node
# install cloud-utils to fetch instance meta-data
sudo apt-get -y install cloud-utils
# add node service
cd ~/bin
[ ! -d "www" ] && git clone https://github.com/cubedro/eth-net-intelligence-api www
cd www
2015-04-02 16:38:59 +02:00
npm install
npm install pm2 -g
2015-03-01 21:55:45 +01:00
2015-03-03 18:55:37 +01:00
cp -b ./processes-go.json ./../processes.json
2015-04-02 20:11:55 +02:00
# set up time update cronjob
cat > /etc/cron.hourly/ntpdate << EOF
#!/bin/sh
sudo service ntp stop
sudo ntpdate -s ntp.ubuntu.com
sudo service ntp start
EOF
2015-04-03 00:02:32 +02:00
2015-04-02 20:11:55 +02:00
sudo chmod 755 /etc/cron.hourly/ntpdate