feat: Phase 1 crude bridge — add node from explorer by mycelium IP (#72) #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_mik02"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 1 of the scaling architecture initiative (#72) — adds a "crude bridge" endpoint so farmers can register a hero_compute node by mycelium IP instead of hand-entering capacity.
Changes
POST /api/dashboard/nodes/from-explorer(dashboard/resource_provider.rs:754-975) — looks the node up in hero_compute_explorer by mycelium_ip, extracts hostname/capacity/slice_count/sid, calls the existing add_node path, patchesgrid_datawithcompute_node_sid+explorer_rawfor Phase 5 linkage, and best-effort-callsmarketplace.listing_createon hero_ledger.ComputeClient::lookup_by_mycelium_ip— client-side filter overexplorer.node_list()until upstream addsnode_get_by_mycelium_ip(Phase 2 follow-up).ServiceProvidernow carries an optionalcompute_clientfield populated in the two compute-enabled variants.Scope
Deliberately crude and isolated — the whole handler + route gets deleted in Phase 5 when
POST /api/nodes/pairreplaces manual discovery with signed pairing from the node itself.Validation (dev-app.projectmycelium.org)
Deployed as
:development_mik02via docker-compose override on the dev VM. Real smoke test against hero_compute explorer node0001(mycelium_ip46a:52b7:d2c2:4416:ff0f:5892:d922:50dc, hostnamedevpmmarketplace):FarmNode 016icreated,grid_data.compute_node_sid = "0001", capacity pulled from heartbeat (7GB RAM, 100GB disk)listing: null— best-effort hero_ledgerlisting_createfailed silently as designed (will be replaced in Phase 5)Test results
All regression suites green except 2 pre-existing failures unrelated to this change:
Related
Phase 1 of the scaling architecture initiative (docs/scaling_architecture.md). Farmer pastes the mycelium IPv6 of a running node; backend queries hero_compute_explorer.node_list, filters by mycelium_ip, and auto-populates a FarmNode + best-effort hero_ledger listing. No manual capacity entry required. Changes: - ServiceProvider: new optional compute_client field, populated in the two compute-enabled variants (local_with_compute, local_with_ledger_and_compute). Gives controllers clean access to the explorer client without going through ComputeSliceRentalManager. - ComputeClient::lookup_by_mycelium_ip: client-side filter over node_list() until we add ExplorerService.node_get_by_mycelium_ip upstream (Phase 2 follow-up). - New controller POST /api/dashboard/nodes/from-explorer: - Validates mycelium_ip - Looks up in explorer, extracts hostname/capacity/slice_count/sid - Builds NodeCreationData, calls existing add_node service method - Patches grid_data with compute_node_sid + explorer_raw for Phase 5 linkage - Best-effort hero_ledger marketplace.listing_create (synthetic node_id derived from mycelium_ip hash — Phase 1 hack, replaced in Phase 5 by hosting.node_register) - Logs NodeAdded activity This is deliberately crude and isolated — the whole handler + route will be deleted in Phase 5 when the auto-pairing endpoint (POST /api/nodes/pair) replaces manual discovery with signed pairing. Relates to: mycelium_code/home#72 Closes: mycelium_code/home#71 (pending deploy + verify) Tests: cargo check clean, 25 unit tests pass. Integration + E2E against dev VM to follow.