Real-time EVM wallet, token-approval, and smart-contract event monitoring β with alerts, signed webhooks, and multi-chain support.
chainsentinel-demo.mp4
βΆ 90-second walkthrough of the live app β real database records. (download the MP4)
ChainSentinel watches wallets and smart contracts on Ethereum, BNB Smart Chain, Polygon, Base, Arbitrum and Optimism (testnets first-class). A Celery-powered engine ingests blocks in order, deduplicates every event with database-enforced idempotency keys, tracks confirmation depth, survives chain reorganizations, and fans alerts out to dashboards, email and HMAC-signed webhooks. Built as a production-grade multi-tenant SaaS β not a demo.
Monitoring
- π Wallet monitors β native, ERC-20 and NFT (ERC-721) transfers with direction, token and minimum-value filters; EIP-55 validation and per-workspace duplicate prevention
- π‘ Approval security β detect approvals created / changed / revoked and
ApprovalForAlloperator grants β the events drain attacks rely on - π Large-movement thresholds β flag threshold-breaking transfers and auto-escalate their severity
- π Contract monitors β paste any ABI: events are extracted, signature/topic0 hashes generated, logs decoded, indexed-parameter filters applied; malformed data never crashes ingestion (raw logs preserved with the decode error)
- π₯ CSV import/export for wallet monitors with row-level validation reports
Engine
- βοΈ Ordered block processing under per-chain distributed locks β horizontally scalable workers with zero duplicate processing
- π§Ύ Idempotent everything β events, alerts, notifications and webhook deliveries all carry unique dedupe keys enforced by the database
- β Reorg-aware β a rolling block-hash ring detects forks, reverts orphaned events, records the incident and reprocesses from the fork point
- β
Confirmation tracking β events stay
PENDINGuntil their per-monitor confirmation depth is reached - π RPC failover β prioritized providers, per-minute health probes, exponential backoff, rate-limit awareness and automatic recovery
Alerting & delivery
- π¨ Rule engine with filters on monitor, chain, event type, token, amount range, addresses and topic β plus cooldowns, debounce and burst-grouping with occurrence counters
- π In-app notifications with per-user severity preferences; email for critical alerts, failed webhooks, provider outages and daily digests
- β Webhooks signed with HMAC SHA-256 (
t=β¦,v1=β¦+ timestamp header), SSRF-guarded egress, persistent exponential retries, full delivery history and one-click replay
Platform
- π₯ Multi-tenant workspaces with Owner / Admin / Analyst / Viewer roles and strict object-level isolation
- π Scoped API keys (read / write), SHA-256 hashed, shown exactly once
- π Analytics from real aggregates: events by chain, alerts by severity, top wallets, webhook delivery trends
- π§ Versioned REST API with OpenAPI schema + Swagger UI, consistent error envelope, throttling
- π Full audit log of security-relevant actions, surfaced to workspace admins
Dark theme (a light theme is on the roadmap).
Landing page ![]() |
Event explorer ![]() |
Analytics ![]() |
Wallet monitors ![]() |
Contract monitors ![]() |
Alerts ![]() |
Webhooks ![]() |
Sign in ![]() |
| Layer | Technology |
|---|---|
| Frontend | Next.js 15 (App Router) Β· TypeScript Β· Bootstrap 5 Β· SCSS design tokens Β· React Hook Form + Zod Β· Chart.js |
| Backend | Python 3.12+ Β· Django 5.2 Β· Django REST Framework Β· SimpleJWT (HttpOnly cookies) Β· drf-spectacular |
| Workers | Celery + Celery Beat Β· Web3.py Β· Redis broker |
| Data | PostgreSQL (single source of truth) Β· Redis (cache, queues, locks, throttles only) |
| Infra | Docker Compose (7 services) Β· Nginx Β· Gunicorn Β· Next standalone output |
Browser βββΊ Nginx (prod) βββΊ Next.js (public site + dashboard SPA β never touches the DB)
ββββββΊ Django + DRF (/api/v1 β auth, tenancy, config, storage)
β
βββ PostgreSQL β source of truth
βββ Redis β cache Β· locks Β· throttles Β· Celery broker
βββ Celery workers + Beat
ββ poll blocks (per-chain lock, ordered, checkpointed)
ββ decode & dedupe events (unique idempotency keys)
ββ confirmations + reorg revert/rewind/reprocess
ββ alert rules β notifications / email
ββ HMAC-signed webhook delivery (+ retries, replay)
β
βΌ
EVM chains via prioritized failover RPC providers
Key decisions β per-event confirmation snapshots, block-hash ring reorg detection, DB-enforced idempotency, SSRF-guarded webhook egress, cookie-JWT auth with CSRF β are documented with rationale in docs/ARCHITECTURE.md and PROJECT_FLOW/PROJECTFLOW.md.
git clone https://github.com/Eazydev-CEO/chainsentinel.git
cd chainsentinel
cp .env.example .env # placeholders boot fine for a first run
docker compose up --build| Service | URL |
|---|---|
| Frontend | http://localhost:3026 |
| REST API | http://localhost:8212/api/v1/ |
| Swagger UI | http://localhost:8212/api/v1/docs/ |
| Django admin | http://localhost:8212/admin/ |
Seed demo data (chains, a demo workspace, clearly-labelled sample records):
docker compose exec backend python manage.py seed_dev
docker compose exec backend python manage.py createsuperuser # for /adminSign in with demo@chainsentinel.local / DemoPass123! (configurable via SEED_DEMO_PASSWORD).
To ingest real blocks, add a testnet RPC URL to .env (e.g. RPC_ETHEREUM_SEPOLIA_HTTP=https://β¦ from any free provider tier) and re-run seed_dev. Mainnet chains are seeded inactive by design.
# Backend β Python 3.12+, PostgreSQL & Redis running locally
cd backend
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements/development.txt
python manage.py migrate && python manage.py seed_dev
python manage.py runserver 8212
# Workers (separate shells)
celery -A config worker -l info -Q default,engine,delivery
celery -A config beat -l info
# Frontend
cd frontend && npm install && npm run dev # http://localhost:3026, /api proxied to :8212Copy .env.example β .env. Highlights (full reference: docs/ENVIRONMENT.md):
| Variable | Purpose |
|---|---|
DJANGO_SECRET_KEY |
Django signing key β long & random in production (boot fails otherwise) |
POSTGRES_* / REDIS_URL |
Data stores |
RPC_<CHAIN>_HTTP |
Per-chain RPC endpoints β testnets for local dev, blank keeps the provider inactive |
WEBHOOK_ENCRYPTION_KEY |
Fernet key encrypting webhook secrets at rest (required in production) |
SMTP_* |
Email delivery β console backend in dev when unset |
ENGINE_* / RETENTION_* |
Poll cadence, batch size, data-retention windows |
Secrets live in the environment only β nothing is hardcoded, and .env is git-ignored.
Versioned REST API under /api/v1/ with interactive documentation at /api/v1/docs/ (Swagger UI / OpenAPI via drf-spectacular).
- Auth: HttpOnly-cookie JWT sessions (browser) with CSRF protection and refresh rotation, or workspace-scoped API keys via
X-Api-Keyfor integrations - Resources:
authΒ·workspacesΒ·membersΒ·chainsΒ·provider-healthΒ·wallet-monitorsΒ·contract-monitorsΒ·eventsΒ·alertsΒ·alert-rulesΒ·webhooksΒ·webhook-deliveriesΒ·notificationsΒ·api-keysΒ·audit-logsΒ·analytics - Conventions: pagination, filtering, search and ordering on list endpoints; scoped throttles; a consistent error envelope
{"error": {"code", "message", "details"}}
curl -H "X-Api-Key: cs_xxxxxxxx_..." \
"http://localhost:8212/api/v1/events/?chain=ethereum-sepolia&event_type=approval_created"Guide with examples: docs/API.md Β· Webhook payloads & signature verification: docs/WEBHOOKS.md
Read-only by design β no private keys are ever stored and no transactions are ever sent.
- HttpOnly-cookie JWTs with refresh rotation + blacklist; CSRF enforced on cookie-authenticated writes; per-device session management
- Strict multi-tenant isolation β every workspace-scoped query passes membership + role checks; cross-tenant IDs 404
- API keys hashed (SHA-256), constant-time compared, scope-limited, revocable
- Webhook egress SSRF protection: scheme/port allowlists, DNS resolution checks, private/metadata IP blocking, no redirect following β validated at save and send time
- Webhook secrets Fernet-encrypted at rest and shown exactly once; HMAC SHA-256 payload signing with timestamp headers
- Rate limiting at nginx and DRF layers; login/reset/registration throttles; secrets redacted from logs and audit metadata
- Security headers (CSP, HSTS-ready, frame-deny) at nginx, Django and Next layers
Full threat model and control inventory: docs/SECURITY.md
cd backend && pytest # 175 tests, ~4s β Web3 fully mocked, zero network
cd frontend && npm run build # strict type-check + production buildThe suite covers the engine (dedupe across crash-rewind, confirmations, reorg revert/reprocess), RPC failover and backoff, alert cooldown/debounce/grouping, webhook HMAC + SSRF matrix + retry schedules, workspace permission matrices, API-key scopes, CSV import validation and the full cookie/CSRF auth flow. Details: docs/TESTING.md. CI runs both suites on every push.
βββ frontend/ Next.js app (App Router)
β βββ app/ (public) site Β· (auth) flows Β· app/ dashboard
β βββ components/ UI kit, charts, forms, dialogs
β βββ lib/ API client, auth/workspace contexts, formatting
β βββ services/ typed API call layer
β βββ types/ shared API types
βββ backend/ Django project
β βββ config/ settings (base/dev/prod/test), Celery app, URLs
β βββ apps/ accounts Β· workspaces Β· chains Β· monitors Β· events
β β alerts Β· webhooks Β· notifications Β· audit Β· api
β βββ tests/ pytest suite with in-memory Web3 fakes
βββ docker/ nginx config, entrypoints
βββ docs/ architecture, API, security, ops documentation
βββ docker-compose.yml development stack (7 services)
βββ docker-compose.production.yml
- Light theme
- Billing integration (plans are already modelled)
- Telegram & Slack alert channels (placeholders wired in the rule engine)
- WebSocket
newHeadsfast-path enabled by default - ERC-1155 support and NFT metadata enrichment
- Anomaly scoring on approval patterns
- Public status page per workspace
| Doc | Contents |
|---|---|
| docs/ARCHITECTURE.md | System design, engine pipeline, failover, reorg handling |
| docs/DATABASE.md | Every model, constraint and index |
| docs/API.md | REST API guide, auth, examples |
| docs/WEBHOOKS.md | Payloads, signature verification, retries |
| docs/SECURITY.md | Threat model and implemented controls |
| docs/ENVIRONMENT.md | Every environment variable |
| docs/DEPLOYMENT.md | Production deployment, TLS, backups |
| docs/TESTING.md | Suite layout and how to extend it |
| docs/RUNBOOK.md | Incident response and operations |
| docs/SUPPORTED_CHAINS.md | Chain matrix, adding chains/providers |
| CONTRIBUTING.md | Engineering rules and conventions |
| PROJECT_FLOW/PROJECTFLOW.md | Build log and design-decision record |
Released under the MIT License.
Ezekiel Obiajulu β @Eazydev-CEO
Full-stack engineer focused on backend systems, blockchain infrastructure and automation. If this project is useful to you, a β is appreciated.









