-
NGINX: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
-
Docker Compose: https://docs.docker.com/compose/install/
-
Certbot: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx.html
-
Git:
sudo apt install git
-
PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
-
Komodod - https://github.com/komodoplatform/komodo (you can use bootstrap from https://www.dexstats.info/bootstrap.php to speed things up)
-
Pip3:
sudo apt install python3-pip
thenpip3 install --upgrade setuptools wheel
-
Psychpg2
sudo apt-get install python-psycopg2
thensudo apt-get install python3-dev build-essential libpq-dev libgnutls28-dev gcc
-
mysql-client / connector
sudo apt-get install default-libmysqlclient-dev build-essential python3-mysql.connector
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)
-
pgsql credentials
-
django secret key
-
allowed hosts
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"
docker compose run web python3 manage.py createsuperuser --email [email protected] --username messiah
See https://docs.djangoproject.com/en/3.0/ref/django-admin/ for more django admin commands.
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
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.
- to make migrations, use
docker compose run web python3 manage.py makemigrations
- to apply migrations, use
docker compose run web python3 manage.py migrate
- to update static files, use
docker compose run web python3 manage.py collectstatic
docker exec -it <pgsql_container_name> bash
apt update & apt install nano
nano ./var/lib/postgresql/data/postgresql.conf
- change max_connections to 1000
- change max_wal_size to 2gb
- log_rotation_size to 100mb
docker compose run web python3 manage.py findstatic --verbosity 2 static
sudo nano /home/$USER/kmd_ntx_stats_docker/postgres-data/pg_hba.conf
sudo chown $USER:$USER /home/$USER/kmd_ntx_stats_docker/postgres-data -R
docker system prune -a --volumes