A node.js service to manage ethereum blockchain subscriptions and alert on specific events.
The service exposes a REST API for:
The service has two async jobs:
The system has no concept of passwords.
Authentication is done by calling the login endpoint which:
/verify
endpoint a long lived auth token allows interaction with the full APIHence, two auth scopes are defined:
Tokens are stateful, i.e. they're validated on every request. So even though we use JWT tokens, they can be invalidated from the DB.
$ docker run -d -p 5433:5432 --name postgres postgres
$ docker exec -i -t postgres createuser -h localhost -U postgres --superuser notification-service
$ docker exec -i -t postgres createdb -h localhost -U postgres --owner notification-service notification-service
Secrets are stored in .env
file. For a list of required environment variables check .env.example
$ cp .env.example .env
# update .env with secrets
docker build -t notification-service .
This will run the container and mount the .env
runtime config at runtime
docker run -it -p 5000:5000 -v $(pwd)/.env:/app/.env notification-service
To update use https://draw.io and open the db.drawio
file in the repository.
For CI/CD we are using GitHub Actions.
Production build is configured to trigger when creating v*
tags in the master
branch. Executing the following:
git tag v0.1.0
git push --tags
Will deploy the following container: docker.pkg.github.com/aragonone/notification-service/app:v0.1.0