-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.sh
65 lines (57 loc) · 1.69 KB
/
configure.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
63
64
65
#!/bin/bash
# todo: rename dynamic libs to force gcc to use static ones
# set up, compile, and install libbtc
echo "Compiling libbtc..."
cd libbtc
sudo ./autogen.sh
sudo ./configure --disable-net # looks like we cannot --disable-wallet on linux
sudo make
# compile libbloom
echo "Compiling libbloom..."
cd ../libbloom
sudo make
cd build
sudo rm libbloom.so
sudo rm libbloom.so.2
#compile libwebsockets
echo "Compiling and installing libwebsockets"
cd ../../libwebsockets
mkdir build
cd build
# if mac
export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/*
cmake ..
make -j4 && sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig
cd ..
# create sqlite3 database with keys table
echo "Creating Observer database..."
cd ../db
db=observer.db
if [ -f "$db" ]
then
echo "$db already exists."
else
sudo sqlite3 $db < configure.sql
sudo chmod 666 $db
fi
cd ../src/init_download
pip3 install cython
echo "Compiling Cython.."
python3 setup.py build_ext --inplace
# if you only care about UTxO, then you can skip this (eventually!)
read -r -p "Do you want to download all addresses that have been used in the last ~584,000 blocks? (y/n):" response
case "$response" in
[yY][eE][sS]|[yY])
echo "Downloading addresses from S3, this will take some time."
sh s3_download.sh
# load the addresses into the database
echo "Done! Loading addresses into database... This will take at least several hours, but more likely a few days. Please keep your computer on until this process completes."
sh load.sh &
;;
*)
echo "Skipping download. You can do this at a later time, just read over the configure.sh script."
;;
esac
echo "Done."