cp .env.example .env
Adjust the .env
values according to your needs, source it, so it is available in your current environment.
source .env
If using zsh (for example, on macOS), you may need to mark variables for export,
before calling any make
target:
set -a; source .env; set +a
docker compose build
docker compose up
make venv
Activate this virtual environment:
source venv/bin/activate
Execute deactivate
to exit out of the virtual environment.
Then use the build
Make target to get all requirements fetched and compiled:
make build
Make sure you have:
The following starts the data stores used by this project: PostgreSQL.
make start-postgres
The following starts the data stores used by this project: Redis.
make start-redis
Both together:
make start-databases
To stop the data stores, use Docker Compose:
docker-compose down postgres
docker-compose down redis
make start-dev
Some make commands can be used w/ or w/o docker for the app container:
start-app
, start-dev
, test
, run-migration
DATABASE_HOST
has to point to the name of the postgres container:
DATABASE_HOST=postgres
)make test
make test use-docker=true
If your blockchain is running and setup in .env under BLOCKCHAIN_URL
you can start the event listener by running:
make start-listener
It will sync the database with the chain and try to fetch a new block every BLOCK_CREATION_INTERVAL
seconds.
API documentation: /redoc/
development
production
for prod8000
http://127.0.0.1:8000
0.0.0.0
postgres
when working w/ dockercore
5432
postgres
postgres
alerts.slack
logger/update-config/
endpointConfig-Secret
6
seconds5,10,30,60,120
seconds/config/
endpoint/config/
endpoint
FILE_UPLOAD_CLASS:
"core.file_handling.aws.s3_client"
def upload_file(self, file, storage_destination=None) -> Optional[str]:
"""
Args:
file: file to upload (file-like obj, readable)
storage_destination: pathstr / folder name. e.g.: "folder_1/folder_2/my_file.jpeg"
Returns: url of uploaded file """
hexdigest()
.2_000_000
2 mbFILE_UPLOAD_CLASS
: core.file_handling.aws.s3_client