Backend Setup
Welcome to Backend Setup!
To setup up Algebra Protocol Backend please follow these instructions:
1. Create .env file using .env.example
Basically for local start up you can just copy the .env.example as it is
For production you should change .env:
set BACKEND_SETTINGS_MODE to
productionset HTTP_TEMPLATE_DIR to
/etc/nginx/templates/sslchange all passwords to secure
change variables with host, ports, etc. as required
2 Place SSL certificates to the ./docker/nginx/ssl dir
Files have to be named exactly as in ./docker/nginx/templates/ssl/[template]
3 Start the project
docker compose -f [docker-compose_file] up --build -dFor local development you should use docker-compose.local.yml and for production - docker-compose.yml (or leave file argument empty)
4 Run some commands inside the Django container
Firstly connect to the container with Django. [container] is equal to either dev-backend or backend
docker compose -f [docker-compose_file] exec [container] bashThen run this inside the container
python manage.py makemigrationsAfter the migrations are created you have to apply them
python manage.py migrateThen run this command to collect static files for nginx to be able to serve them
python manage.py collectstaticCreate a superuser to be able to access admin site
python manage.py createsuperuser5 Add network with subhraphs
Go to the
[HOST]:[PORT]/admin(if you started a local version it should belocalhost/admin)Login with the credentials that you used in the previous step
Go to the Networks tab
Click Add Network
Enter the links to 3 subgraphs
Click Save
Additional info
All the amounts are displayed as MATIC but are not converted into Matic exactly. This is just a name to the native tokens (since we deployed to the Polygon)
Update tasks
Default settings are:
Pools APR are calculated every 1 minute
Farmings APR are calculated evey 1 minute
To change the schedule:
Go to admin site
Go to Periodic tasks tab
Choose interested task
Change Interval Schedule in the Schedule section
If there is no required interval setting you can add it with
+button near it