- 🚀 Getting Started — Setup development environment
- 🔄 Development Workflow — Branch strategy and workflow
- 📐 Coding Standards — Code style and conventions
- 🧪 Testing — Testing requirements and guidelines
- 💬 Commit Messages — Commit message format
- 🔀 Pull Request Process — PR submission and review
- 🐛 Issue Reporting — How to report bugs
- 🔒 Security — Security vulnerability reporting
- 👀 Code Review — Review process and criteria
- 🏷️ Release Process — Versioning and releases
- Go 1.24.2+ — Download
- PostgreSQL — Database operations
- Make — Build commands
- Git — Version control
# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/dv-processing.git
cd dv-processing
# 2. Add upstream remote
git remote add upstream https://github.com/dv-net/dv-processing.git
# 3. Install development tools
make install-dev-tools
# 4. Build and verify
make build
make fmt
make lint💡 Tip: Run
go mod downloadif dependencies are missing
- 🌿
main— Production-ready stable code - 🔧
dev— Active development branch - 🌱
feature/*— New features (target:devormain) - 🐛
fix/*— Bug fixes (target:dev)
# 1. Update main branch
git checkout main
git pull upstream main
# 2. Create feature branch
git checkout -b feature/your-feature-name
# 3. Make changes, then verify
make fmt
make lint
⚠️ Important: Always create PRs from feature branches, never frommainordev
Follow Effective Go and project conventions:
- Formatting —
gofumpt(viamake fmt) - Imports —
goimportsfor organization - Naming — Go naming conventions
- Errors — Explicit handling required
- Documentation — Document all exported functions/types
# Run linter
make lintThe project uses golangci-lint with strict rules. All linter errors must be resolved before submitting PRs.
cmd/ CLI entrypoints
internal/ Internal packages (not for external use)
├── handler/ HTTP/gRPC handlers
├── services/ Business logic
├── store/ Repositories and data access
├── config/ Configuration management
├── fsm/ Finite state machines for blockchains
└── ...
pkg/ Shared libraries (for external use)
api/ Generated API code
schema/ Protocol buffer definitions
sql/ Database migrations and queries
- 🚫 Transactions — Use proper transaction management via store layer
- ✅ Structs — Initialize all struct fields in constructors
- ✅ Naming — Use
snake_casefor JSON/YAML fields - ✅ Size — Functions < 180 lines (handlers configurable)
- ✅ Complexity — Cyclomatic complexity < 60
- ✅ Generated Code — Never edit generated files directly (
.pb.go,.sql.go,.connect.go)
- ✅ New Features — Must include tests
- ✅ Bug Fixes — Must include regression tests
- ✅ Framework — Use
testifyfor assertions - ✅ Naming — Test files:
*_test.goin same package
# Run all tests
go test ./...
# Run specific package
go test ./internal/service/package
# Run with coverage
go test -cover ./...
# Run with verbose output
go test -v ./...🎯 Target: 80%+ coverage for new code
Focus on testing business logic and edge cases
Follow Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
feat— New featurefix— Bug fixdocs— Documentation changesrefactor— Code refactoringperf— Performance improvementstest— Adding or updating testschore— Maintenance taskssecurity— Security fixes
feat(transfers): add Bitcoin Cash transfer support
Add support for Bitcoin Cash transfers with proper
error handling and retry logic.
Closes #123# 1. Update your branch
git checkout main
git pull upstream main
git checkout your-branch
git rebase upstream/main
# 2. Run all checks
make fmt
make lintStep 1: Push your branch
git push origin your-branchStep 2: Create PR on GitHub
- Target:
mainordevbranch - Title: Clear and descriptive
- Description: Include what changed and why
- Issues: Link related issue numbers
Step 3: Verify requirements
- ✅ Code style — Follows project guidelines
- ✅ Linting —
make lintpasses - ✅ Documentation — Updated if needed
- ✅ Conflicts — No merge conflicts
- ✅ Commits — Follow conventions
- ✅ Generated Code — Regenerated if schema/proto changed
- Initial Review — Within 48 hours
- Follow-up — Within 24 hours
- CI Checks — Must all pass
- Branch Status — Keep updated with target
💡 Tip: Address review comments promptly and keep your branch rebased
- 🔍 Duplicates — Check existing issues
- 🌿 Branch — Verify in latest
mainordev - 📦 Version — Ensure using latest version
When creating an issue, include:
- OS and Version — Your environment details
- Go Version —
go versionoutput - Steps to Reproduce — Clear, numbered steps
- Expected Behavior — What should happen
- Actual Behavior — What actually happens
- Logs — Relevant error logs
- Configuration — Relevant config (sanitized)
📝 Note: The more details you provide, the faster we can help
⚠️ IMPORTANT: DO NOT create public issues for security vulnerabilities.
- 📧 Email — support@dv.net
- 📋 Details — Include detailed vulnerability information
- ⏱️ Disclosure — Allow time for fix before public disclosure
🔐 Security issues are handled privately to protect users
- ✅ Code Quality — Style and best practices
- ✅ Test Coverage — Adequate test coverage
- ✅ Documentation — Updated documentation
- ✅ Security — Security considerations
- ⚡ Performance — Performance impact
- 🔄 Compatibility — Backward compatibility
- Initial Review — 48 hours
- Follow-up Reviews — 24 hours
- Merge Decision — 1 week (for approved PRs)
- Stable —
vX.X.X(production releases) - RC —
vX.X.X-RC1(release candidates)
1. Development in feature branches
2. Testing and stabilization
3. Merge to main
4. Tag stable release: vX.X.X
# Create new migration
make db-create-migration migration_name
# Apply migrations
make migrate up
# Rollback migrations
make migrate down# Generate SQL code
make gensql
# Generate Protocol Buffers
make genproto
# Generate ABI bindings
make genabi
# Generate all (SQL + Proto + ABI + Envs)
make gen
# Generate environment variables documentation
make genenvs
⚠️ Warning: Never edit generated files directly. Always update source files:
- SQL queries:
sql/postgres/queries/*.sql- Protocol definitions:
schema/**/*.proto- ABI files:
pkg/walletsdk/**/*.abi
# Build and run
make start
# Or run directly
go run ./cmd/app start -c config.yaml
# Run webhooks server
make webhooks# Install all development tools
make install-dev-tools
# Watch for changes (hot reload)
make watch
# Format code
make fmt
# Run linter
make lint
# Generate README from config
make genreadme- 📖 Documentation — docs.dv.net
- 🔌 API Reference — See
api/directory - 🧾 Swagger — See
api/api.swagger.json - 💬 Support — dv.net/support
- 📱 Telegram — @dv_net_support_bot
The project supports multiple blockchains:
- EVM-based: Ethereum, BSC, Polygon, Arbitrum, Optimism, Linea
- UTXO-based: Bitcoin, Litecoin, Bitcoin Cash, Dogecoin
- Tron: Native Tron blockchain
When adding new blockchain support:
- Add configuration in
internal/config/ - Implement FSM in
internal/fsm/ - Add wallet SDK support in
pkg/walletsdk/ - Update blockchain constants in
internal/constants/
Blockchain processing uses finite state machines (FSM) located in internal/fsm/. Each blockchain has its own FSM implementation.
- Uses PostgreSQL with
pgx/v5driver - Migrations in
sql/postgres/migrations/ - Queries in
sql/postgres/queries/ - Code generation via
sqlcandpgxgen
- Definitions in
schema/processing/ - Generated code in
api/processing/ - Use
buffor linting and generation
Thank you for contributing to DV Processing! 🙏
Your contributions make this project better for everyone.