smk762 / kmd_ntx_stats_docker

Docker container for Komodo Notary stats API using Django / PGSQL
2 stars 3 forks source link

Dependancies:

Clone repo

git clone https://github.com/smk762/kmd_ntx_stats_docker

cd kmd_ntx_stats_docker

Install Python Packages: pip3 install -r requirements.txt

sudo docker compose build (needs to be run to apply code changes)

sudo docker compose up (run to launch containers)

Setup .env files (scripts pending...)

Create Database Tables

Make migrations: "docker compose run web python3 manage.py makemigrations"

Apply migrations: "docker compose run web python3 manage.py migrate"

Collect static files: "docker compose run web python3 manage.py collectstatic"

Create superuser:

docker compose run web python3 manage.py createsuperuser --email brian@spam.ni --username messiah

See https://docs.djangoproject.com/en/3.0/ref/django-admin/ for more django admin commands.

Applying code changes

cd ~/kmd_ntx_stats_docker

docker compose build

sudo chown $USER:$USER /home/$USER/kmd_ntx_stats_docker/postgres-data -R

docker compose build

sudo cp -R static /var/www/stats.kmd.io/html

Adding new coins

add coin parmas to scripts/base_58.py

run scripts/populate_coins_table.py

run scripts/populate_balances_table.py

run scripts/populate_addresses_table.py

Check web pages to confirm display / no errors.

Reference

Find where colectstatic is looking

PGSQL access config

Fix permissions

Prune old docker images (do while container is running so active containers are not removed)