Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
vkuznecovas Merge pull request #134 from mysteriumnetwork/leaderboard-1023
leaderboard now only shows the participants of the bounty programme
Latest commit d151c23 May 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update codeowners Mar 21, 2019
api leaderboard now only shows the participants of the bounty programme May 6, 2019
bin fix linter warnings Aug 24, 2018
dashboard re-enable cache.... May 3, 2019
migrations added bounty_program column May 2, 2019
templates PUT method for payout endpoint Mar 8, 2019
tests
.dockerignore Make DB migration clear Feb 15, 2018
.gitignore Add settings file Feb 14, 2018
.travis.yml Use actual database for tests (not sqlite) to test dashboard home Apr 1, 2019
Dockerfile Add docker healthy status waiting to fix test failures Apr 11, 2019
Dockerfile.dashboard Use session statistics endpoint in dashboard homepage Apr 30, 2019
README.md Add instructions for schema changes Apr 26, 2019
abi.py register_proposal endpoint checks identity is registered Aug 24, 2018
app.py Use session statistics endpoint in dashboard homepage Apr 30, 2019
docker-compose.yml Use session statistics endpoint in dashboard homepage Apr 30, 2019
fixtures.py Fix models and database schema mismatch Apr 11, 2019
helpers.py
identity_contract.py tests for settings.py: test default values, test ETHER_MINING_MODE Sep 13, 2018
ip.py remove detect_country function Mar 19, 2018
models.py added bounty_program column May 2, 2019
queries.py fitlering by node-type Apr 24, 2019
request_helpers.py Use session statistics endpoint in dashboard homepage Apr 30, 2019
requirements.txt Merge remote-tracking branch 'origin/master' into feature/MYST-676-ch… Aug 24, 2018
server.py Use session statistics endpoint in dashboard homepage Apr 30, 2019
signature.py Update to python 3 Mar 1, 2018

README.md

Mysterium Network API

Build Status pyVersion36

API for Node & Client

Setup

  • Start docker containers in background:
docker-compose up -d --build
  • Wait ~10s for database to setup.

  • Run database migrations:

docker-compose exec api bin/db-upgrade

Development

Testing

Install the requirements using pip

$ pip install -r requirements.txt

To execute tests in docker container:

  • Run:
tests/run_tests

(Optional)

After that test database will be kept running in the background, so you can execute. To do that, you need to do additional steps:

  • Ensure that python 3.6+ is installed globally (python --version)
  • Add ENV variables:
DB_HOST=localhost:33062
DB_NAME=myst_api
DB_USER=myst_api
DB_PASSWORD=myst_api
  • Run tests from IDE or bash:
bin/test

Linter

To run linter:

bin/lint

Database schema changes

To change database schema:

  • Change schema in models.py (i.e. add new table, column or change existing schema)
  • Run bin/db-migrate to create migration script
  • Check created script manually to ensure it is correct. It sometimes fail, so you might need to modify it.
  • Run bin/db-upgrade to apply migration

That's it! As a bonus point, you can try running bin/db-migrate again. It should not create a new migration file - if it does, that means previous migration is incorrect and should be fixed.

You can’t perform that action at this time.