Barad-dûr (Kong API Gateway) - Quick Start Guide¶
This guide will get you up and running with Barad-dûr (Kong API Gateway) for Fukuii in under 5 minutes.
⚠️ SECURITY WARNING¶
DO NOT use this setup in production without changing the default passwords and secrets!
The default configuration includes example credentials for demonstration purposes only:
- Default passwords: fukuii_admin_password, fukuii_dev_password
- Default API keys: admin_api_key_change_me, dev_api_key_change_me
- Default JWT secret: your_jwt_secret_change_me
- Default Grafana password: fukuii_grafana_admin
- Default PostgreSQL password: kong
Before production deployment:
1. Copy .env.example to .env
2. Generate strong random passwords and secrets
3. Update all credentials in .env and kong.yml
4. Review the Kong Security Guide
Prerequisites¶
- Docker 20.10+
- Docker Compose 2.0+
- 8GB RAM available
- 20GB free disk space
Step 1: Clone and Navigate¶
Step 2: Run Setup Script¶
The setup script will: - Check prerequisites - Create necessary directories (including data directories for container bindings) - Copy configuration templates - Optionally start the stack
Step 3: Start Services (if not started by setup.sh)¶
Wait for all services to start (2-3 minutes):
Step 4: Verify Services¶
Check that Kong is running:
Expected response:
{
"database": {
"reachable": true
},
"server": {
"connections_accepted": 1,
"connections_active": 1,
"connections_handled": 1,
"connections_reading": 0,
"connections_waiting": 0,
"connections_writing": 1,
"total_requests": 1
}
}
Step 5: Test JSON-RPC API¶
Make a test JSON-RPC call:
curl -X POST http://localhost:8000/ \
-u admin:fukuii_admin_password \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Or run the test script:
Step 6: Access Dashboards¶
Grafana (Monitoring)¶
- URL: http://localhost:3000
- Username:
admin - Password:
fukuii_grafana_admin
Prometheus (Metrics)¶
- URL: http://localhost:9090
Step 7: Configure Security (IMPORTANT!)¶
Before using in production, update default credentials:
- Edit
.env:
Update these values:
- BASIC_AUTH_ADMIN_PASSWORD
- BASIC_AUTH_DEV_PASSWORD
- API_KEY_ADMIN
- API_KEY_DEV
- JWT_SECRET
- Edit
kong.yml:
Update consumer credentials in the consumers section.
- Restart Kong:
Common Tasks¶
View Logs¶
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f kong
docker-compose logs -f fukuii-primary
Stop Services¶
Stop and Remove All Data¶
Restart a Service¶
Update Images¶
API Examples¶
Basic Health Check¶
JSON-RPC - Get Block Number¶
curl -X POST http://localhost:8000/ \
-u admin:fukuii_admin_password \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
JSON-RPC - Get Peer Count¶
curl -X POST http://localhost:8000/ \
-u admin:fukuii_admin_password \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "net_peerCount",
"params": [],
"id": 1
}'
Bitcoin Route Example¶
curl -X POST http://localhost:8000/bitcoin \
-u admin:fukuii_admin_password \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "getblockcount",
"params": [],
"id": 1
}'
Ethereum Route Example¶
curl -X POST http://localhost:8000/ethereum \
-u admin:fukuii_admin_password \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Troubleshooting¶
Kong Won't Start¶
-
Check if PostgreSQL is healthy:
-
Wait for PostgreSQL to be fully ready (can take 30 seconds)
-
Run migrations manually:
Cannot Connect to API¶
-
Verify Kong is running:
-
Check Kong logs:
-
Verify port is not in use:
Fukuii Not Syncing¶
-
Check Fukuii logs:
-
Verify P2P port is accessible:
-
Check peer count:
Next Steps¶
- Read the Deployment Guide for detailed documentation
- Review Kong Security Guide for production deployment
- Configure additional Fukuii instances for high availability
- Set up SSL/TLS certificates
- Configure monitoring alerts
- Set up automated backups
Need Help?¶
- Check logs:
docker-compose logs -f - Run tests:
./test-api.sh - Review documentation: Deployment Guide
- Security guide: Kong Security
- Main Fukuii docs: Documentation Home
Clean Up¶
To completely remove all services and data: