Repository navigation
Signed listings: every c0mpute disk lists itself, NAT or not - #6
Merged
Merged
Conversation
…unce/1)
POST /api/v1/disks/announce takes {payload, signature}: the descriptor signed
with the disk's ed25519 libp2p key. d1sks checks peer id = key, the signature,
the marketplace host, ts freshness and monotonicity, and sane numbers; rate
limits per key (1/min), per address (600/h) and new keys per address (50/day).
Rows keep source=signed, heartbeat_at, expires_at, reachable (https, direct,
c0mpute) and addrs; they expire to gone when heartbeats stop. Listing filters
reachable=, fresh=, source= and sort=heartbeat; rows carry heartbeat_age_s.
Pages show NAT disks as reachable via c0mpute with no direct URL. Origin
listings and the hourly poll are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Disks can now push their own listing instead of waiting to be fetched, so c0mpute nodes behind NAT (nearly all of them) show up on d1sks.
POST /api/v1/disks/announcewith{ "payload": "<JSON text>", "signature": "<hex ed25519>" }, payload typec0mpute.disk.announce/1(marketplace,peer_id,key,ts,expires_in,origin,descriptor).peer_idmust be the identity multihash ofkey, the signature must hold over the exact payload text,marketplacemust be one of this site's hosts (ANNOUNCE_HOSTS, default d1sks.com, www, d1sks.pwa.pit.world plusSITE_URL),tswithin 10 min and newer than the last one stored (replays get 409).retry-after), 600 per address per hour, 50 new keys per address per day. Every attempt is logged inannounces(pruned after 2 days).source(originorsigned),peer_id,heartbeat_at,expires_at,reachable(https,direct,c0mpute),addrs. A signed row expires togonewhen heartbeats stop (checked every minute, and active lists filter onexpires_attoo). The hourly poll only touches origin rows.reachable=https|direct|c0mpute|public,fresh=<minutes>,source=signed|origin,sort=heartbeat; rows carryheartbeat_age_sforc0mpute hosting publish --disks autoranking.Origin-based listings (
POST /api/v1/disks {"url": ...}) are unchanged.Tests
test/announce.test.js: verifies a listing signed by the Rust node code (fixture fromopendisk::signed_listing), tampering, wrong peer, other marketplace, stale/future clocks, insane numbers, too many addrs, http origin, reachability.test/announce.api.test.js(Postgres): list a NAT disk, replay 409, per-key 429, bad signature 401, new-keys-per-address cap, expiry to gone and back.Companion: profullstack/c0mpute PR (nodes send the heartbeat every 5 min).
🤖 Generated with Claude Code