Aegis is a Go backend for orchestrating EVM-compatible transfer workflows. It exposes a transfer API, persists workflow state in PostgreSQL, dispatches transfer work asynchronously through RabbitMQ, uses Redis to reduce duplicate processing, delivers outbound status webhooks, and provides internal operational endpoints for wallet and reconciliation workflows.
Use the README as the project entrypoint. The detailed system design, delivery guarantees, and security controls now live in the documents above.
- Accepts transfer requests with idempotency keys.
- Persists transfer state and status history in PostgreSQL.
- Dispatches transfer jobs asynchronously through a transactional outbox.
- Tracks durable blockchain submission attempts so retries can resume from stored state.
- Schedules and delivers transfer status webhooks with retry and lease-based claiming.
- Provides internal wallet and reconciliation endpoints for operational workflows.
- The transfer processor is wired for blockchain submission, but the default signer and broadcaster are mocks in
internal/modules/transfers/mocks.go. - Reconciliation uses a placeholder receipt checker in
internal/modules/reconciliation/checker.go; it is not a real on-chain receipt poller yet. - There is no automatic confirmation watcher in the worker today.
CONFIRMEDstate is driven by reconciliation, not by a dedicated listener. - Queue publish, blockchain submission recovery, and webhook delivery remain at-least-once workflows. See the Reliability Model for the exact guarantees.
- Go
1.20+ - Docker and Docker Compose
psqlif you want to apply migrations manually from the shell
cp .env.example .envReview .env before running the stack, especially:
INTERNAL_AUTH_API_KEYWEBHOOK_SIGNING_SECRETCALLBACK_URL_ALLOWED_HOSTSCALLBACK_URL_ALLOW_PRIVATE_TARGETSEVM_RPC_URL
docker compose up -d postgres redis rabbitmqRabbitMQ management UI is exposed at http://127.0.0.1:15672.
The repo ships raw SQL migrations under migrations/. Apply them in filename order:
for f in migrations/*.up.sql; do
psql "postgres://aegis:aegis@127.0.0.1:5432/aegis?sslmode=disable" -f "$f"
donego run ./cmd/apigo run ./cmd/workerWhen enabled, the worker health endpoint is exposed at http://127.0.0.1:8081/healthz by default.
cp .env.example .env
docker compose up --buildgo test ./...
go test ./internal/modules/transfers ./internal/modules/webhooks ./internal/transport/httpImportant environment variables are defined in .env.example.
DATABASE_URL: PostgreSQL connection string.RABBITMQ_URL: RabbitMQ connection string.REDIS_ADDR: Redis address for duplicate-processing locks.EVM_RPC_URL: RPC endpoint used by the EVM adapter and health checks.EVM_CHAIN_ID: expected chain ID for RPC validation.
WORKER_TRANSFER_MAX_RETRIESWORKER_TRANSFER_RETRY_DELAYWORKER_TRANSFER_PROCESS_LOCK_TTLWORKER_TRANSFER_OUTBOX_POLL_INTERVALWORKER_TRANSFER_OUTBOX_BATCH_SIZEWORKER_TRANSFER_OUTBOX_RETRY_DELAYWORKER_TRANSFER_OUTBOX_PROCESSING_AFTERWORKER_WEBHOOK_POLL_INTERVALWEBHOOK_TIMEOUTWEBHOOK_MAX_ATTEMPTSWEBHOOK_INITIAL_BACKOFFWEBHOOK_BATCH_SIZEWEBHOOK_LEASE_DURATION
INTERNAL_AUTH_HEADERINTERNAL_AUTH_API_KEYCALLBACK_URL_ALLOWED_HOSTSCALLBACK_URL_ALLOW_PRIVATE_TARGETSWEBHOOK_SIGNING_SECRETWEBHOOK_RESPONSE_BODY_MAX_BYTES
See the Reliability Model and Security Model for the behavioral impact of these settings.
GET /healthzPOST /api/v1/transfersGET /api/v1/transfers/:idGET /api/v1/transfers
These routes require the internal auth header and API key:
POST /api/v1/walletsGET /api/v1/walletsGET /api/v1/wallets/:idPOST /api/v1/jobs/reconcileGET /api/v1/reconciliation/mismatches
- Architecture for the request lifecycle, worker topology, and data model.
- Reliability Model for retry semantics, duplicate prevention, lease fencing, and tradeoffs.
- Security Model for internal auth, webhook signing, callback validation, and SSRF boundaries.