The Bitcoin Node Dashboard API is documented using the OpenAPI 3.0 specification. The OpenAPI schema is generated at build time and saved in the target/ directory, but not exposed at runtime for security reasons.
The OpenAPI specification files are located at the project root:
openapi.json- JSON format (versioned in git)openapi.yaml- YAML format (versioned in git)
The OpenAPI spec is automatically generated during Maven compilation:
# Generate/Update OpenAPI spec
mvn clean package -DskipTests
# The file will be at project root
cat openapi.yamlYou can view and interact with the generated OpenAPI specification using various tools:
- Go to https://editor.swagger.io/
- Click File > Import file
- Upload
openapi.jsonoropenapi.yamlfrom project root
Install the "OpenAPI (Swagger) Editor" extension:
code --install-extension 42Crunch.vscode-openapiThen open openapi.yaml in VS Code.
# Serve the OpenAPI spec with Redoc
docker run -p 8080:80 \
-v $(pwd):/usr/share/nginx/html/spec \
-e SPEC_URL=spec/openapi.yaml \
redocly/redocAccess at: http://localhost:8080
# Serve with Swagger UI
docker run -p 8080:8080 \
-e SWAGGER_JSON=/spec/openapi.yaml \
-v $(pwd):/spec \
swaggerapi/swagger-uiAccess at: http://localhost:8080
GET /api/dashboard- Complete dashboard data aggregationGET /api/getnetworkinfo- Network informationGET /api/getBlockchainInfo- Blockchain statusGET /api/getblock/{hash}- Block details by hashGET /api/getbestblockhash- Latest block hashGET /api/getmempoolinfo- Mempool statistics
GET /api/config- Dashboard configuration settings
ws://localhost:8080/ws/dashboard- Real-time updates
# Get dashboard data
curl http://localhost:8080/api/dashboard
# Get network info
curl http://localhost:8080/api/getnetworkinfo
# Get block by hash
curl http://localhost:8080/api/getblock/00000000000000000001a0a0d0e0f0a0b0c0d0e0f0a0b0c0d0e0f0a0b0c0d0e0
# Get best block hash
curl http://localhost:8080/api/getbestblockhash// Get dashboard data
const response = await fetch('http://localhost:8080/api/dashboard');
const data = await response.json();
console.log(data);
// Get configuration
const config = await fetch('http://localhost:8080/api/config')
.then(res => res.json());
console.log('Min outbound peers:', config.minOutboundPeers);import requests
# Get dashboard data
response = requests.get('http://localhost:8080/api/dashboard')
data = response.json()
print(data)
# Get network info
network_info = requests.get('http://localhost:8080/api/getnetworkinfo').json()
print(f"Network: {network_info}")The OpenAPI specification is automatically generated from code annotations during package:
mvn clean package -DskipTestsThe file will be created/updated at project root:
openapi.yaml(versioned in git)
Edit the annotations in:
src/main/java/comasky/api/BitcoinApiController.java- Bitcoin Node endpoints documentationsrc/main/java/comasky/api/ConfigController.java- Configuration endpointssrc/main/resources/application.properties- OpenAPI metadata (title, version, description)
In application.properties:
# OpenAPI Configuration
quarkus.smallrye-openapi.store-schema-directory=.
quarkus.swagger-ui.always-include=false
mp.openapi.extensions.smallrye.info.title=Bitcoin Node Dashboard API
mp.openapi.extensions.smallrye.info.version=1.5.0If you need Swagger UI during development, you can enable it in application-local.properties:
quarkus.swagger-ui.always-include=true
quarkus.swagger-ui.path=/swagger-uiThen access it at: http://localhost:8080/swagger-ui (dev mode only)
Complete dashboard data including:
- Peer statistics (inbound/outbound)
- Blockchain information
- Network details
- Block information
- Mempool statistics
- Error details (if any)
- Version information
- Subversion
- Protocol version
- Network type
- Connections count
- Block hash
- Height
- Timestamp
- Transaction count
- Size
- Weight
- Difficulty
- Chain name
- Blocks count
- Headers count
- Best block hash
- Difficulty
- Verification progress
- Chain work
- Transaction count
- Total size (bytes)
- Memory usage
- Fee statistics
- The API is designed for local/private network use
- No authentication is required by default
- Ensure proper network security when exposing the API
- Consider using a reverse proxy with authentication for production