You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to [graph.driveshare.org](graph.driveshare.org) to see network statistics. Built using the Flask framework. MongoDB contains raw data on farmers.
3
+
Go to [graph.driveshare.org](graph.driveshare.org) to see network statistics. Built using the Flask framework. MongoDB contains raw data on farmers. Data in MongoDB is collected from the farmers and totalStorage scrapy scripts which are located in the scrapers directory.
4
+
4
5
Currently displays:
5
6
* total storage capacity over time
6
7
* average capacity per farmer
@@ -9,17 +10,16 @@ Currently displays:
9
10
* histogram of active farmers' uptime percentages (active farmers are farmers who have been seen on the network in the past week)
10
11
* average uptime percentage of active farmers
11
12
12
-
## How to set up and deploy website
13
-
14
-
### Ubuntu Digital Ocean Node
13
+
## Setup on Ubuntu Digital Ocean Node
15
14
16
-
**Setup**
15
+
###Setup
17
16
```
18
17
sudo apt-get install sqlite3 gunicorn tmux
19
18
pip install -r requirements.txt
20
19
```
21
20
22
-
**Setup MongoDB**
21
+
###Setup MongoDB
22
+
23
23
For instructions on how to migrate/copy the existing MongoDB, look at the README in the scrapers folder. After restoring the MongoDB on a machine, run the scrapers in order to continue collecting data on farmers.
24
24
```
25
25
tmux attach -t crawler
@@ -28,22 +28,24 @@ cd ~/driveshare-graph/scrapers
28
28
```
29
29
Detach the tmux session (ctrl-b then d) after starting the scrapeAPI script.
30
30
31
-
**Deploy**
31
+
###Deploy
32
32
```
33
33
tmux attach -t driveshare-graph
34
34
cd project
35
35
gunicorn -b 0.0.0.0:80 --workers=4 app:app
36
36
```
37
37
Detach the tmux session after running gunicorn.
38
38
39
-
Then, create a new tmux session that will update the network.db every 30 seconds.
39
+
Then, create a new tmux session that will update the network.db.
40
40
```
41
41
tmux attach -t updateSQL
42
42
cd project
43
43
python updateSQL.py
44
44
```
45
45
Detach the tmux session after beginning the updateSQL script.
46
46
47
+
47
48
## Databases
48
49
49
-
network.db in the project directory is a sqlite database containing duration and uptime information for each payout address.
50
+
network.db in the project directory is a sqlite database. The farmers table contains duration and uptime information for each payout address. updateSQL.py updates the network.db every 30 seconds. MongoDB queries take a lot of time to execute, so the farmers table is used to generate the uptime histogram and average uptime percentage.
0 commit comments