2021-04-16 01:58:42 +00:00
|
|
|
# wowlet-backend
|
2020-10-03 02:45:45 +00:00
|
|
|
|
2021-04-16 01:58:42 +00:00
|
|
|
Back-end websocket server for wowlet.
|
2020-10-03 02:45:45 +00:00
|
|
|
|
2020-12-22 18:03:48 +00:00
|
|
|
- Quart web framework, Py3 asyncio
|
2020-10-03 02:45:45 +00:00
|
|
|
- Redis
|
2020-10-18 16:07:12 +00:00
|
|
|
|
2021-04-05 17:49:02 +00:00
|
|
|
See also the environment variables `WOWLET_COIN_NAME`, `WOWLET_COIN_SYMBOL`, etc. in `settings.py`.
|
2020-12-22 18:03:48 +00:00
|
|
|
|
|
|
|
## Tasks
|
|
|
|
|
|
|
|
This websocket server has several scheduled recurring tasks:
|
|
|
|
|
|
|
|
- Fetch latest blockheight from various block explorers
|
|
|
|
- Fetch crypto/fiat exchange rates
|
|
|
|
- Fetch latest Reddit posts
|
|
|
|
- Fetch funding proposals
|
|
|
|
- Check status of RPC nodes (`data/nodes.json`)
|
|
|
|
|
2021-04-16 01:58:42 +00:00
|
|
|
When Wowlet (the wallet application) starts up, it
|
|
|
|
will connect to this websocket server and receive
|
|
|
|
the information listed above which is necessary
|
|
|
|
for normal operation.
|
2020-12-22 18:03:48 +00:00
|
|
|
|
2021-04-05 17:49:02 +00:00
|
|
|
See `wowlet_backend.tasks.*` for the various tasks.
|
2020-12-22 18:03:48 +00:00
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
Requires Python 3.7 and higher.
|
2020-10-18 16:07:12 +00:00
|
|
|
|
|
|
|
```
|
2020-12-22 18:03:48 +00:00
|
|
|
virtualenv -p /usr/bin/python3 venv
|
|
|
|
source venv/bin/activate
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
2021-04-05 17:49:02 +00:00
|
|
|
export WOWLET_DEBUG=true
|
2020-12-22 18:03:48 +00:00
|
|
|
python run.py
|
|
|
|
```
|
|
|
|
|
|
|
|
Note that `run.py` is meant as a development server. For production,
|
|
|
|
use `asgi.py` with something like hypercorn.
|
|
|
|
|
|
|
|
## Docker
|
|
|
|
|
|
|
|
In production you may run via docker;
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose up
|
|
|
|
```
|
|
|
|
|
|
|
|
Will bind on `http://127.0.0.1:1337`. Modify `docker-compose.yml` if necessary.
|