/
install_node_testnet.sh
56 lines (51 loc) · 2.15 KB
/
install_node_testnet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Each script starts with a shebang and the path to the shell that you want to use. shebang is '#!'
#!/bin/bash
GIT_CLONE_PATH=https://github.com/SkelpyCoin/skelpy-node.git
#Basic installations
#install NTP
sudo apt-get install git
sudo apt-get install -y ntp
sudo service ntp restart
rm -rf skelpy-node
#Clones the repository
echo -e "Clonning the repository $GIT_CLONE_PATH\n"
git clone $GIT_CLONE_PATH
#Change directory to skelpy-node
echo -e "Change directory to skelpy-node\n"
cd skelpy-node
#Install it to avoid error
echo -e "Avoiding future errors by installing libpq-dev\n"
sudo apt-get -y update
sudo apt-get install -y libpq-dev
#Developer installations
#Install essentials:
echo -e "Install essentials:\n"
sudo apt-get install -y curl build-essential python git
#Install PostgreSQL (min version: 9.5.2)
echo -r "Install PostgreSQL (min version: 9.5.2)\n"
#Since the AWS instances do not have npm installed already thus we are installing it as further installations are done using npm
echo -e "Since the AWS instances do not have npm installed already thus we are installing it as further installations are done using npm\n"
sudo apt-get -y install npm
#Install Node.js (tested with version 6.9.2, but any recent LTS release should do):
echo -e "Install Node.js (tested with version 6.9.2, but any recent LTS release should do):\n"
sudo apt-get install -y nodejs
sudo npm install -g n
sudo n 6.9.2
#Install grunt-cli (globally):
echo -e "#Install grunt-cli (globally):\n"
sudo npm install grunt-cli -g
#Install node modules:
echo -e "#Install node modules:\n"
npm install libpq secp256k1
npm install
sudo npm install forever -g
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
sudo -u postgres psql -c "CREATE USER $USER WITH PASSWORD 'password';"
dropdb skp_testnet
createdb skp_testnet "this should match with the database name from config file"
forever start app.js -c config.testnet.json -g genesisBlock.testnet.json
#wait for chain to sync
sleep 10m
forever stop app.js -c config.testnet.json -g genesisBlock.testnet.json
read please update your delegate secret and press enter when finished.
forever start app.js -c config.testnet.json -g genesisBlock.testnet.json