Close the farmer→user deployment loop: ledger write path + node identity mapping #67
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#67
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?
Problem
The marketplace can deploy VMs end-to-end (wallet → SPORE accounting → hero_compute → running VM), but the farmer→user circular economy has two manual bridges that prevent a full self-service loop.
What works today (verified 2026-04-08)
mkt-vm-nano-e4e7running Ubuntu 24.04, SSH accessible on Mycelium IPv6What's missing
Gap 1: No write path from marketplace to hero_ledger
The farmer can add nodes in the resource provider dashboard (stored in OSIS), but there's no code that creates a
marketplace.createListing()transaction on the hero_ledger NEAR contract. The 7 product listings currently visible (ledger_3throughledger_9) were pre-seeded directly on the NEAR contract — not created through the marketplace UI.The marketplace is read-only against the ledger for the product catalog (
marketplace_list_listings()). There's no write path.Gap 2: No node identity mapping (ledger ↔ hero_compute)
When a user rents
ledger_4(TFGrid Node 390), the backend ignores that node ID and callshero_compute.node_list()to pick the first available online node. The code inslice_rental_manager.rsexplicitly says:So the farmer's specific hardware is never targeted — any available node gets the workload.
Gap 3: SPORE transfer to farmer fails
The SPORE transfer code runs but returns
spore_transferred: falsebecause the farmer's NEAR account (extracted from the ledger listing) doesn't exist on the devnet. This would work if Gap 1 were closed (farmer account created during listing registration).Proposed solution
1. Farmer listing write path
marketplace.createListing()on hero_ledger with node specs, pricing, and farmer's NEAR accountmarketplace_list_listings())marketplace.updateListing()/marketplace.removeListing()2. Node identity mapping
ledger_listing_idornode_identitythat maps to the ledger listingledger_4, the backend resolves it to the corresponding hero_compute node SID3. Farmer NEAR account provisioning
Full target flow
Test plan
Context
185.69.166.158)src/services/impl_ledger/product_catalog.rs(read-only),src/services/impl_compute/slice_rental_manager.rs(ignores node mapping)src/axum_app/controllers/rental.rs:225(rent_slice_fullhandler)Resolved — All 5 Steps Implemented and Verified
Changes (2 repos pushed)
projectmycelium_marketplace_backend (
d749e0con development):LedgerProductCatalogso rental code can find farmer account for SPORE transfersledger_listing_id,compute_node_sid,ledger_account_idoptional fields to Node type in OSchema + all generated typesaccount_activate()call on hero_ledger gateway (derives{name}.myceliumdomain)marketplace_create_listing()on hero_ledger with resources/pricing, stores listing_id back in OSISledger_{id}→ OSIS node →compute_node_sidfor hero_compute deployment (fallback: first available)projectmycelium_marketplace_deploy (
4d10840on development):farmer_integration.shtest suite (27 tests)Test Results — 354/354 PASS
Verified on dev VM