This is a radical refactor of the backend (regarding file names, dir structure, etc.):
removed heaps of dead code
added Cardano mode (switched via commandline, e.g. python -m polydash --settings cardano.yaml cardano)
reworked lots of code to Pythonic standards
reformatted code with Black formatter
proper thread and logger usage
Some changes to how miner's reputation charts are drawn
Breaking ~news~ changes
Cardano and Polygon modes must use different databases. However, to be able to reuse the Polygon-related code (routes, etc.), I put Polygon and Cardano into the same ORM classes. Unfortunately, this required minor changes to Polygon database format.
To convert an existing (Polygon) DB to work with the new code, one should use upgrade mode of the CLI:
python -m polydash --settings settings.yaml upgrade
At the first run with the given mode the app will put a mark into the DB with the corresponding network. At the next run, it will refuse to run if the network type mark in the DB does not match the running mode (e.g. trying using Polygon DB with Cardano mode).
Known bugs/deficiencies
This is still not proper DB normalization - will have to do that eventually
Tests are half-broken
The Settings classes are the same for both (Polygon and Cardano) modes, which is a bit confusing
Pony still creates all the tables even in Polygon mode - fixing this will require a different way of initializing Pony classes (through instancing)
continuing from #29
This is a radical refactor of the backend (regarding file names, dir structure, etc.):
python -m polydash --settings cardano.yaml cardano
)Breaking ~news~ changes
Cardano and Polygon modes must use different databases. However, to be able to reuse the Polygon-related code (routes, etc.), I put Polygon and Cardano into the same ORM classes. Unfortunately, this required minor changes to Polygon database format. To convert an existing (Polygon) DB to work with the new code, one should use
upgrade
mode of the CLI:python -m polydash --settings settings.yaml upgrade
At the first run with the given mode the app will put a mark into the DB with the corresponding network. At the next run, it will refuse to run if the network type mark in the DB does not match the running mode (e.g. trying using Polygon DB with Cardano mode).
Known bugs/deficiencies