Skip to content

Commit e496caa

Browse files
committed
test(flows): host-side P2P surface smoke — settlement, paid dataset join, research, --secure
flows/p2p-surface-smoke.sh covers the host-P2P gaps release-smoke never touches: direct-P2P inference 402 + remote-model proxy, paid dataset /join/paid, research membership->submit->payout, on-chain settlement (1d/2e) via a local facilitator, and the --secure transport gate (named-tunnel 4a, tailnet 4b/4c). Adds 'obol sell data publish --facilitator' and the cloudflared 2026.6.0 bump. 13 PASS / 2 SKIP with facilitator + tunnel up.
1 parent b11330c commit e496caa

5 files changed

Lines changed: 538 additions & 2 deletions

File tree

cmd/obol/dataset.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ func datasetPublishCommand(cfg *config.Config) *cli.Command {
162162
&cli.StringFlag{Name: "price", Usage: "Per-join price in USDC (enables x402 paid join; empty = invite/open only)"},
163163
&cli.StringFlag{Name: "pay-to", Usage: "USDC recipient (default: the dataset owner address)"},
164164
&cli.StringFlag{Name: "chain", Usage: "Payment chain", Value: "base-sepolia"},
165+
&cli.StringFlag{Name: "facilitator", Usage: "x402 facilitator URL for paid-join verify+settle (point at a local anvil fork for tests)", Value: x402.DefaultFacilitatorURL},
165166
},
166167
Action: func(ctx context.Context, cmd *cli.Command) error {
167168
u := getUI(cmd)
@@ -220,7 +221,7 @@ func datasetPublishCommand(cfg *config.Config) *cli.Command {
220221
req := x402.BuildV2Requirement(chain, price, payTo, 0)
221222
joinAtomic = req.Amount
222223
paidJoin = x402.NewForwardAuthMiddleware(x402.ForwardAuthConfig{
223-
FacilitatorURL: x402.DefaultFacilitatorURL,
224+
FacilitatorURL: cmd.String("facilitator"),
224225
VerifyOnly: false,
225226
SettlesInProcess: true,
226227
}, []x402types.PaymentRequirements{req})

flows/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,33 @@ holds small structured helpers used by the shell entrypoints. Keep new
2929
contract rather than duplicating stack, DNS, wallet, or config-mutation helpers.
3030
`release-smoke.sh` is the release gate.
3131

32+
`hf-surface-smoke.sh` and `p2p-surface-smoke.sh` are out-of-band, host-side
33+
"surface" smokes — no cluster required, and each check SKIPs on a missing
34+
prerequisite rather than aborting. They cover the peer-to-peer / host-gateway
35+
paths release-smoke (entirely the cluster path) does not:
36+
37+
- `hf-surface-smoke.sh` — dataset hub (anonymize → sign → publish → unpaid buy),
38+
fine-tune-on-spark provenance binding, router + ERC-8004 indexer discovery.
39+
- `p2p-surface-smoke.sh` — standalone `obol sell inference` 402 emission +
40+
remote-model proxy (model served on `spark1`, reached via SSH forward); the
41+
paid dataset `/join/paid` x402 gate + `buy dataset --join` client guards
42+
(402 challenge, `--max-price` cap, fail-closed download); and the research
43+
membership → submit → payout E2E asserting **token-derived** worker identity
44+
(not the self-declared field) and best-per-worker payouts. When a local anvil
45+
base-sepolia fork + x402 facilitator are reachable (auto-detected; stand them
46+
up with flow-10), the **paid 200** (a signed EIP-3009 `X-PAYMENT` verified +
47+
settled, via the `flows/tools/x402-sign` host signer) and the **paid dataset
48+
mint + verified download** settle on chain for real; otherwise those two legs
49+
SKIP. The `--secure` transport gate (Surface 4) auto-activates when a genuinely
50+
non-secure origin exists: **4a** (ACCEPT over a NAMED cloudflared tunnel) when
51+
`SECURE_TUNNEL_NAME` + `SECURE_TUNNEL_HOSTNAME` are set (after `cloudflared
52+
tunnel login` + routing a hostname on your CF domain); **4b/4c** (REJECT/ACCEPT
53+
a CGNAT plaintext origin) when THIS host is on a tailnet (`tailscale up`) so a
54+
remote peer (`SECURE_ORIGIN_SSH`, default `spark1`) can reach a non-private mac
55+
IP — loopback/RFC1918 are always "secure". Each leg SKIPs precisely until its
56+
prereq is set; the gate is also unit-tested. Run e.g.
57+
`OBOL_BIN=.workspace/bin/obol SPARK=spark1 bash flows/p2p-surface-smoke.sh`.
58+
3259
## Running a flow detached over SSH
3360

3461
`nohup` and `setsid -f` get reaped when an SSH session ending closes the

0 commit comments

Comments
 (0)