Commit graph

6 commits

Author SHA1 Message Date
Claude
5b6a607018
ax(node): enforce TestFilename_Function_{Good,Bad,Ugly} naming in peer_test.go
All peer registry test functions lacked the mandatory category suffix
required by AX-10 (CLI tests as artifact validation / test naming
convention). Renamed every test to carry _Good, _Bad, or _Ugly and
split the former monolithic AddPeer test into three focused cases.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:44:20 +01:00
Claude
c603303f1e
ax(node): rename test and add Good/Bad/Ugly suite for NewPeerRegistry
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestPeerRegistry_NewPeerRegistry violated AX-10 (test naming must follow
TestFilename_Function_{Good,Bad,Ugly}). Renamed to TestPeer_NewPeerRegistry_Good
and added Bad (unwritable path) and Ugly (corrupted JSON) cases.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:00:15 +01:00
snider
d99dd77449 feat: Add API configuration service and enhance security validation in commands 2025-12-31 17:46:25 +00:00
snider
d61a8aff8b refactor: Remove unused code and fix nil dereference issues
- Remove unused exported functions from pkg/database (session tracking,
  bulk hashrate inserts, various query helpers)
- Remove unused exported functions from pkg/node (identity management,
  bundle operations, controller methods)
- Make internal-only functions unexported in config_manager.go and database.go
- Remove unused EventProfile* constants from events.go
- Add GetCommit() and GetBuildDate() to expose version.go variables
- Fix potential nil dereference issues flagged by Qodana:
  - Add nil checks for GetIdentity() in controller.go, transport.go, worker.go
  - Add nil checks for GetPeer() in peer_test.go
  - Add nil checks in worker_test.go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:24:12 +00:00
snider
b24a3f00d6 fix: Add timeouts, atomic writes, and thread safety improvements
- Add 30s context timeout for database transactions in hashrate.go
- Add helper function for parsing SQLite timestamps with error logging
- Implement atomic file writes (temp + rename) for profile_manager.go,
  config_manager.go, and peer.go to prevent corruption on crash
- Add 5s timeout for stats collection per miner in manager.go
- Add 5s timeout for stdin writes in miner.go
- Clean up config file on failed miner start in xmrig_start.go
- Implement debounced saves (5s) for peer registry to reduce disk I/O
- Fix CheckInstallation data race in xmrig.go and ttminer.go by adding
  proper mutex protection around shared field updates
- Add 10s handshake timeout for WebSocket connections in transport.go
- Update peer_test.go to call Close() before reload to flush changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:55:30 +00:00
snider
9a781ae3f0 feat: Add multi-node P2P mining management system
Implement secure peer-to-peer communication between Mining CLI instances
for remote control of mining rigs. Uses Borg library for encryption
(SMSG, STMF, TIM) and Poindexter for KD-tree based peer selection.

Features:
- Node identity management with X25519 keypairs
- Peer registry with multi-factor optimization (ping/hops/geo/score)
- WebSocket transport with SMSG encryption
- Controller/Worker architecture for remote operations
- TIM/STIM encrypted bundles for profile/miner deployment
- CLI commands: node, peer, remote
- REST API endpoints for node/peer/remote operations
- Docker support for P2P testing with multiple nodes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:49:33 +00:00