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
Enter <project_root_path>/backends
, eg:
cd ./backends
Redis is required in this project. Please refer to redis.io for help.
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
Enter <project_root_path>
, if you are in backends dir, just go up one level:
cd ..
source start_server.sh
pstree -ap|grep gunicorn
kill -9 <pid>