-
Notifications
You must be signed in to change notification settings - Fork 9
/
node-setup.sh
executable file
·62 lines (55 loc) · 2.01 KB
/
node-setup.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
56
57
58
59
60
61
62
#!/bin/bash
# Setup script for QDAO
#
# Description: This script is called setting up a QRUCIAL DAO node
#
# Author: QDAO Team
# License: GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007
# Don't run as root
if [ "$EUID" -eq 0 ]
then echo "You must not run this as root. Please apply basic hardening and create the qdao user."
exit
fi
# Dependency checks
type git >/dev/null || { echo >&2 "> git is missing. Please install it." ; exit 1;}
type cargo >/dev/null || { echo >&2 "> cargo is missing. Please install it." ; exit 1;}
type docker >/dev/null || { echo >&2 "> docker is missing. Please install it." ; exit 1;}
type python3 >/dev/null || { echo >&2 "> python3 is missing. Please install it." ; exit 1;}
type curl >/dev/null || { echo >&2 "> curl is missing. Please install it." ; exit 1;}
type tmux >/dev/null || { echo >&2 "> tmux is missing. Please install it." ; exit 1;}
type keccak256 >/dev/null || { echo >&2 "> keccak256 is missing. Please install it." ; exit 1;}
type gcc >/dev/null || { echo >&2 "> gcc is missing. Please install it." ; exit 1;}
type make >/dev/null || { echo >&2 "> make is missing. Please install it." ; exit 1;}
type pip3 >/dev/null || { echo >&2 "> make is missing. Please install it." ; exit 1;}
# Pip
pip3 install Flask
# Get from git and checkout correct branch (later from IPFS?)
if [ -d "qdao-node" ]; then
echo "> Found qdao-node directory, assuming we are already in git repo."
git fetch
cd qdao-node
else
echo "> We are having a clean start, starting with git clone."
cd ~
git clone https://github.com/Qrucial/QRUCIAL-DAO
cd QRUCIAL-DAO/qdao-node
fi
git checkout dev
# Build the node
cargo build
# Build ExoSys Daemon
echo "> Building ExoSys Daemon"
cd ../exosysd/
cargo build
chmod +x target/debug/qdao-exosysd
cd ../
# Prompt for starting services
#echo "Do you wish to start a full QDAO node?"
#select yn in "Yes" "No"; do
# case $yn in
# Yes ) chmod +x node-start.sh; ./node-start.sh;;
# No ) exit;;
# esac
#done
chmod +x node-start.sh
./node-start.sh