updated API UWSGI install instructions and the default configs to have more descriptive replacement paths

This commit is contained in:
Aaron Blankstein
2017-04-11 11:26:01 -04:00
parent 286d54d651
commit 928bbe1bc6
5 changed files with 36 additions and 23 deletions

View File

@@ -1,14 +1,15 @@
[uwsgi]
module = wsgi
module = api.server:app
master = true
processes = 9
pcre-jit = true
manage-script-name = true
thunder-lock = on
enable-threads = true
listen = 128
socket = blockstack_api.sock
socket = /tmp/blockstack_api.sock
chmod-socket = 660
vacuum = true

View File

@@ -19,6 +19,6 @@ server {
location / {
include uwsgi_params;
uwsgi_pass unix:/path/to/nginx/blockstack_api.sock;
uwsgi_pass unix:/tmp/blockstack_api.sock;
}
}

View File

@@ -3,13 +3,11 @@ Description=uWSGI instance to serve Blockstack API
After=network.target
[Service]
User=muneeb
User=USER
Group=www-data
WorkingDirectory=/home/muneeb/blockstack-core/api/nginx
Environment="PATH=/home/muneeb/bin"
Environment="PYTHONPATH=/usr/local/python"
WorkingDirectory=/path/to/blockstack/
Environment="BLOCKSTACK_DEBUG=1"
ExecStart=/usr/local/bin/uwsgi --ini /home/muneeb/blockstack-core/api/nginx/blockstack_api.ini
ExecStart=/usr/local/bin/uwsgi --ini /path/to/blockstack/api/nginx/blockstack_api.ini
[Install]
WantedBy=multi-user.target

View File

@@ -5,10 +5,6 @@ basicrpc==0.0.2
beautifulsoup4==4.5.3
bitcoin==1.1.42
bitmerchant==0.1.8
blockstack==0.14.1.2
blockstack-profiles==0.14.1
blockstack-proofs==0.0.8
blockstack-zones==0.14.1
boto==2.46.1
cachetools==2.0.0
cffi==1.9.1
@@ -20,7 +16,7 @@ dnspython==1.15.0
dropbox==7.2.1
ecdsa==0.13
enum34==1.1.6
fastecdsa==1.4.1
fastecdsa>=1.4.1
Flask==0.12
flask-crossdomain==0.1
Flask-HTTPS==0.1.0
@@ -52,6 +48,11 @@ six==1.10.0
typing==3.5.3.0
urllib3==1.20
utilitybelt==0.2.6
virtualchain==0.14.1.1
virtualchain==0.14.2
blockstack>=0.14.1
blockstack-profiles>=0.14.1
blockstack-proofs==0.0.8
blockstack-zones>=0.14.1
warlock==1.3.0
Werkzeug==0.12.1
pymongo>=3.4.0

View File

@@ -8,16 +8,22 @@ Ubuntu are below.
- **Step 2:** Make sure you have [virtualenv installed](http://docs.python-guide.org/en/latest/dev/virtualenvs/).
Then, setup the API:
```
$ sudo apt-get install -y python-pip memcached python-dev libmemcached-dev zlib1g-dev
$ sudo apt-get install -y python-pip memcached rng-tools python-dev libmemcached-dev zlib1g-dev libgmp-dev libffi-dev libssl-dev
$ sudo service memcached start
$ sudo pip install virtualenv
$ virtualenv api
$ git clone https://github.com/blockstack/blockstack-core.git
$ virtualenv api && source api/bin/activate
$ git clone https://github.com/blockstack/blockstack-core.git --branch api
$ cd blockstack-core/
$ git checkout api
$ pip install .
$ pip install -r api/requirements.txt
$ bin/blockstack api start
$ bin/blockstack-api
$ blockstack setup_wallet
$ blockstack api start
```
If you'd like to point the Blockstack API server to your local Blockstack Core instead of node.blockstack.org:
```
$ sed -i 's/node.blockstack.org/localhost/' ~/.blockstack/client.ini
$ blockstack info
```
### Search Subsystem
@@ -38,7 +44,8 @@ $ sudo pip install uwsgi
> /etc/nginx/sites-available/blockstack_api
and edit the paths depending on your home directory. You can test your nginx settings:
and edit the paths depending on the uwsgi blockstack_api socket directory (defaults to /tmp/blockstack_api.sock)
You can test your nginx settings:
```
$ sudo nginx -t
```
@@ -46,7 +53,13 @@ $ sudo nginx -t
> /etc/systemd/system/blockstack_api.service
and edit the paths depending on your home directory.
and edit the service user and blockstack paths depending on where your blockstack repo is located.
Then, update the [uwsgi ini file](../api/nginx/blockstack_api.ini) with your $VIRTUAL_ENV location:
```
$ sed -i 's#/path/to/virtual_environment#$VIRTUAL_ENV#' api/nginx/blockstack_api.ini
```
- **Step 4:** Get a security certificate from [Let's Encrypt](https://letsencrypt.org/).
```
@@ -57,7 +70,7 @@ $ ./certbot-auto --nginx -d <your_domain>
And copy the cert files to the path given in the nginx sites file earlier.
- **Step 5:** Start nginx and the Blockstack API:
- **Step 5:** Start nginx and the Blockstack API uwsgi server:
```
sudo systemctl restart blockstack_api
sudo systemctl restart nginx