Skip to content

feat(miner): test connection for PyASIC controller before adding it#47

Merged
markoceri merged 2 commits into
edge-mining:mainfrom
markoceri:feat/issue-46-test-miner-controller-connection
Jul 2, 2026
Merged

feat(miner): test connection for PyASIC controller before adding it#47
markoceri merged 2 commits into
edge-mining:mainfrom
markoceri:feat/issue-46-test-miner-controller-connection

Conversation

@markoceri

@markoceri markoceri commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a way to verify a miner controller's connectivity directly from the creation form, before the controller is saved.

  • New POST /miner-controllers/test-connection endpoint that tests a non-persisted controller configuration and returns a reachability result (MinerControllerTestConnectionSchema).
  • MinerActionService.test_miner_controller_connection() builds a fresh, uncached adapter from the controller entity and queries the device (status / hashrate / power / device info) to confirm it is reachable.
  • AdapterService.build_miner_controller_adapter() instantiates an adapter from a controller entity without using or polluting the adapters cache.
  • Frontend: a "Test Connection" button in the miner controller form, shown only for the PyASIC adapter type, with inline success/error feedback.

Test plan

  • vue-tsc -b passes (no type errors)
  • ruff check / ruff format clean on changed backend files
  • Module import check: no unimplemented abstract methods, route registered
  • Manual: open the controller form, select PyASIC, fill in connection settings, press "Test Connection" and verify success/failure feedback; confirm no controller is persisted by the test

Closes #46

image

Add a way to verify a miner controller's connectivity from the creation
form, without persisting it.

- New POST /miner-controllers/test-connection endpoint returning a
  reachability result (MinerControllerTestConnectionSchema)
- MinerActionService.test_miner_controller_connection() builds a fresh,
  uncached adapter and queries the device (status/hashrate/power/info)
- AdapterService.build_miner_controller_adapter() instantiates an adapter
  from a controller entity without using/polluting the adapters cache
- Frontend: 'Test Connection' button in the controller form, shown only
  for the PyASIC adapter type, with inline success/error feedback

Refs edge-mining#46
@markoceri markoceri self-assigned this Jun 29, 2026
@markoceri markoceri added the enhancement New feature or request label Jun 29, 2026
@markoceri markoceri merged commit 1813ea4 into edge-mining:main Jul 2, 2026
3 checks passed
@markoceri markoceri deleted the feat/issue-46-test-miner-controller-connection branch July 2, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test connection before adding a PyASIC miner controller

1 participant