go-blockchain/daemon
Claude 37108819df
Some checks are pending
Test / Test (push) Waiting to run
Security Scan / security (push) Successful in 14s
feat(daemon): add 30+ missing getinfo fields for full explorer compat
The Go daemon now returns all fields the explorer expects:
- pow_difficulty, pos_difficulty, total_coins, block_reward
- default_fee, minimum_fee, last_block_hash/timestamp
- tx_count, alt_blocks_count, connection counts
- current_blocks_median, max_allowed_block_size
- network hashrate, synchronization state

Total getinfo response now has 40+ keys matching C++ daemon format.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 05:35:17 +01:00
..
coverage_test.go fix(daemon): repair last 2 broken routes + add comprehensive coverage test 2026-04-02 03:39:41 +01:00
http_handlers.go refactor(daemon): extract 842 lines into http_handlers.go 2026-04-02 04:27:51 +01:00
README.md docs(daemon): add README documenting API surface + AX debt 2026-04-02 04:11:01 +01:00
server.go feat(daemon): add 30+ missing getinfo fields for full explorer compat 2026-04-02 05:35:17 +01:00
server_integration_test.go test(integration): add hardfork, chain stats, REST health verification 2026-04-02 03:42:13 +01:00
server_test.go fix(daemon): repair 13 broken RPC routes + nil pointer guards 2026-04-02 03:37:06 +01:00
wallet_rpc.go feat(daemon): add wallet RPC proxy — unified endpoint 2026-04-02 02:01:20 +01:00
wallet_rpc_test.go test: wallet proxy, chain scanner tests 2026-04-02 03:55:07 +01:00

daemon — Lethean Go Chain Daemon

JSON-RPC + REST API server backed by the Go chain.

File Structure

File Purpose Methods
server.go Core RPC router + all handlers (LEGACY — needs splitting) 84
wallet_rpc.go Wallet RPC proxy to C++ wallet 16
server_test.go Unit tests for RPC handlers 22
server_integration_test.go Go-vs-C++ comparison tests 6
coverage_test.go Tests ALL 48 RPC methods in one pass 1

API Surface

  • 69 chain JSON-RPC methods (native Go + CGo crypto)
  • 16 wallet proxy methods (C++ wallet backend)
  • 17 HTTP/REST endpoints (web-friendly JSON)
  • Total: 102 endpoints

AX Debt

server.go uses banned imports (encoding/json, net/http). Migration to core/api is tracked. When core/api integration happens:

  • JSON encoding → core.JSONMarshalString
  • HTTP routing → core/api router
  • SSE → core/api SSEBroker
  • Metrics → core/api middleware

Categories (for future file split)

  1. Chain queries (getinfo, getheight, getblockheaderbyheight, etc.)
  2. Alias operations (get_all_alias_details, get_alias_by_address, etc.)
  3. Crypto utilities (validate_signature, generate_keys, fast_hash, etc.)
  4. Explorer/analytics (get_chain_stats, get_difficulty_history, etc.)
  5. Service discovery (get_gateways, get_vpn_gateways, get_network_topology)
  6. REST endpoints (/api/info, /api/block, /api/aliases, /health, /metrics)
  7. SSE (/events/blocks)
  8. Admin (pool, relay, reset stubs)