sudo apt update && sudo apt install -y makebrew install makesudo apt update && sudo apt install -y docker.io docker-composebrew install docker docker-composeEnsure that the Docker daemon is running before proceeding.
Create a .env file in the root directory near docker-compose.local.yml and add the following environment variables:
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin
POSTGRES_DB=k1core
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=adminCreate a .env file in the backend directory (near Makefile) with the following configuration:
Generate a secret key for AUTHENTICATION__ACCESS_TOKEN__SECRET_KEY using the following command:
python3 -c "import secrets; print(f'AUTHENTICATION__ACCESS_TOKEN__SECRET_KEY={secrets.token_hex(32)}')"
python3 -c "import secrets; print(f'SECRET_KEY={secrets.token_hex(32)}')"DEBUG=False
STATE=local
SECRET_KEY=<DJANGO_SECRET_EKY>
DATABASE__URI=postgres://admin:admin@localhost:5432/k1core
BROKER__URI=amqp://admin:admin@localhost/
AUTHENTICATION__ACCESS_TOKEN__SECRET_KEY=<AUTHENTICATION__ACCESS_TOKEN__SECRET_KEY>Create a .env file for each worker (Blockchair /workers/blockchair/.env and CoinMarketCap /workers/coinmarketcap/.env) near their respective Makefile:
BROKER_URI=amqp://admin:admin@localhost:5672
TIMEOUT=5
# Optional Proxy
# PROXY=<PROXY>Run the following command to start the required services (PostgreSQL, RabbitMQ, etc.):
docker compose -f docker-compose.local.yml up -dRun the following command to set up all required dependencies:
make setup-local
make start-localmake start-localFor each worker (Blockchair and CoinMarketCap), run:
make setup-local
make startCreate a .env file in the root directory near docker-compose.dev.yml and add the following environment variables:
POSTGRES_USER=<your_postgres_user>
POSTGRES_PASSWORD=<your_postgres_password>
POSTGRES_DB=<your_database_name>
RABBITMQ_DEFAULT_USER=<your_rabbitmq_user>
RABBITMQ_DEFAULT_PASS=<your_rabbitmq_password>
BACKEND__DEBUG=False
BACKEND__STATE=dev
BACKEND__TCP_PORT=8200
BACKEND__SECRET_KEY=<your_backend_secret_key>
BACKEND__AUTHENTICATION_ACCESS_TOKEN_SECRET_KEY=<your_authentication_secret_key>
WORKER_BLOCKCHAIR__TIMEOUT=60
WORKER_BLOCKCHAIR__PROXY=<your_proxy_url>
WORKER_COINMARKETCAP__TIMEOUT=60docker compose -f docker-compose.dev.yml up -d --build- Stop all services:
docker compose -f docker-compose.local.yml down
- Create admin in
backendapp:docker compose -f docker-compose.dev.yml exec backend make create-admin - Check logs for multiple services (backend, rabbitmq, postgres):
docker compose -f docker-compose.local.yml logs -f backend rabbitmq postgres