REST API layer over the Fuego network & wallet RPCs with multi-language client SDKs for easy integration.
- REST API Gateway - Node.js gateway translates REST calls to Fuego RPC endpoints
- Multi-Language Support - Client SDKs for 10+ programming languages
- OpenAPI Specification - API documentation with Swagger/OpenAPI 3.0
- Production Ready - Privacy-focused server with comprehensive security analysis
Language | Client Directory | Description |
---|---|---|
JavaScript/Node.js | clients/javascript/ |
Browser and Node.js compatible client |
Python | clients/python/ |
Python client with requests library |
Go | clients/go/ |
Go client with full type safety |
Java | clients/java/ |
Java client with Maven/Gradle support |
C# (.NET) | clients/csharp/ |
.NET client with NuGet package |
PHP | clients/php/ |
PHP client with Composer support |
Ruby | clients/ruby/ |
Ruby client with Gem support |
Kotlin | clients/kotlin/ |
Kotlin client for Android/JVM |
Swift 5 | clients/swift5/ |
Swift client for iOS/macOS |
Rust | clients/rust/ |
Rust client with Cargo support |
- Gateway REST base:
http://localhost:8787/v1
- Underlying services:
- Core RPC:
CORE_RPC_URL
(defaulthttp://127.0.0.1:8181
) - Wallet RPC:
WALLET_RPC_URL
(defaulthttp://127.0.0.1:8070
) - Wallet auth (optional):
WALLET_RPC_USER
,WALLET_RPC_PASSWORD
- Core RPC:
The gateway server is located in gateway/
directory.
cd gateway
npm install
CORE_RPC_URL=http://127.0.0.1:8181 \
WALLET_RPC_URL=http://127.0.0.1:8070 \
WALLET_RPC_USER=rpcuser \
WALLET_RPC_PASSWORD=rpcpass \
PORT=8787 \
node server.js
Prerequisites: Start fuegod
and xfgwalletd
servers locally.
Test the gateway with these example requests:
Node Information
curl http://localhost:8787/v1/node/info
Node Height
curl http://localhost:8787/v1/node/height
Wallet Balance
curl http://localhost:8787/v1/wallet/balance
Wallet Transfer
curl -X POST http://localhost:8787/v1/wallet/transfer \
-H 'Content-Type: application/json' \
-d '{
"destinations": [{"address": "fire...", "amount": 1000000}],
"payment_id": "",
"mixin": 0,
"unlock_time": 0,
"messages": [],
"ttl": 0
}'
Navigate to clients/javascript/
and follow the README:
cd clients/javascript
npm install
Navigate to clients/python/
and follow the README:
pip install requests
Each client SDK has its own directory with specific installation and usage instructions:
- Go:
clients/go/
-go mod tidy && go run main.go
- Java:
clients/java/
-mvn install
or./gradlew build
- C#:
clients/csharp/
-dotnet build
ornuget restore
- PHP:
clients/php/
-composer install
- Ruby:
clients/ruby/
-bundle install
- Kotlin:
clients/kotlin/
-./gradlew build
- Swift:
clients/swift5/
-swift build
- Rust:
clients/rust/
-cargo build
The complete API specification is available at openapi/fuego-openapi.yaml
.
Import into your favorite API client:
- Postman: Import the OpenAPI YAML file
- Insomnia: Import the OpenAPI YAML file
- Swagger UI: Use the YAML file with Swagger UI
- VS Code: Use the REST Client extension
Use the SDK generation script to create clients for additional languages:
cd openapi
./generate_sdks.sh
A privacy-enhanced version of the gateway server is available at gateway/server-privacy.js
.
Comprehensive privacy and security analysis is documented in privacy-security/privacy-analysis.md
.
Integration tools for blockchain explorers are available in explorer-integration/
:
- Migration scripts for existing explorers
- Integration documentation
- Setup guides
For production deployment on Ubuntu servers, we provide comprehensive guides and automated setup:
# Download and run the automated setup script
curl -fsSL https://raw.githubusercontent.com/ColinRitman/xfgapi/main/scripts/ubuntu-setup.sh | bash
For detailed manual setup instructions, see docs/UBUNTU-DEPLOYMENT.md
.
- Nginx reverse proxy with SSL/TLS termination
- PM2 process management for automatic restarts
- Let's Encrypt SSL certificates with auto-renewal
- UFW firewall configuration
- Rate limiting and security headers
- Health monitoring and logging
- Fail2ban protection against brute force attacks
For containerized deployments, use the provided Docker configuration:
# Build and run with Docker Compose
docker-compose up -d
Variable | Description | Default |
---|---|---|
CORE_RPC_URL |
Core RPC server URL | http://127.0.0.1:8181 |
WALLET_RPC_URL |
Wallet RPC server URL | http://127.0.0.1:8070 |
WALLET_RPC_USER |
Wallet RPC username | (optional) |
WALLET_RPC_PASSWORD |
Wallet RPC password | (optional) |
PORT |
Gateway server port | 8787 |
NODE_ENV |
Node.js environment | production |
CORS_ORIGIN |
CORS allowed origins | * |
- β SSL/TLS encryption configured
- β Reverse proxy (Nginx) setup
- β Process management (PM2) configured
- β Firewall rules applied
- β Rate limiting enabled
- β Security headers configured
- β Monitoring and logging setup
- β Backup strategy implemented
- β Health checks automated
This project is licensed under the terms specified in the LICENSE file.
Contributions are welcome! Please see the contributing guidelines for more information.
Repository: https://github.com/ColinRitman/xfgapi