A RPC server for Verus blockchain built in Rust. Acts as a secure proxy between clients and the Verus daemon with comprehensive validation and security controls.
This project is dual-licensed:
- MIT License for VerusCoin and non-commercial use
- AGPL-3.0 License for commercial use
See LICENSE, LICENSE-VERUS, and LICENSE-EXCEPTION for details.
β οΈ Warning: This project is under active development.Features, APIs, and configuration formats may change without notice.
Use in production environments is not recommended at this stage.
Please report issues and follow updates for breaking changes.
- Rust (1.70+)
- Redis (optional, for caching)
- Verus Daemon (verusd) running
- Git
git clone https://github.com/Nexlab/verus-t-rpc.git
cd verus-t-rpc
cargo build --releaseCreate config.toml:
[verus]
rpc_url = "http://127.0.0.1:27486"
rpc_user = "your_rpc_username"
rpc_password = "your_rpc_password"
[server]
bind_address = "127.0.0.1"
port = 8080
[security]
development_mode = false
enable_security_headers = true
[jwt]
secret_key = "your-32-character-secret-key-here"
expiration_seconds = 3600
[rate_limit]
enabled = true
requests_per_minute = 100
[cache]
enabled = true
redis_url = "redis://127.0.0.1:6379"# Development
cargo run
# Production
cargo run --release# Basic RPC call
curl -X POST http://127.0.0.1:8080/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getinfo",
"params": [],
"id": 1
}'
# With authentication
curl -X POST http://127.0.0.1:8080/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"jsonrpc": "2.0",
"method": "getblock",
"params": ["block_hash", true],
"id": 1
}'60+ Verus RPC methods with comprehensive validation:
- Blockchain:
getinfo,getblockchaininfo,getblock,getblockhash - Transactions:
getrawtransaction,sendrawtransaction,createrawtransaction - Addresses:
getaddressbalance,getaddressutxos,getaddressmempool - Identities:
getidentity,registeridentity,updateidentity - Currencies:
getcurrency,sendcurrency,listcurrencies
- JWT Authentication: Token-based authentication with expiration
- Rate Limiting: IP-based request throttling
- Security Headers: CSP, XSS protection, clickjacking prevention
- Method Validation: Only pre-approved methods allowed
- Input Validation: Strict parameter type checking
- Health Check:
/health(with circuit breaker monitoring) - Circuit Breaker Admin:
/admin/circuit-breaker/status,/admin/circuit-breaker/reset - Metrics:
/metrics(Prometheus format) - Structured Logging: JSON format with request/response tracking
# Run all tests
cargo test
# Run with verbose output
cargo test --verbose
# Run in release mode
cargo test --releaseβββββββββββββββββββββββββββββββββββββββ
β HTTP Layer β
β (Warp Framework) β
βββββββββββββββββββββββββββββββββββββββ€
β Infrastructure Layer β
β (HTTP Server, Cache, Monitoring) β
βββββββββββββββββββββββββββββββββββββββ€
β Application Layer β
β (Use Cases, Services) β
βββββββββββββββββββββββββββββββββββββββ€
β Domain Layer β
β (Business Logic, Models) β
βββββββββββββββββββββββββββββββββββββββ
# Build
cargo build --release
# Format code
cargo fmt
# Lint code
cargo clippy
# Security audit
cargo auditFROM rust:1.70 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=builder /app/target/release/verus-rpc-server /usr/local/bin/
EXPOSE 8080
CMD ["verus-rpc-server"]export VERUS_RPC_URL="http://127.0.0.1:27486"
export VERUS_RPC_USER="your_username"
export VERUS_RPC_PASSWORD="your_password"
export SERVER_PORT="8080"
export JWT_SECRET_KEY="your-secret-key"- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
For comprehensive documentation, see the docs/ directory:
- Getting Started - Quick start guide
- API Reference - Complete API documentation
- Architecture - System design and architecture
- Security - Security features and best practices
- Deployment - Production deployment guides
- Development - Development setup and guidelines
- Monitoring - Monitoring and observability
- Integrations - Mining pool, PoW, and DEX integration guides
- Local Development Guide - Local development without authentication
rust_verusd_rpc_server/
βββ docs/ # Documentation
β βββ test_local_access.md
β βββ ...
βββ examples/ # Example code and scripts
β βββ test_deployment.sh
β βββ test_project/ # Example Rust client
β βββ dex_client_example.js
βββ src/ # Source code
βββ Conf.toml # Development configuration
βββ Conf.production.toml # Production configuration
βββ Conf.public-dex.toml # Public DEX configuration
If you find this project valuable, please consider supporting:
Verus: zs10u0vvlchlv0yuew4a87cvpesrvdl2yc7dda0q9kjdg4lmezsx4nmj88nna2vcd0m4hmc2eg948c
Every contribution helps us keep building. Thank you!
This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders, contributors, or affiliated organizations be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
You are solely responsible for deploying, configuring, and operating this software.
Use in production environments is at your own risk. Always review, audit, and test the code and configuration before use, especially in security-critical or financial contexts.