Farmer: compute_node_sid form + listing update/delist (F4, F7-F8) #69
Labels
No labels
meeting-notes
meeting-sensitive
meeting-transcript
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/home#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
Farmers can add nodes and listings are auto-created on hero_ledger (v2.3.0). However:
compute_node_sidfield is accepted by the backend but missing from the frontend add-node formWhat exists (verified 2026-04-10)
Gateway client methods (hero_ledger, already in Cargo deps)
File:
~/.cargo/git/checkouts/hero_ledger-.../clients/gateway/src/methods/marketplace.rsmarketplace_create_listing(input: Value) -> Result<Value>marketplace.createListingadd_farm_node_enhancedmarketplace_update_listing(listing_id: u64, input: Value) -> Result<Value>marketplace.updateListingmarketplace_delist_listing(listing_id: u64) -> Result<Value>marketplace.delistListingupdate_listinginput may contain:pricing,status,node_identitydelist_listingonly needs thelisting_idBackend — where listing_id is stored
In
add_farm_node_enhanced()(resource_provider.rs:275-300), after creating a listing on hero_ledger, the listing_id is stored in the OSIS node object:Backend — existing routes (routes.rs:80-104)
Backend — delete_node (resource_provider.rs:788-803)
Currently only calls
remove_node()— does NOT check forgrid_data.ledger_listing_idor call delist.Frontend — dashboard_nodes.rs
/dashboard/resource_provider-nodes(NOT the enhanced endpoint)Implementation plan
A. Backend —
resource_provider.rsA1. New endpoint: PUT listing update
ledger_listing_idfromnode.grid_datapricing, optionallystatus)gateway.lock().await.marketplace_update_listing(listing_id, input).awaitA2. New endpoint: DELETE listing delist
ledger_listing_idfromnode.grid_datagateway.lock().await.marketplace_delist_listing(listing_id).awaitledger_listing_idfromgrid_dataand save nodeA3. Cascade: delete_node → delist
In
delete_node()(line 788), before callingremove_node():grid_data.ledger_listing_idmarketplace_delist_listing()(best-effort — continue deletion even if delist fails)A4. Fix add-node to use enhanced endpoint
The frontend currently calls
/dashboard/resource_provider-nodes(basic endpoint). Change to use/dashboard/resource_provider-nodes-enhancedsocompute_node_sidand listing creation work.A5. Routes to add (routes.rs)
B. Frontend —
dashboard_nodes.rsB1. Add compute_node_sid to add-node modal
new_node_compute_sidcompute_node_sid/dashboard/resource_provider-nodesto/dashboard/resource_provider-nodes-enhancedB2. Add listing status indicator per node row
node.grid_data.ledger_listing_id:B3. Add "Update Listing" button per node row
ledger_listing_idPUT /api/dashboard/resource_provider-nodes/:id/listingB4. Add "Delist" button per node row
ledger_listing_idDELETE /api/dashboard/resource_provider-nodes/:id/listingB5. Add "Delete Node" button per node row
DELETE /api/dashboard/resource_provider-nodes/:idTest plan
API tests (add to farmer_integration.sh)
Playwright E2E (add to marketplace-e2e.spec.ts)
Content regression (add to content-regression.spec.ts)
All existing 391 tests still pass
Repos
_backendsrc/axum_app/controllers/dashboard/resource_provider.rs,src/axum_app/routes.rs_frontendsrc/pages/dashboard_nodes.rs_deploytests/farmer_integration.sh,tests/playwright/tests/*.spec.ts,docs/e2e_checklist.mdCompleted — F4, F7, F8 implemented and deployed to dev
Changes
Backend (
projectmycelium_marketplace_backendcommita1a5b14):PUT /api/dashboard/resource_provider-nodes/:id/listing— callsmarketplace_update_listing()on hero_ledger gatewayDELETE /api/dashboard/resource_provider-nodes/:id/listing— callsmarketplace_delist_listing()+ clearsledger_listing_idfromgrid_datadelete_node()cascade — auto-delists from hero_ledger before removing OSIS node (best-effort)Frontend (
projectmycelium_marketplace_frontendcommita3cd974):/resource_provider-nodesto/resource_provider-nodes-enhancedendpoint (enables ledger listing creation)grid_data.ledger_listing_idapi_delete_data→api_delete(response format mismatch)Tests (
projectmycelium_marketplace_deploycommitff012b9):farmer_integration.sh: 7 new test cases (update listing, delist, cascade delete, auth guards)Test results (all against dev-app.projectmycelium.org)
Checklist
Verified at
Signed: mik-tf