~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0
88 lines · 3.0 KB Raw History

From zero to a signed contract

Pick a side. Both paths assume you already have an AT Protocol identity: a DID and a PDS that will hold your records. The fastest way is the one binary, socialweb-computer: run request for the requester side and install bidder for the provider side. Each automates the full flow in one process.

Install

<!-- ../../README.md#install -->

I need compute

Run the requester (automated path, recommended)

One command writes the VM record and the RFP, collects bids, signs the accept, waits for the guest, runs your command (or drops you into a shell) and releases the VM: everything in steps 1-4 below, automated.

<!-- ../../README.md#request-a-vm -->

Sign-in modes (QR code, browser, app password), holding a VM, ssh, sizes and the long-lived requester: quickstart-prod.md.

Step 1 (what it does): describe the machine

A compute.vm record: cpus, mem, disk, network, a role and the cloud-init user data.

$type: com.publicdomainrelay.temp.compute.vm
cpus: 2
mem: 4G
disk: 40G
role: ml-inference-worker

Step 2: publish the RFP

A strong reference to the VM record in a market.rfp, sent to every bidder it discovered through the relays.

$type: com.publicdomainrelay.temp.market.rfp
payload: {uri: at://did:plc:you/com.publicdomainrelay.temp.compute.vm/3mm3d, cid: bafyrei...vm}

Step 3: wait, score, accept

The bid window runs, the policy decides, the first allowed free bid (else the lowest cost) wins, and a signed market.accept goes to the winning provider's submitAccept.

Step 4: get your receipt

The provider provisions the machine and mints a market.receipt anchoring the whole chain. That is your proof the contract happened: check the NSID, the author DID, and that the CIDs bind straight through (security).

I have machines

Run a bidder (automated path, recommended)

One service subscribes to the relays, takes RFPs, places bids, takes accepts and provisions VMs: everything in steps 1-4 below, automated.

<!-- ../../README.md#run-a-bidder -->

Builds and channels, who it serves, upgrade and self-update: bidder.md.

Step 1 (what it does): pick a policy, then watch the market

Choose who is even allowed to reach you (bidder-tangled-vouch by default; bidder-only-me, bidder-mutuals), then take market.rfp records from submitRfp and from the relays. See trust & policy.

Step 2: bid it

Publish a market.bids.free payload, then a market.bid that binds it to the RFP.

Step 3: take the accept

Check that the accept references your bid's exact uri and cid, comes from the RFP's own author, and that you still have room, before provisioning anything.

Step 4: provision, then mint the receipt

Provision the VM and sign a market.receipt anchoring rfp, bid and accept.

Need the field-by-field detail?

Every record type and validation rule is written up in the spec.