processing

package module
v0.9.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 1 Imported by: 0

README ΒΆ

βš™οΈ DV Processing


🌐 Website β€’ πŸ“– Docs β€’ πŸ”Œ API β€’ πŸ’¬ Support


πŸ’‘ Overview

DV Processing is the blockchain engine behind the DV.net ecosystem β€” a high-performance, multi-chain service that creates wallets, executes transfers, and tracks on-chain activity across 11 blockchains. Written in Go, it exposes a ConnectRPC/gRPC API and is designed to run on your own infrastructure.

πŸ”’ Non-custodial β€” private keys and mnemonics never leave your server

⚑ High-performance β€” ConnectRPC/gRPC, PostgreSQL, River queue

🌐 Multi-chain β€” 11 blockchains: EVM, UTXO and Tron

🧱 Modular β€” FSM workflows, clean service layer, event-driven architecture


✨ Highlights

🎯 Blockchain capabilities

  • βœ… Hot, cold, and processing wallet management per owner
  • βœ… Transfer processing with per-chain finite state machines
  • βœ… Tron resource delegation (energy & bandwidth) and activation contracts
  • βœ… EVM gas price limits and fee control per network
  • βœ… Bitcoin-family UTXO management with configurable fee-per-byte
  • βœ… Block scanning and explorer proxy integration

πŸ”§ Technical features

  • βœ… ConnectRPC/gRPC API with request signing and authentication interceptors
  • βœ… Background job processing via River queue
  • βœ… Webhook delivery with retries, cleanup workers, and configurable TTL
  • βœ… PostgreSQL storage with type-safe queries (sqlc + pgxgen)
  • βœ… Protobuf-first API design with buf code generation
  • βœ… Systemd deployment out of the box

🧭 Architecture at a Glance

cmd/                  CLI entrypoints (server, webhooks)
internal/
  handler/            ConnectRPC request handlers
  services/           Business logic (clients, owners, wallets, transfers, webhooks)
  fsm/                Finite state machines per blockchain (tron, evm, btc, ltc, bch, doge)
  workflow/           Workflow engine with stages, steps, and retries
  store/              PostgreSQL repositories (sqlc-generated)
  dispatcher/         Event dispatching
  taskmanager/        Background jobs (River)
  eproxy/             Explorer proxy client
  rmanager/           Resource manager (Tron delegation)
  watcher/            Blockchain watcher integration
  tscanner/           Transfer scanner
  escanner/           Explorer scanner
pkg/
  walletsdk/          Blockchain wallet SDKs (btc, ltc, bch, doge, evm, tron)
  postgres/           Database connection management
  encryption/         Encryption utilities
  retry/              Retry policies
schema/               Protobuf service definitions
sql/                  Migrations and SQL queries
artifacts/            Deployment configs (systemd, scripts)

πŸš€ Getting Started

Build from source

git clone https://github.com/dv-net/dv-processing.git
cd dv-processing

make build

The binary will appear at bin/processing.

Run locally

cp config.template.yaml config.yaml
# edit config.yaml with your database and node settings

make migrate up
make start

ℹ️ Full deployment guide and Docker Compose setup are available in the dv-bundle repo and at https://docs.dv.net.


πŸ›  CLI Commands

  • dv-processing start β€” start the gRPC/ConnectRPC server.
  • dv-processing migrate β€” run database migrations (up / down / drop).
  • dv-processing blockchain β€” blockchain tools (e.g. tron reclaim-resource).
  • dv-processing config β€” validate config, generate envs and flags.
  • dv-processing utils β€” utilities (systemd install, readme generation).
  • dv-processing version β€” print the current version.

πŸ’‘ Example β€” reclaim Tron resources

./dv-processing blockchain tron reclaim-resource \
  -pa TQ6DkBmxz3Zk7neh8mwmmkfJsVjrE9wwjY \
  -da TAoG3QdbgZ7saGBHiXVHRgdNJVpwUGqZZh \
  -type bandwidth

πŸ§ͺ Development & Testing

πŸ“¦ Install dev tools

make install-dev-tools

βš™οΈ Code generation

make gen          # run all generators (sql, proto, envs, abi)
make gensql       # regenerate sqlc queries
make genproto     # regenerate protobuf & ConnectRPC stubs
make genenvs      # regenerate environment variable docs

πŸ” Linting & formatting

make lint
make fmt

πŸ”„ Live reload

make watch        # uses air for hot reloading

πŸ“‹ Configuration

The service is configured via config.yaml (see config.template.yaml) and/or environment variables.

All environment variables are prefixed with PROCESSING_ and follow this structure:

Category Prefix Examples
πŸ“ Logging PROCESSING_LOG_* PROCESSING_LOG_LEVEL, PROCESSING_LOG_FORMAT
πŸ“Š Ops / Monitoring PROCESSING_OPS_* PROCESSING_OPS_METRICS_ENABLED, PROCESSING_OPS_HEALTHY_ENABLED
πŸ—„οΈ Database PROCESSING_POSTGRES_* PROCESSING_POSTGRES_ADDR, PROCESSING_POSTGRES_DB_NAME
πŸ”Œ gRPC Server PROCESSING_GRPC_* PROCESSING_GRPC_ADDR, PROCESSING_GRPC_REFLECT_ENABLED
⛓️ Blockchains PROCESSING_BLOCKCHAIN_* PROCESSING_BLOCKCHAIN_TRON_ENABLED
πŸ”” Webhooks PROCESSING_WEBHOOKS_* PROCESSING_WEBHOOKS_SENDER_ENABLED
πŸ’Έ Transfers PROCESSING_TRANSFERS_* PROCESSING_TRANSFERS_ENABLED

ℹ️ Full environment variable reference is auto-generated via make genenvs.


πŸ“¦ Deployment

Systemd

./dv-processing utils systemd

This generates and installs a systemd unit file for production deployments on Linux.


πŸ” Security

  1. πŸ”“ Non-custodial β€” mnemonics and private keys are encrypted at rest and never leave the server.
  2. ✍️ Request signing β€” all API calls are authenticated via signature-based interceptors.
  3. πŸ›‘οΈ Two-factor authentication β€” TOTP-based 2FA for sensitive owner operations.
  4. πŸ”‘ Encrypted storage β€” mnemonics and OTP secrets are encrypted in the database.

πŸ“‘ API Services

The ConnectRPC API exposes the following services on port 9000:

  • πŸ‘€ ClientService β€” merchant/client management and callback URLs
  • 🏠 OwnerService β€” owner creation, mnemonic management, 2FA
  • πŸ’³ WalletService β€” hot, cold, and processing wallet operations
  • πŸ’Έ TransferService β€” transfer creation and status tracking
  • βš™οΈ SystemService β€” system info, version checking, logs

Proto definitions are located in schema/processing/ and compiled with buf.


πŸ’ Donations

Support the development of the project with crypto:

USDT (Tron) β€” TCB4bYYN5x1z9Z4bBZ7p3XxcMwdtCfmNdN

Bitcoin β€” bc1qemvhkgzr4r7ksgxl8lv0lw7mnnthfc6990v3c2

TRON (TRX) β€” TCB4bYYN5x1z9Z4bBZ7p3XxcMwdtCfmNdN

Ethereum β€” 0xf1e4c7b968a20aae891cc18b1d5836b806691d47

πŸ”— Other networks and tokens (BNB Chain, Arbitrum, Polygon, Litecoin, Dogecoin, Bitcoin Cash, etc.) are available at payment form


πŸ“ž Contact

Telegram: @dv_net_support_bot β€’ Telegram Chat: @dv_net_support_chat β€’ Discord: discord.gg/Szy2XGsr

Email: [email protected] β€’ Website: dv.net β€’ Documentation: docs.dv.net


Β© 2026 DV.net β€’ DV Technologies Ltd.

Built with ❀️ for the crypto community

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var ReadmeFS embed.FS

Functions ΒΆ

This section is empty.

Types ΒΆ

This section is empty.

Directories ΒΆ

Path Synopsis
api
cmd
app command
webhooks command
internal
store/repos/repo_transfers
Code generated by pgxgen.
Code generated by pgxgen.
store/repos/repo_wallets_cold
Code generated by pgxgen.
Code generated by pgxgen.
store/repos/repo_wallets_hot
Code generated by pgxgen.
Code generated by pgxgen.
store/repos/repo_wallets_processing
Code generated by pgxgen.
Code generated by pgxgen.
pkg
avalidator
Address validator for blockchain wallets and addresses
Address validator for blockchain wallets and addresses

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL