-
Notifications
You must be signed in to change notification settings - Fork 8
/
init
executable file
·67 lines (56 loc) · 2.08 KB
/
init
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
63
64
65
66
67
#!/bin/bash
#
# Setup and build
# https://github.com/KomodoPlatform/atomicDEX-API#how-to-build
#
# @author webworker01
#
scriptpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [[ ! -f ${scriptpath}/config ]]; then
read -p "No config file detected, do you want to set one up? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
cp ${scriptpath}/config.example ${scriptpath}/config
source $scriptpath/main
read -p "Generate random wallet passphrase? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
generated_passphrase=$(rand)
sed -i "s/passphrase=\"\"/passphrase=${generated_passphrase}/g" ${scriptpath}/config
fi
read -p "Generate random rpc userpass? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
generated_userpass=$(rand)
sed -i "s/userpass=/userpass=${generated_userpass}/g" ${scriptpath}/config
fi
fi
else
source $scriptpath/main
fi
read -p "Install atomicDEX-API and dependencies? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
sudo apt-get install -y build-essential git llvm-3.9-dev libclang-3.9-dev clang-3.9 libssl-dev pkg-config jq bc gawk nano
rustup install nightly-2020-10-25
rustup default nightly-2020-10-25
rustup component add rustfmt-preview
cd ~
git clone https://github.com/KomodoPlatform/atomicDEX-API
cd ~/atomicDEX-API
git checkout beta-2.1.3731
cargo build --features native -vv
cd $scriptpath
git clone https://github.com/komodoplatform/coins.git
fi
read -p "Install cipi's mmtools/mpm and dependencies? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get install -y jq libdatetime-perl libdatetime-format-strptime-perl libjson-perl libjson-rpc-perl libfile-slurp-perl liblwp-protocol-https-perl
cd $scriptpath
git clone https://github.com/cipig/mmtools cipimmtools
ln -s ./cipimmtools/mpm mpm
sed -i "s/mpm_enable=0/mpm_enable=1/g" ${scriptpath}/config
fi