Skip to content

DRF app with smart contract events parsing via Celery + web3 authentication

Notifications You must be signed in to change notification settings

shitcoding/drf_web3_auth

Repository files navigation

DRF app with web3 authentication


Usage

  1. make env to create .env file from .env.example template
  2. Add/change credentials/settings in .env file
  3. make up - launch app (starts all required services: DRF app, Postgres DB, Redis, Celery worker/beat)

After launch:

  • make create-superuser - to create Django superuser with your credentials
  • make create-test-superuser - to automatically create test superuser with predefined credentials

Endpoints

  • /api/events/ - get the paginated list of smart contract events parsed to Django database
  • /api/message/<str:eth_address>/ - get one-time message to sign for web3/JWT authorization
  • /api/auth/web3/ - get JWT refresh/access tokens using signed message

Tests

  • testing endpoint generating one-time message to sign
  • testing signature verification
  • testing JWT authorization and accessing restricted endpoint
  1. Spin up the services and create env file
make env && make up
  1. Run: make test-api

About

DRF app with smart contract events parsing via Celery + web3 authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published