@fangorn-network/sdk 2026.8.12-dev → 2026.8.18-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +175 -62
- package/lib/cli/cli.d.ts +0 -0
- package/lib/cli/cli.js +290 -17
- package/lib/config.d.ts +9 -8
- package/lib/config.js +6 -8
- package/lib/contracts/app-registry/abi.d.ts +466 -0
- package/lib/contracts/app-registry/abi.js +529 -0
- package/lib/contracts/app-registry/index.d.ts +139 -0
- package/lib/contracts/app-registry/index.js +271 -0
- package/lib/contracts/data-registry/abi.d.ts +124 -125
- package/lib/contracts/data-registry/abi.js +145 -142
- package/lib/contracts/data-registry/index.d.ts +16 -14
- package/lib/contracts/data-registry/index.js +19 -50
- package/lib/contracts/index.d.ts +8 -3
- package/lib/contracts/index.js +8 -3
- package/lib/contracts/settlement-registry/abi.d.ts +430 -11
- package/lib/contracts/settlement-registry/abi.js +528 -41
- package/lib/contracts/settlement-registry/index.d.ts +148 -10
- package/lib/contracts/settlement-registry/index.js +233 -9
- package/lib/contracts/subscription-registry/abi.d.ts +179 -0
- package/lib/contracts/subscription-registry/abi.js +195 -0
- package/lib/contracts/subscription-registry/index.d.ts +59 -0
- package/lib/contracts/subscription-registry/index.js +116 -0
- package/lib/contracts/types.d.ts +8 -0
- package/lib/contracts/types.js +10 -0
- package/lib/contracts/write.d.ts +27 -0
- package/lib/contracts/write.js +55 -0
- package/lib/crypto/encryption.js +4 -4
- package/lib/engine/index.d.ts +14 -12
- package/lib/engine/index.js +13 -7
- package/lib/fangorn.d.ts +35 -5
- package/lib/fangorn.js +49 -6
- package/lib/index.d.ts +8 -3
- package/lib/index.js +8 -3
- package/lib/test/testbed.js +9 -3
- package/lib/types/index.d.ts +6 -0
- package/package.json +72 -85
package/README.md
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
# Fangorn SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Fangorn SDK is git for graphs, enabling version control and distribution of *metagraphs* organized into applications and namespaces.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It lets you treat IPFS as a hierarchical data store for your app-level storage with enforced terms, conditions, and validation logic for publishers. Data is published under a *namespace* in a *registered application*, **`app : publisher : namespace`**. Each namespace has its own on-chain state root (the digest of a commit block wrapping a native IPLD DAG) owned by the *publisher* who passed the app's validation logic. Updating a namespace root is a compare-and-swap operation (i.e. a git ref update).
|
|
6
6
|
|
|
7
|
-
Each
|
|
7
|
+
Each namespace's state is represented by a **metagraph**, $G = (V, E, L)$ where $V$=**vertices** (a JSON payload tagged by a free-form schema id) and $E$=**edges** (a labeled relation between two vertices, as native IPLD links), $L$=**labels** (the allowed labels in any edge).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Version Control**
|
|
10
10
|
|
|
11
|
-
Datasets are versioned like git
|
|
11
|
+
Datasets are versioned like git. Each update is a **commit** that points at its parent (previous graph state) and at a single **CAR file** (a packfile) holding only the blocks that were introduced in the commit. The onchain data registry stores the root of the latest commit, with full history living in IPFS. Full history is reconstructible from the onchain root (head) of a namespace without an indexer required.
|
|
12
|
+
|
|
13
|
+
- `commit` (local) builds the graph in memory and persists it in two uploads, one CAR (the graph data) + one small commit block.
|
|
14
|
+
- `push` (remote) updates the onchain root to the latest staged commit
|
|
15
|
+
|
|
16
|
+
> Since the metagraph edges are native IPLD links, the DAG (directed acyclic graph) is easily 'diffable' and verifiable from the root stored onchain, though it is not easily queryable (see: [quickbeam](https://github.com/fangorn-network/quickbeam))
|
|
17
|
+
|
|
18
|
+
**Storage**
|
|
19
|
+
|
|
20
|
+
Metagraphs are stored in IPFS. The SDK currently expects Pinata to be used to ensure data availability, which will be relaxed in the future.
|
|
21
|
+
|
|
22
|
+
#### What it is not
|
|
23
|
+
|
|
24
|
+
This is not a graph database, there is no query langauge here, and there is no native indexer.
|
|
12
25
|
|
|
13
|
-
Fields that shouldn't be public are **sealed** under a **gadget** — a named pairing of a sealing scheme and the condition under which it opens. Two ship today: `self-hkdf-v1` (fully private, only you can re-derive the key) and `worker-usdc-v1` (settlement-gated, released by the access worker once the reader has paid). See [Encryption & gadgets](#encryption--gadgets).
|
|
14
26
|
|
|
15
27
|
## Supported Networks
|
|
16
28
|
|
|
@@ -28,8 +40,6 @@ npm i @fangorn-network/sdk
|
|
|
28
40
|
|
|
29
41
|
## CLI Quickstart
|
|
30
42
|
|
|
31
|
-
Install globally and initialize:
|
|
32
|
-
|
|
33
43
|
```sh
|
|
34
44
|
npm i -g @fangorn-network/sdk
|
|
35
45
|
fangorn init
|
|
@@ -57,12 +67,42 @@ SIGNED_URL_WORKER_URL=https://pinata-url-provider.your-subdomain.workers.dev #
|
|
|
57
67
|
|
|
58
68
|
> The **access worker** and the **presigned-URL worker** are two different services: the first gates reads of sealed fields, the second hands out Pinata upload URLs. Don't conflate them.
|
|
59
69
|
|
|
60
|
-
###
|
|
70
|
+
### Check your wallet
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
fangorn wallet show # address, public key, balance, network, current app
|
|
74
|
+
fangorn wallet show --reveal # also prints the PRIVATE key — it grants full control
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The private key is never printed without `--reveal`: terminal scrollback, shell
|
|
78
|
+
logs and screen shares all outlive the command.
|
|
61
79
|
|
|
62
|
-
|
|
80
|
+
### Pick an app, then register
|
|
81
|
+
|
|
82
|
+
Publishing takes standing in **two** registries, and skipping the second is the
|
|
83
|
+
usual first failure: `commitStateRoot` cross-calls `isRegisteredForApp`, so a
|
|
84
|
+
wallet registered globally but not joined to the app gets `NotRegisteredForApp`
|
|
85
|
+
at push time — far from the cause.
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
fangorn set-app my-app # persists the app; --app <name-or-id> overrides per command
|
|
89
|
+
fangorn app info # owner, terms, join fee, and where you stand in both registries
|
|
90
|
+
fangorn app claim # claim it, if nobody owns it yet (irreversible)
|
|
91
|
+
fangorn register # global standing in the DataRegistry, then join the app
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`fangorn register` is idempotent and does both halves, reporting each. It is the
|
|
95
|
+
only registration command you normally need; `fangorn app join` exists for
|
|
96
|
+
joining an app you don't own, and for re-accepting terms after the owner moves
|
|
97
|
+
them (free).
|
|
98
|
+
|
|
99
|
+
Owning an app comes with its own commands:
|
|
63
100
|
|
|
64
101
|
```sh
|
|
65
|
-
fangorn
|
|
102
|
+
fangorn app terms <hash> [uri] # publish new terms — everyone must re-accept
|
|
103
|
+
fangorn app fee <wei> # what joining costs
|
|
104
|
+
fangorn app suspend <address> # eject a publisher from THIS app only
|
|
105
|
+
fangorn app reinstate <address>
|
|
66
106
|
```
|
|
67
107
|
|
|
68
108
|
### Track a namespace (git-native repo)
|
|
@@ -116,16 +156,21 @@ import { buildAssetGraph, extractMarkdownLinks } from "@fangorn-network/sdk";
|
|
|
116
156
|
// ids this file links to; buildAssetGraph wires the edges (rel: "links"),
|
|
117
157
|
// dropping self-links and links to files that don't exist.
|
|
118
158
|
const { vertices, edges } = buildAssetGraph("./docs", {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
159
|
+
processors: {
|
|
160
|
+
".md": (file) => ({
|
|
161
|
+
tag: "note",
|
|
162
|
+
payload: { title: file.nameNoExt, body: file.readText() },
|
|
163
|
+
links: extractMarkdownLinks(file.readText()), // markdown links + [[wikilinks]]
|
|
164
|
+
}),
|
|
165
|
+
},
|
|
126
166
|
});
|
|
127
167
|
|
|
128
|
-
await fangorn.commit({
|
|
168
|
+
await fangorn.commit({
|
|
169
|
+
namespace: "rusty-anchor",
|
|
170
|
+
message: "import docs",
|
|
171
|
+
vertices,
|
|
172
|
+
edges,
|
|
173
|
+
});
|
|
129
174
|
```
|
|
130
175
|
|
|
131
176
|
Each vertex `id` is the filename without extension. For anything that isn't "files in a folder," build the `{ vertices, edges }` arrays yourself and pass them straight to `commit` / `uploadBatch` — the harness is a convenience, not a requirement.
|
|
@@ -156,9 +201,10 @@ fangorn clone <owner> rusty-anchor --dir ./somewhere
|
|
|
156
201
|
### Subscribe (light client)
|
|
157
202
|
|
|
158
203
|
Watch a namespace for on-chain updates and stream the diffs — **no subgraph, no
|
|
159
|
-
indexer**.
|
|
160
|
-
|
|
161
|
-
|
|
204
|
+
indexer**. Each `app:publisher:namespace` triple is its own timeline, and the
|
|
205
|
+
registry indexes all three parts, so this watches exactly that timeline's
|
|
206
|
+
`StateCommitted` event (read straight from the RPC node) and, for each new root,
|
|
207
|
+
diffs the namespace's link sets against the previous root.
|
|
162
208
|
Only pushes that actually changed the namespace are emitted. Each push's
|
|
163
209
|
blocks arrive as one CAR download, resolved from IPFS on demand.
|
|
164
210
|
|
|
@@ -225,16 +271,37 @@ const fangorn = Fangorn.create({
|
|
|
225
271
|
},
|
|
226
272
|
},
|
|
227
273
|
config: FangornConfig, // defaults to Arbitrum Sepolia
|
|
274
|
+
appId: "my-app", // defaults to "fangorn"
|
|
228
275
|
domain: "localhost",
|
|
229
276
|
});
|
|
230
277
|
|
|
231
|
-
// Register once before committing.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
278
|
+
// Register once before committing — BOTH registries. The second is the one
|
|
279
|
+
// `commitStateRoot` cross-calls, so skipping it surfaces as a revert at push
|
|
280
|
+
// time rather than here.
|
|
281
|
+
const self = fangorn.getAddress();
|
|
282
|
+
const data = fangorn.getDataRegistry();
|
|
283
|
+
const apps = fangorn.getAppRegistry();
|
|
284
|
+
|
|
285
|
+
if (!(await data.isRegistered(self))) await data.register();
|
|
286
|
+
if (!(await apps.isRegisteredForApp(self))) await apps.registerForApp();
|
|
236
287
|
```
|
|
237
288
|
|
|
289
|
+
`joinInfo` is what a join screen needs, and it separates two failures a bare
|
|
290
|
+
"not registered" conflates — never joined, versus joined before the owner moved
|
|
291
|
+
the terms:
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
import { needsReacceptance } from "@fangorn-network/sdk";
|
|
295
|
+
|
|
296
|
+
const info = await apps.joinInfo(self);
|
|
297
|
+
if (needsReacceptance(info)) await apps.registerForApp(); // free re-accept
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
The other two clients hang off the same object: `fangorn.getSubscriptionRegistry()`
|
|
301
|
+
(publisher storage paywall) and `fangorn.getSettlementRegistry()` (consumer
|
|
302
|
+
pay-then-read). Neither is app-scoped — a subscription is per wallet and a
|
|
303
|
+
resource is per owner — so `setAppId` deliberately leaves both alone.
|
|
304
|
+
|
|
238
305
|
### Namespaces & the git-native flow
|
|
239
306
|
|
|
240
307
|
`initRepo` allocates a namespace on-chain (idempotent). Then split building from settling:
|
|
@@ -348,7 +415,9 @@ rather than a per-publisher fan-out. `subscribeApp` yields the same
|
|
|
348
415
|
|
|
349
416
|
```ts
|
|
350
417
|
// Everything published under this app, by anyone
|
|
351
|
-
for await (const change of fangorn.subscribeApp({
|
|
418
|
+
for await (const change of fangorn.subscribeApp({
|
|
419
|
+
signal: controller.signal,
|
|
420
|
+
})) {
|
|
352
421
|
console.log(change.owner, change.namespace, change.addedVertices.length);
|
|
353
422
|
}
|
|
354
423
|
|
|
@@ -366,10 +435,29 @@ fangorn.setAppId("my-other-app"); // by name, or by 32-byte app id
|
|
|
366
435
|
fangorn.getAppId(); // 0x… — what the registry keys on
|
|
367
436
|
```
|
|
368
437
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
438
|
+
`setAppId` re-scopes the DataRegistry and AppRegistry clients **together**. They
|
|
439
|
+
must never disagree: a DataRegistry pointed at one app while the AppRegistry
|
|
440
|
+
answers for another checks membership against the wrong market, and it surfaces
|
|
441
|
+
as a revert at commit time, far from the mistake.
|
|
442
|
+
|
|
443
|
+
Apps live in the AppRegistry, and membership of one is a precondition for
|
|
444
|
+
publishing under it:
|
|
445
|
+
|
|
446
|
+
```ts
|
|
447
|
+
const apps = fangorn.getAppRegistry();
|
|
448
|
+
|
|
449
|
+
await apps.registerApp(termsHash, termsUri, joinFee); // claim it (first come, first served)
|
|
450
|
+
await apps.registerForApp(); // join it, accepting the current terms
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Joining reads the terms hash immediately before sending and passes it as an
|
|
454
|
+
argument, so the contract reverts `TermsMismatch` if the owner moved the terms
|
|
455
|
+
in between. A race is a revert, never silent agreement to a document the
|
|
456
|
+
publisher never saw. The join fee is read from the chain for the same reason a
|
|
457
|
+
caller never supplies it: a caller can supply the wrong one.
|
|
458
|
+
|
|
459
|
+
See the [CLI quickstart](#pick-an-app-then-register) for the same flow from the
|
|
460
|
+
command line.
|
|
373
461
|
|
|
374
462
|
### Storage
|
|
375
463
|
|
|
@@ -387,17 +475,17 @@ Not every field belongs in public IPFS. Fangorn lets you **seal** a value and co
|
|
|
387
475
|
only an opaque reference to it, keeping the graph — its shape, its edges, its
|
|
388
476
|
addressability — fully public while the payload stays closed.
|
|
389
477
|
|
|
390
|
-
A **gadget** names
|
|
478
|
+
A **gadget** names _how_ a value is sealed and _under what condition_ it opens. Two
|
|
391
479
|
ship today, both exported from the package root (`@fangorn-network/sdk`):
|
|
392
480
|
|
|
393
|
-
| Gadget | Key derivation
|
|
394
|
-
| ---------------- |
|
|
395
|
-
| `self-hkdf-v1` | HKDF from your own 32-byte secret
|
|
396
|
-
| `worker-usdc-v1` | X25519 ECDH to the access worker's static key | Anyone who has settled for the resource; the worker checks the Settlement Registry.
|
|
481
|
+
| Gadget | Key derivation | Who can open it |
|
|
482
|
+
| ---------------- | --------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
483
|
+
| `self-hkdf-v1` | HKDF from your own 32-byte secret | Only you. No ECDH, no recipient, no gate — nobody else can re-derive the key. |
|
|
484
|
+
| `worker-usdc-v1` | X25519 ECDH to the access worker's static key | Anyone who has settled for the resource; the worker checks the Settlement Registry. |
|
|
397
485
|
|
|
398
486
|
Every key is bound to a 32-byte **`resourceId`**, which doubles as the Settlement
|
|
399
487
|
Registry key. The same secret cannot cross-open a different resource, and changing
|
|
400
|
-
|
|
488
|
+
_who can read_ means re-sealing under a new gadget/`resourceId` and committing a
|
|
401
489
|
vertex that points at the new bytes.
|
|
402
490
|
|
|
403
491
|
### `self-hkdf-v1` — fully private
|
|
@@ -407,10 +495,14 @@ retrieval. Fangorn never sees plaintext or a key — it commits the ciphertext l
|
|
|
407
495
|
other payload. No worker, no settlement, no R2 involved.
|
|
408
496
|
|
|
409
497
|
```ts
|
|
410
|
-
import {
|
|
498
|
+
import {
|
|
499
|
+
sealSelf,
|
|
500
|
+
unsealSelf,
|
|
501
|
+
GADGET_SELF_HKDF_V1,
|
|
502
|
+
} from "@fangorn-network/sdk";
|
|
411
503
|
import { keccak256, stringToBytes, hexToBytes, bytesToHex } from "viem";
|
|
412
504
|
|
|
413
|
-
const ownSecret = hexToBytes(privateKey);
|
|
505
|
+
const ownSecret = hexToBytes(privateKey); // your own 32 bytes
|
|
414
506
|
const resourceId = keccak256(stringToBytes("rusty-anchor:secret-msg"));
|
|
415
507
|
|
|
416
508
|
const ciphertext = sealSelf(
|
|
@@ -420,14 +512,22 @@ const ciphertext = sealSelf(
|
|
|
420
512
|
);
|
|
421
513
|
|
|
422
514
|
// commit the opaque bytes like anything else
|
|
423
|
-
await fangorn.upload(
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
515
|
+
await fangorn.upload(
|
|
516
|
+
"rusty-anchor",
|
|
517
|
+
{
|
|
518
|
+
gadget: GADGET_SELF_HKDF_V1,
|
|
519
|
+
resourceId,
|
|
520
|
+
ciphertext: bytesToHex(ciphertext),
|
|
521
|
+
},
|
|
522
|
+
"secret-msg",
|
|
523
|
+
);
|
|
428
524
|
|
|
429
525
|
// later, after `read` / `inspectNamespace` hands the payload back:
|
|
430
|
-
const plaintext = unsealSelf(
|
|
526
|
+
const plaintext = unsealSelf(
|
|
527
|
+
hexToBytes(stored.ciphertext),
|
|
528
|
+
ownSecret,
|
|
529
|
+
stored.resourceId,
|
|
530
|
+
);
|
|
431
531
|
```
|
|
432
532
|
|
|
433
533
|
### `worker-usdc-v1` — settlement-gated
|
|
@@ -444,7 +544,7 @@ const handle = await encryptAndUpload({
|
|
|
444
544
|
gadget: GADGET_WORKER_USDC_V1,
|
|
445
545
|
plaintext: new TextEncoder().encode("the full dataset"),
|
|
446
546
|
resourceId,
|
|
447
|
-
workerPubkey,
|
|
547
|
+
workerPubkey, // the access worker's static X25519 key (32 bytes)
|
|
448
548
|
storage: {
|
|
449
549
|
workerUrl: process.env.ACCESS_WORKER_URL!,
|
|
450
550
|
authToken: process.env.ACCESS_WORKER_TOKEN!,
|
|
@@ -459,13 +559,13 @@ as an ordinary opaque object in the vertex payload:
|
|
|
459
559
|
```jsonc
|
|
460
560
|
{
|
|
461
561
|
"@type": "handle",
|
|
462
|
-
"objectKey": "…",
|
|
562
|
+
"objectKey": "…", // R2 object key
|
|
463
563
|
"workerUrl": "https://access-worker.example.workers.dev",
|
|
464
564
|
"encryption": {
|
|
465
565
|
"gadget": "worker-usdc-v1",
|
|
466
|
-
"resourceId": "0x…",
|
|
467
|
-
"ciphertextHash": "0x…",
|
|
468
|
-
"workerPubkey": "0x…",
|
|
566
|
+
"resourceId": "0x…", // Settlement Registry key + HKDF binding
|
|
567
|
+
"ciphertextHash": "0x…", // sha256 of the sealed bytes
|
|
568
|
+
"workerPubkey": "0x…", // worker-usdc-v1 only
|
|
469
569
|
},
|
|
470
570
|
}
|
|
471
571
|
```
|
|
@@ -481,14 +581,14 @@ import { decryptHandle } from "@fangorn-network/sdk";
|
|
|
481
581
|
|
|
482
582
|
const plaintext = await decryptHandle({
|
|
483
583
|
handle,
|
|
484
|
-
signer,
|
|
485
|
-
nullifier,
|
|
584
|
+
signer, // any viem LocalAccount / WalletClient — the address settlement is checked for
|
|
585
|
+
nullifier, // per-read nullifier (replay / anonymity)
|
|
486
586
|
// ownSecret, // self-hkdf-v1 only
|
|
487
587
|
});
|
|
488
588
|
```
|
|
489
589
|
|
|
490
590
|
- **`self-hkdf-v1`** — the resource is priced 0, so any signed request passes; the bytes
|
|
491
|
-
come back
|
|
591
|
+
come back _still sealed_, are checked against `ciphertextHash`, and are unsealed
|
|
492
592
|
locally with `ownSecret`.
|
|
493
593
|
- **`worker-usdc-v1`** — the worker streams bytes only once the signer has settled,
|
|
494
594
|
having unsealed with its own key; the bytes arrive as plaintext.
|
|
@@ -499,8 +599,8 @@ reads the settlement rail directly.
|
|
|
499
599
|
|
|
500
600
|
**Trust model.** For `worker-usdc-v1` the access worker is the "somewhat trusted" party:
|
|
501
601
|
it holds the unsealing key and sees plaintext at release time. That is deliberate for
|
|
502
|
-
v1 — no TEE, no threshold network. Swapping in a stronger backend later is a
|
|
503
|
-
|
|
602
|
+
v1 — no TEE, no threshold network. Swapping in a stronger backend later is a _new
|
|
603
|
+
gadget_ behind the same handle shape, so committed data doesn't change form.
|
|
504
604
|
`self-hkdf-v1` trusts nobody: the worker is dumb storage and never holds a key.
|
|
505
605
|
|
|
506
606
|
---
|
|
@@ -509,11 +609,20 @@ gadget* behind the same handle shape, so committed data doesn't change form.
|
|
|
509
609
|
|
|
510
610
|
### Arbitrum Sepolia
|
|
511
611
|
|
|
512
|
-
| Contract
|
|
513
|
-
|
|
|
514
|
-
| DataRegistry
|
|
612
|
+
| Contract | Address | What it owns |
|
|
613
|
+
| -------------------- | -------------------------------------------- | --------------------------------------------------- |
|
|
614
|
+
| DataRegistry | `0x3b0cf19bef492500401e4d74e6fa29a56d0cc67b` | Namespace state roots; global publisher standing |
|
|
615
|
+
| AppRegistry | `0xcc92f3d827df33be7323eef28e67a509034f5a59` | Apps: owner, terms, join fee, per-app membership |
|
|
616
|
+
| SubscriptionRegistry | `0xe82192be4c20d3dc93fbc63e3ecd7e13c3889726` | Publisher-side storage paywall (USDC) |
|
|
617
|
+
| SettlementRegistry | `0x47a2a0d7e7fc8a044f6d6f1d878c4178952ea779` | Consumer-side pay-then-read rail (USDC + Semaphore) |
|
|
618
|
+
|
|
619
|
+
`FangornConfig` in `src/config.ts` is the authoritative list and what the SDK
|
|
620
|
+
uses by default — these contracts have been redeployed more than once, so prefer
|
|
621
|
+
the config over any address copied out of a document, including this table.
|
|
515
622
|
|
|
516
|
-
|
|
623
|
+
The dependency runs one way: `DataRegistry.commitStateRoot` cross-calls
|
|
624
|
+
`AppRegistry.isRegisteredForApp`, and `SubscriptionRegistry` cross-calls
|
|
625
|
+
`DataRegistry.isRegistered`. Nothing calls back the other way.
|
|
517
626
|
|
|
518
627
|
---
|
|
519
628
|
|
|
@@ -542,14 +651,18 @@ Required variables:
|
|
|
542
651
|
| `PINATA_JWT` | Pinata API JWT |
|
|
543
652
|
| `PINATA_GATEWAY` | Pinata gateway URL |
|
|
544
653
|
|
|
545
|
-
The publisher must be registered
|
|
654
|
+
The publisher must be registered on the target key — `fangorn register` does
|
|
655
|
+
both halves (DataRegistry standing, then joining the app). The suite's own
|
|
656
|
+
`TestBed.registerApp` / `TestBed.register` do the same thing programmatically,
|
|
657
|
+
claiming the app first if nobody owns it.
|
|
546
658
|
|
|
547
659
|
---
|
|
548
660
|
|
|
549
661
|
## Limitations / Future Work
|
|
550
662
|
|
|
551
663
|
- Sealed fields are live (`self-hkdf-v1`, `worker-usdc-v1`), but which fields to seal is expressed per-call at stage time — there is no schema-level `sealedFields` hint yet, and no CLI command for sealing.
|
|
552
|
-
- The SDK
|
|
664
|
+
- The SDK covers the **publisher** half of the settlement rail (`createResource`, `updatePrice`, `setDisabled`, plus the reads). The **buyer** half — Semaphore identity, the EIP-3009 authorization, membership proofs — lives in [`@fangorn-network/fetch`](https://github.com/fangorn-network/x402f), which relays both writes through a facilitator so the buyer needs no gas. This package deliberately carries no proving dependency.
|
|
665
|
+
- The SubscriptionRegistry (publisher storage paywall) has a client but no CLI command yet; `fangorn subscribe` is the event stream, not the paywall.
|
|
553
666
|
- `worker-usdc-v1` trusts the access worker with the unsealing key. A TEE- or threshold-backed replacement would ship as a new gadget, and the on-chain gadget registry (`gadget → resolver`) is still future work.
|
|
554
667
|
- Vertex/edge schema validation is client-side only — no on-chain enforcement.
|
|
555
668
|
- Push authorization is client-side in this release; on-chain write policies and non-fast-forward rejection are planned.
|
package/lib/cli/cli.d.ts
CHANGED
|
File without changes
|