Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 1.41 KB

deploy.md

File metadata and controls

69 lines (57 loc) · 1.41 KB

Deployment Instruction

Common Prerequisite

Python 3.7+ is required.

Using a python VirtualEnv is recommended:

python3 -m venv venv
source venv/bin/activate

Following packages is needed:

pip install flask
pip install flask-cors
pip install gunicorn
# in some OS, need install dev package before install psycopg2
# apt-get install libpq-dev
pip install psycopg2
pip install base58
pip install redis
pip install requests

Backend Deployment

Enter <project_root_path>/backends, eg:

cd ./backends

Install Redis

Redis is required in this project. Please refer to redis.io for help.

Using deploy scripts

Call deploy_xxx.sh to deploy backend shell scripts with correct network id.

python3 deploy_backend_farm_and_pool.py mainnet
python3 deploy_backend_token_price.py mainnet

You will see two scripts file, make them executable:

chmod a+x backend_token_price.sh
chmod a+x backend_farm_and_pool.sh

Finally, put them into crontab for periodically invoke:

*/5 * * * * /working_path/backend_farm_and_pool.sh > /dev/null
* * * * * /working_path/backend_token_price.sh > /dev/null

Indexer Deployment

Enter <project_root_path>, if you are in backends dir, just go up one level:

cd ..

Start Service

source start_server.sh

Stop Service

pstree -ap|grep gunicorn
kill -9 <pid>