π‘ Overview
DV.net Merchant Backend is a high-load, self-hosted payments platform for accepting, processing, and sending cryptocurrency. The stack is fully open source, runs on your own infrastructure, and keeps you in control of every transaction.
π Non-custodial β private keys always stay on your side
β‘ High-performance β Go 1.24, Fiber v3, PostgreSQL & Redis
π Wide coverage β multiple blockchains and centralized exchanges
π§± Modular β clean architecture with delivery β service β storage
β¨ Highlights
π― Business capabilities
- β
Accept and send crypto without mandatory KYC/KYB
- β
Notifications, webhooks, and flexible event routing
- β
Fee management plus TRON/EVM resource optimization
- β
Integrations with major CEXs (Binance, OKX, HTX, KuCoin, Bybit, etc.)
π§ Technical features
- β
Fiber v3 HTTP API with Casbin-based RBAC
- β
Async workers and schedulers in
internal/app
- β
Service layer with DI and business logic (
internal/service)
- β
PostgreSQL / Redis repositories (
internal/storage)
- β
Automated SQL generation (
sqlc, pgxgen)
- β
Rich helper packages in
pkg (clients, retry, OTP, AML)
π§ Architecture at a Glance
cmd/ CLI entrypoints (server, migrations, utilities)
configs/ Config templates and Casbin policies
internal/app App bootstrap and background jobs
internal/delivery HTTP handlers, middleware, routing
internal/service Business logic, integrations, events
internal/storage PostgreSQL/Redis repositories
pkg/ External clients and shared libraries
sql/ SQL modules, migrations, code generation
Diagrams and Swagger specs live in docs/ (swagger.yaml, swagger.json).
π Getting Started
Self-hosted install (one command)
sudo bash -c "$(curl -fsSL https://dv.net/install.sh)"
Developer Docker bundle
git clone --recursive https://github.com/dv-net/dv-bundle.git
cd dv-bundle && cp .env.example .env
docker compose up -d
Manual backend build
git clone https://github.com/dv-net/dv-merchant.git
cd dv-merchant
make build
The binary github.com/dv-net/dv-merchant will appear in .bin/ once the build finishes.
π§ͺ Development & Testing
Pre-commit checklist
- Run linting and formatting to keep the codebase consistent.
- Execute unit tests and make sure critical flows are covered.
- Add or update tests when shipping new features or fixes.
# Static analysis & formatting
make lint
go fmt ./...
# Unit tests
make test
βΉοΈ Extended workflows (make run, Docker Compose, etc.) are documented in the dv-bundle repo (README.md) and on https://docs.dv.net.
π CLI Commands
.bin/dv-merchant start β run the HTTP API server.
.bin/dv-merchant migrate up|down β apply or roll back DB migrations.
.bin/dv-merchant seed up|down β load or drop seed data.
.bin/dv-merchant config β validate config and generate env/flags.
.bin/dv-merchant permission β manage roles and Casbin policies.
.bin/dv-merchant transactions β tooling for transaction operations.
.bin/dv-merchant users β manage users from the console.
π Documentation
π Security Features
- π Non-custodial design β you control keys and addresses.
- π§ Multisig support and TRON resource delegation.
- π‘οΈ Casbin RBAC with flexible
configs/rbac_* policies.
- π Full audit trail: events, logging, Prometheus metrics.
π€ Contributing
# Before submitting a PR
make lint
go test ./...
- β Star the repo if it helps your project.
- π Report bugs via Issues.
- π‘ Propose new features and use cases.
- π§ Pull Requests are welcome!