- Fix health check to use RPC call instead of GET /health
- Update API endpoints to use correct RPC method names:
- synor_getInfo, synor_getMiningInfo, synor_getTips
- synor_getBlockCount, synor_getBlueScore, synor_getBlocksByBlueScore
- Fix response format handling (synor_getTips returns {tips: [...]})
- Add WebSocket endpoint at /ws for real-time updates:
- stats_update events (every second)
- new_block events on block detection
- tip_update events on DAG changes
- Add ws feature to axum and tokio-tungstenite dependency
57 lines
1.2 KiB
TOML
57 lines
1.2 KiB
TOML
[package]
|
|
name = "synor-explorer"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Synor Block Explorer Backend - REST API for blockchain data"
|
|
license = "MIT OR Apache-2.0"
|
|
|
|
[[bin]]
|
|
name = "synor-explorer"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
# Synor crates
|
|
synor-types = { path = "../../crates/synor-types" }
|
|
synor-rpc = { path = "../../crates/synor-rpc" }
|
|
|
|
# Async runtime
|
|
tokio = { version = "1.35", features = ["full"] }
|
|
|
|
# Web framework
|
|
axum = { version = "0.7", features = ["json", "query", "ws"] }
|
|
tower = { version = "0.4", features = ["timeout", "limit"] }
|
|
tower-http = { version = "0.5", features = ["cors", "trace", "compression-gzip", "fs"] }
|
|
|
|
# Serialization
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
|
|
# HTTP client for RPC calls
|
|
reqwest = { version = "0.11", features = ["json"] }
|
|
|
|
# Error handling
|
|
anyhow = "1.0"
|
|
thiserror = "1.0"
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
|
|
|
# Time handling
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
|
|
# Environment
|
|
dotenvy = "0.15"
|
|
|
|
# Hex encoding
|
|
hex = "0.4"
|
|
|
|
# Caching
|
|
moka = { version = "0.12", features = ["future"] }
|
|
|
|
# Async utilities
|
|
futures = "0.3"
|
|
tokio-tungstenite = "0.21"
|
|
|
|
[dev-dependencies]
|
|
tokio-test = "0.4"
|