Skip to content

List c0mpute hosting nodes: ?hosting=1 filter, badge, host-a-site docs - #5

Merged
ralyodio merged 1 commit into
mainfrom
feat/c0mpute-hosting-disks
Nov 9, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/c0mpute-hosting-disks

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

c0mpute nodes with the hosting role now say so in their OpenDisk descriptor (accepts.hosting: true, c0mpute.roles, c0mpute.hosting { price_per_gib_month, max_gib }, companion PR in profullstack/c0mpute feat/hosting-marketplace). c0mpute hosting publish --disks auto picks paid hosts from this listing.

This PR makes d1sks show them:

  • src/opendisk.js: c0mputeOf(doc) reads the c0mpute block (peer id must look like a base58 libp2p id), isC0mputeHosting, wantsHosting; validate() normalises accepts.hosting and c0mpute.
  • src/disks.js: ?hosting=1 (also true, c0mpute) lists only disks with a c0mpute peer id plus accepts.hosting or the hosting role. Rows gain c0mpute_hosting, c0mpute_peer_id, hosting_per_gib_month.
  • Views: a "c0mpute hosting" badge and the hosting price on list rows, a Kind filter on /disks, a "c0mpute hosting node" block on the disk page, and a "Host a site on these disks" section in /docs (plus the hosting parameter in the table).

d1sks stays discovery only. Placement, proof-of-storage challenges and payment are peer to peer in c0mpute, and a site keeps being served if d1sks is down.

Tests: bun test gives 19 pass. New unit tests cover the c0mpute block, the role-or-flag rule, rejecting a bad peer id or a missing block, and ?hosting parsing. A new API case (needs DATABASE_URL) lists a hosting disk through ?hosting=1&country=PT, checks the row fields and checks that the HTML shows the badge. I ran it against a throwaway postgres:16 container: 19 pass, 97 expects. bun run lint is clean.

Not deployed.

🤖 Generated with Claude Code

Reads the c0mpute block a c0mpute node adds to its OpenDisk descriptor
(peer_id, roles, accepts.hosting, hosting price) and:
- ?hosting=1 on /disks and /api/v1/disks lists only c0mpute hosting nodes
- rows carry c0mpute_hosting, c0mpute_peer_id, hosting_per_gib_month
- a 'c0mpute hosting' badge and hosting price in the list, a block on the
  disk page, a Kind filter, and a 'Host a site on these disks' docs section
  pointing at c0mpute hosting publish --disks auto

d1sks stays discovery only: placement, proofs and payment are p2p.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 681d989 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant