A simple but secure crypto payments gateway, built with Golang.
- gRPC API for creating and managing crypto payment orders
- PostgreSQL database for order and payment address storage
- Blockchain wallet generation (currently supports USDC on Base)
- Dockerized development environment
- Code generation for database models (Jet) and gRPC (Protobuf)
server/- Main gRPC server implementationapi/proto/- Protobuf definitions for gRPC servicesapi/gen_proto/- Generated Go code from Protobufapi/gen_jet/- Generated database models and queries (Jet)client/- (Placeholder for client code)utils/- Utilities for blockchain and databasesql/- Database schemascripts/- Helper scripts for code and DB generation
- Copy
.env.exampleto.envand fill in your environment variables. - Start the database:
docker compose up -d
- Generate database models (Jet):
./scripts/generate_jet.sh
- Generate gRPC code:
./scripts/generate_proto.sh
- Run the server:
go run main.go
- gRPC endpoint:
localhost:8080 - Service:
OrderServiceCreateOrder(amount, currency)→ returns order ID, payment address, timestampsCheckOrderStatus(id)→ streaming response with order status updates and transaction hash
Both endpoints are fully implemented with database integration. The CheckOrderStatus endpoint provides real-time updates on payment status through server-side streaming.
See api/proto/order.proto for complete API definitions and server/order_service.go for implementation details of the OrderService.
- PostgreSQL, schema auto-initialized from
sql/schema.sql - Tables:
orders- Stores order information including status and transaction hashpayment_addresses- Securely stores cryptocurrency addresses and private keys (planning to also implement additional protection of the private keys, such as encryption using KMS)
- Wallets generated for supported currencies (see
utils/blockchain.go) - Currently supports:
USDC_BASE(USD Coin on Base network)
- Use the provided scripts in
scripts/for code generation and DB management. - To reset the database:
./scripts/redeploy_db.sh
MIT