@fangorn-network/sdk 2026.4.7 → 2026.4.15
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 +137 -150
- package/lib/cli/cli.js +134 -226
- package/lib/cli/index.d.ts +170 -170
- package/lib/config.d.ts +260 -257
- package/lib/config.js +7 -5
- package/lib/fangorn.d.ts +3 -20
- package/lib/fangorn.js +15 -52
- package/lib/index.d.ts +3 -7
- package/lib/index.js +4 -7
- package/lib/modules/encryption/aes.d.ts +3 -3
- package/lib/modules/encryption/index.d.ts +1 -28
- package/lib/modules/encryption/index.js +1 -3
- package/lib/modules/encryption/types.d.ts +1 -48
- package/lib/providers/storage/index.d.ts +4 -21
- package/lib/providers/storage/index.js +3 -2
- package/lib/providers/storage/pinata.d.ts +14 -0
- package/lib/providers/storage/pinata.js +32 -0
- package/lib/providers/storage/types.d.ts +37 -0
- package/lib/providers/storage/utils.d.ts +12 -0
- package/lib/providers/storage/utils.js +50 -0
- package/lib/registries/datasource-registry/abi.d.ts +116 -43
- package/lib/registries/datasource-registry/abi.js +190 -12
- package/lib/registries/datasource-registry/index.d.ts +12 -6
- package/lib/registries/datasource-registry/index.js +96 -20
- package/lib/registries/index.js +1 -1
- package/lib/registries/schema-registry/abi.d.ts +157 -66
- package/lib/registries/schema-registry/abi.js +242 -15
- package/lib/registries/schema-registry/index.d.ts +8 -3
- package/lib/registries/schema-registry/index.js +82 -17
- package/lib/registries/settlement-registry/abi.d.ts +199 -145
- package/lib/registries/settlement-registry/abi.js +331 -25
- package/lib/registries/settlement-registry/index.d.ts +36 -39
- package/lib/registries/settlement-registry/index.js +125 -91
- package/lib/registries/settlement-registry/types.d.ts +6 -3
- package/lib/roles/consumer/index.d.ts +17 -42
- package/lib/roles/consumer/index.js +87 -58
- package/lib/roles/consumer/types.d.ts +15 -34
- package/lib/roles/publisher/index.d.ts +22 -40
- package/lib/roles/publisher/index.js +69 -113
- package/lib/roles/publisher/types.d.ts +40 -41
- package/lib/roles/schema/index.d.ts +4 -30
- package/lib/roles/schema/index.js +7 -60
- package/lib/roles/schema/types.d.ts +16 -2
- package/lib/test/testbed.d.ts +12 -36
- package/lib/test/testbed.js +35 -68
- package/lib/types/index.d.ts +14 -57
- package/package.json +1 -6
- package/lib/modules/encryption/lit.d.ts +0 -21
- package/lib/modules/encryption/lit.js +0 -127
- package/lib/modules/gadgets/index.d.ts +0 -2
- package/lib/modules/gadgets/index.js +0 -1
- package/lib/modules/gadgets/settledGadget.d.ts +0 -31
- package/lib/modules/gadgets/settledGadget.js +0 -75
- package/lib/modules/gadgets/types.d.ts +0 -27
- package/lib/providers/storage/pinata/index.d.ts +0 -13
- package/lib/providers/storage/pinata/index.js +0 -41
- package/lib/providers/storage/storacha/index.d.ts +0 -13
- package/lib/providers/storage/storacha/index.js +0 -49
- package/lib/providers/storage/storacha/readOnly.d.ts +0 -8
- package/lib/providers/storage/storacha/readOnly.js +0 -16
- /package/lib/{modules/gadgets → providers/storage}/types.js +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Fangorn SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Programmable access control for the agentic web.
|
|
4
4
|
|
|
5
|
-
Fangorn lets you publish data
|
|
5
|
+
Fangorn lets you publish data under programmable access conditions. Access is enforced on-chain through settlement verification, so your content is only retrievable by those who have provably paid for it. Data is organized by schemas, enabling agent-based discovery across any number of publishers.
|
|
6
|
+
Content is stored in your own storage backend (Cloudflare R2, IPFS, or any compatible future backend). The Fangorn protocol coordinates access without ever touching your content directly.
|
|
6
7
|
|
|
7
8
|
## Supported Networks
|
|
8
9
|
|
|
@@ -27,28 +28,30 @@ npm i -g @fangorn-network/sdk
|
|
|
27
28
|
fangorn init
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
-
|
|
31
|
+
`fangorn init` prompts for:
|
|
32
|
+
- Wallet private key
|
|
33
|
+
- Pinata JWT + gateway URL (for schema/manifest storage)
|
|
34
|
+
- Fangorn access worker URL (for content retrieval)
|
|
35
|
+
- Default chain
|
|
36
|
+
|
|
37
|
+
Config is written to `~/.fangorn/config.json`.
|
|
38
|
+
|
|
39
|
+
You can also configure via environment variables:
|
|
32
40
|
|
|
33
41
|
```sh
|
|
34
42
|
DELEGATOR_ETH_PRIVATE_KEY=0x...
|
|
35
|
-
# if you use pinata over storacha
|
|
36
43
|
PINATA_JWT=...
|
|
37
44
|
PINATA_GATEWAY=https://your-gateway.mypinata.cloud
|
|
38
|
-
|
|
39
|
-
STORACHA_EMAIL=...
|
|
45
|
+
WORKER_URL=https://your-worker.workers.dev
|
|
40
46
|
CHAIN_NAME=arbitrumSepolia
|
|
41
47
|
```
|
|
42
48
|
|
|
43
49
|
### Register a Schema
|
|
44
50
|
|
|
45
51
|
```sh
|
|
46
|
-
#
|
|
52
|
+
# Register a schema on-chain
|
|
47
53
|
fangorn schema register <name>
|
|
48
54
|
|
|
49
|
-
# Skip agent registration
|
|
50
|
-
fangorn schema register <name> --skip-erc
|
|
51
|
-
|
|
52
55
|
# Fetch a registered schema by name
|
|
53
56
|
fangorn schema get schema.name.v1
|
|
54
57
|
```
|
|
@@ -56,40 +59,50 @@ fangorn schema get schema.name.v1
|
|
|
56
59
|
### Publish Data
|
|
57
60
|
|
|
58
61
|
```sh
|
|
59
|
-
#
|
|
60
|
-
fangorn publish upload
|
|
61
|
-
|
|
62
|
-
# List your manifest entries for a schema
|
|
63
|
-
fangorn publish list -s schema.name.v1
|
|
62
|
+
# Publish records under a schema, priced at 1 USDC unit
|
|
63
|
+
fangorn publish upload records.json -s schema.name.v1 -p 1
|
|
64
64
|
|
|
65
65
|
# Inspect a specific entry
|
|
66
66
|
fangorn publish entry track1 -s schema.name.v1
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
Records are JSON files containing `PublishRecord` objects. Handle fields point to content already uploaded to your storage backend:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"name": "track1",
|
|
74
|
+
"fields": {
|
|
75
|
+
"title": "Locura",
|
|
76
|
+
"artist": "Alice",
|
|
77
|
+
"audio": { "@type": "handle", "uri": "r2://my-dir/locura.mp3" }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
69
82
|
> A price of `1` equals the smallest USDC unit (0.000001 USDC).
|
|
70
83
|
|
|
71
84
|
### Consume Data
|
|
72
85
|
|
|
73
|
-
The consumer flow is three phases: **purchase
|
|
86
|
+
The consumer flow is three phases: **purchase → claim → fetch**.
|
|
74
87
|
|
|
75
88
|
```sh
|
|
76
|
-
# Phase 1: pay and join the
|
|
77
|
-
fangorn consume purchase <owner> <
|
|
89
|
+
# Phase 1: pay and join the Semaphore group
|
|
90
|
+
fangorn consume purchase <owner> <name> \
|
|
78
91
|
-s schema.name.v1 \
|
|
79
92
|
--burner-key 0x... \
|
|
80
93
|
--amount 1 \
|
|
81
94
|
--usdc 0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d
|
|
82
95
|
|
|
83
|
-
# Save the identity string printed by purchase — required for
|
|
96
|
+
# Save the identity string printed by purchase — required for claim.
|
|
84
97
|
|
|
85
98
|
# Phase 2: prove membership and claim access (generates a Groth16 ZK proof)
|
|
86
|
-
fangorn consume claim <owner> <
|
|
99
|
+
fangorn consume claim <owner> <name> \
|
|
87
100
|
-s schema.name.v1 \
|
|
88
101
|
--identity '<identity-string>' \
|
|
89
102
|
--stealth <stealth-address>
|
|
90
103
|
|
|
91
|
-
# Phase 3:
|
|
92
|
-
fangorn consume
|
|
104
|
+
# Phase 3: fetch content via the access worker
|
|
105
|
+
fangorn consume fetch <owner> <name> \
|
|
93
106
|
-s schema.name.v1 \
|
|
94
107
|
-f audio \
|
|
95
108
|
--nullifier <nullifier> \
|
|
@@ -115,7 +128,7 @@ import { Fangorn, FangornConfig } from "@fangorn-network/sdk";
|
|
|
115
128
|
const fangorn = await Fangorn.create({
|
|
116
129
|
privateKey: "0x...",
|
|
117
130
|
storage: { pinata: { jwt: "...", gateway: "https://your-gateway.mypinata.cloud" } },
|
|
118
|
-
|
|
131
|
+
workerUrl: "https://your-worker.workers.dev",
|
|
119
132
|
config: FangornConfig.ArbitrumSepolia,
|
|
120
133
|
domain: "localhost",
|
|
121
134
|
});
|
|
@@ -123,107 +136,82 @@ const fangorn = await Fangorn.create({
|
|
|
123
136
|
|
|
124
137
|
**Storage options:**
|
|
125
138
|
|
|
126
|
-
| Config
|
|
127
|
-
|
|
|
128
|
-
| `{ pinata: { jwt, gateway } }`
|
|
129
|
-
|
|
|
130
|
-
|
|
139
|
+
| Config | Mode |
|
|
140
|
+
| ------------------------------ | ------------ |
|
|
141
|
+
| `{ pinata: { jwt, gateway } }` | Read + write |
|
|
142
|
+
| undefined | Read only |
|
|
143
|
+
|
|
144
|
+
Storage is used for schemas and manifests only. Content itself lives in your storage backend (R2 etc.) and is never handled by the SDK directly.
|
|
131
145
|
|
|
132
146
|
### Schemas
|
|
133
147
|
|
|
134
|
-
A `SchemaDefinition` is a JSON object where each field declares its type. Fields marked `@type: "
|
|
148
|
+
A `SchemaDefinition` is a JSON object where each field declares its type. Fields marked `@type: "handle"` point to content in an external storage backend — access is enforced by the Fangorn access worker. All other fields are stored inline in the manifest and are publicly readable.
|
|
135
149
|
|
|
136
150
|
```ts
|
|
137
|
-
// Define a schema
|
|
138
151
|
const definition: SchemaDefinition = {
|
|
139
152
|
title: { "@type": "string" },
|
|
140
153
|
artist: { "@type": "string" },
|
|
141
|
-
audio: { "@type": "
|
|
142
|
-
cover: { "@type": "file" }, // plaintext
|
|
154
|
+
audio: { "@type": "handle" }, // content lives in R2, access-controlled by worker
|
|
143
155
|
};
|
|
144
156
|
|
|
145
|
-
// Register an ERC-8004 agent identity
|
|
146
|
-
const { agentId } = await fangorn.schema.registerAgent({
|
|
147
|
-
name: "schema.agent.name.v1",
|
|
148
|
-
description: "Music streaming data source agent",
|
|
149
|
-
});
|
|
150
|
-
|
|
151
157
|
// Register the schema on-chain
|
|
152
158
|
const { schemaId, schemaCid } = await fangorn.schema.register({
|
|
153
159
|
name: "schema.name.v1",
|
|
154
160
|
definition,
|
|
155
|
-
agentId,
|
|
161
|
+
agentId: "",
|
|
156
162
|
});
|
|
157
163
|
|
|
158
164
|
// Fetch a schema by name
|
|
159
165
|
const schema = await fangorn.schema.get("schema.name.v1");
|
|
160
166
|
```
|
|
161
167
|
|
|
162
|
-
When a record conforming to this schema is published, Fangorn encrypts each `@type: "encrypted"` field and replaces its value with a ciphertext handle and a gadget descriptor:
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
// Input record
|
|
166
|
-
{
|
|
167
|
-
"tag": "track1",
|
|
168
|
-
"fields": {
|
|
169
|
-
"title": "Cassini Division",
|
|
170
|
-
"artist": "Arca",
|
|
171
|
-
"audio": { "data": "<bytes>", "fileType": "audio/mp3" }
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// Stored manifest entry (audio field encrypted)
|
|
176
|
-
{
|
|
177
|
-
"tag": "track1",
|
|
178
|
-
"fields": {
|
|
179
|
-
"title": "Cassini Division",
|
|
180
|
-
"artist": "Arca",
|
|
181
|
-
"audio": {
|
|
182
|
-
"@type": "encrypted",
|
|
183
|
-
"handle": {
|
|
184
|
-
"cid": "bafkrei...",
|
|
185
|
-
"gateway": "your-gateway.mypinata.cloud"
|
|
186
|
-
},
|
|
187
|
-
"gadgetDescriptor": {
|
|
188
|
-
"type": "settled",
|
|
189
|
-
"description": "Settlement-gated: SettlementRegistry.isSettled(resourceId, caller)",
|
|
190
|
-
"params": {
|
|
191
|
-
"resourceId": "0xce16c0...",
|
|
192
|
-
"settlementRegistryAddress": "0x4536881306ee355c2f18ae81658771c4488139a3",
|
|
193
|
-
"chainName": "arbitrumSepolia"
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
The `gadgetDescriptor` is human- and agent-readable: it describes exactly what a consumer must do to unlock the field. Plaintext fields (`title`, `artist`) remain directly readable in the manifest without any purchase flow.
|
|
202
|
-
|
|
203
168
|
### Publishing
|
|
204
169
|
|
|
205
|
-
|
|
170
|
+
Upload content to your R2 bucket out-of-band (via Cloudflare dashboard, wrangler CLI, or your own tooling), then publish a manifest pointing at it. The SDK stores the manifest on IPFS and commits the CID on-chain.
|
|
206
171
|
|
|
207
172
|
```ts
|
|
208
|
-
import { SettledGadget } from "@fangorn-network/sdk/gadgets";
|
|
209
|
-
import { SettlementRegistry } from "@fangorn-network/sdk/registries";
|
|
210
|
-
|
|
211
|
-
const owner = fangorn.getAddress();
|
|
212
|
-
|
|
213
|
-
// Default gadget = payment settled
|
|
214
173
|
await fangorn.publisher.upload(
|
|
215
174
|
{
|
|
216
175
|
records: [
|
|
217
|
-
{
|
|
218
|
-
|
|
176
|
+
{
|
|
177
|
+
name: "track1",
|
|
178
|
+
fields: {
|
|
179
|
+
title: "Locura",
|
|
180
|
+
artist: "Alice",
|
|
181
|
+
audio: { "@type": "handle", uri: "r2://my-dir/locura.mp3" },
|
|
182
|
+
},
|
|
183
|
+
},
|
|
219
184
|
],
|
|
220
|
-
schemaName:
|
|
221
|
-
gateway: "https://your-gateway.mypinata.cloud",
|
|
185
|
+
schemaName: "schema.name.v1",
|
|
222
186
|
},
|
|
223
187
|
1n, // price in smallest USDC units
|
|
224
188
|
);
|
|
225
189
|
```
|
|
226
190
|
|
|
191
|
+
The manifest stored on-chain looks like:
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"version": 2,
|
|
196
|
+
"schemaId": "0x...",
|
|
197
|
+
"entries": [
|
|
198
|
+
{
|
|
199
|
+
"name": "track1",
|
|
200
|
+
"fields": {
|
|
201
|
+
"title": "Locura",
|
|
202
|
+
"artist": "Alice",
|
|
203
|
+
"audio": {
|
|
204
|
+
"@type": "handle",
|
|
205
|
+
"uri": "r2://my-dir/locura.mp3"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Plain fields (`title`, `artist`) are readable by anyone directly from the manifest. Handle fields require a valid on-chain settlement to retrieve via the access worker.
|
|
214
|
+
|
|
227
215
|
### Consuming
|
|
228
216
|
|
|
229
217
|
#### Phase 1: Purchase
|
|
@@ -233,9 +221,8 @@ import { Identity } from "@semaphore-protocol/identity";
|
|
|
233
221
|
|
|
234
222
|
const identity = new Identity();
|
|
235
223
|
|
|
236
|
-
// Sign ERC-3009 authorization with the burner wallet
|
|
237
224
|
const preparedRegister = await fangorn.consumer.prepareRegister({
|
|
238
|
-
|
|
225
|
+
walletClient,
|
|
239
226
|
paymentRecipient: ownerAddress,
|
|
240
227
|
amount: 1n,
|
|
241
228
|
usdcAddress: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
|
|
@@ -243,76 +230,80 @@ const preparedRegister = await fangorn.consumer.prepareRegister({
|
|
|
243
230
|
usdcDomainVersion: "2",
|
|
244
231
|
});
|
|
245
232
|
|
|
246
|
-
// Submit payment and join the Semaphore group
|
|
247
233
|
const { txHash } = await fangorn.consumer.register({
|
|
248
234
|
owner: ownerAddress,
|
|
249
235
|
schemaId,
|
|
250
|
-
|
|
236
|
+
name: "track1",
|
|
251
237
|
identityCommitment: identity.commitment,
|
|
252
238
|
relayerPrivateKey: "0x...",
|
|
253
239
|
preparedRegister,
|
|
254
240
|
});
|
|
255
241
|
|
|
256
|
-
// Save identity.export()
|
|
242
|
+
// Save identity.export() — required for Phase 2
|
|
257
243
|
```
|
|
258
244
|
|
|
259
245
|
#### Phase 2: Claim
|
|
260
246
|
|
|
261
247
|
```ts
|
|
262
|
-
// Generate Groth16 ZK proof of group membership
|
|
263
248
|
const preparedSettle = await fangorn.consumer.prepareSettle({
|
|
264
|
-
resourceId:
|
|
249
|
+
resourceId: DataSourceRegistry.resourceIdLocal(ownerAddress, schemaId, "track1"),
|
|
265
250
|
identity,
|
|
266
251
|
stealthAddress: "0x...",
|
|
267
252
|
});
|
|
268
253
|
|
|
269
|
-
// Submit the proof and trigger the hook call (if configured)
|
|
270
254
|
const { txHash, nullifier } = await fangorn.consumer.claim({
|
|
271
255
|
owner: ownerAddress,
|
|
272
256
|
schemaId,
|
|
273
|
-
|
|
257
|
+
name: "track1",
|
|
274
258
|
relayerPrivateKey: "0x...",
|
|
275
259
|
preparedSettle,
|
|
276
260
|
});
|
|
277
261
|
|
|
278
|
-
//
|
|
262
|
+
// Save nullifier — required for Phase 3
|
|
279
263
|
```
|
|
280
264
|
|
|
281
|
-
#### Phase 3:
|
|
265
|
+
#### Phase 3: Fetch
|
|
282
266
|
|
|
283
267
|
```ts
|
|
284
268
|
import { createWalletClient, http } from "viem";
|
|
285
269
|
import { privateKeyToAccount } from "viem/accounts";
|
|
286
270
|
import { arbitrumSepolia } from "viem/chains";
|
|
287
271
|
|
|
288
|
-
const
|
|
272
|
+
const stealthWalletClient = createWalletClient({
|
|
289
273
|
account: privateKeyToAccount(stealthPrivateKey),
|
|
290
274
|
chain: arbitrumSepolia,
|
|
291
275
|
transport: http(rpcUrl),
|
|
292
276
|
});
|
|
293
277
|
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
walletClient,
|
|
278
|
+
const { data, contentType } = await fangorn.consumer.fetchField(
|
|
279
|
+
ownerAddress,
|
|
297
280
|
schemaId,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
281
|
+
"track1",
|
|
282
|
+
"audio",
|
|
283
|
+
nullifier.toString(),
|
|
284
|
+
stealthWalletClient,
|
|
285
|
+
);
|
|
303
286
|
```
|
|
304
287
|
|
|
305
|
-
|
|
288
|
+
The consumer signs `{ nullifier, resourceId, objectKey, timestamp }` with their stealth key. The access worker verifies the signature, checks `is_settled()` on-chain, and proxies the content bytes directly from R2. The content URL is never exposed to the client.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Access Worker
|
|
306
293
|
|
|
307
|
-
|
|
294
|
+
The Fangorn access worker is a Cloudflare Worker that gates R2 content behind on-chain settlement verification. Publishers deploy their own worker, with one worker per R2 bucket.
|
|
308
295
|
|
|
309
|
-
|
|
310
|
-
| --------------- | --------------------------------------------------- |
|
|
311
|
-
| `SettledGadget` | Caller must complete a USDC payment + ZK claim flow |
|
|
296
|
+
### How it works
|
|
312
297
|
|
|
313
|
-
|
|
298
|
+
1. Consumer signs `{ nullifier, resourceId, objectKey, timestamp }` with their stealth address private key
|
|
299
|
+
2. Worker recovers the stealth address from the signature
|
|
300
|
+
3. Worker calls `is_settled(stealthAddress, resourceId)` on the Settlement Registry
|
|
301
|
+
4. If settled → bytes proxied directly from R2
|
|
302
|
+
5. If not → 401
|
|
314
303
|
|
|
315
|
-
|
|
304
|
+
The worker is stateless, open-source, and has no logging. Its only capability is verifying settlement and proxying bytes. The content URL is never exposed to the consumer.
|
|
305
|
+
|
|
306
|
+
See the [fangorn-access-worker](https://github.com/fangorn-network/webworker) repo for deployment instructions.
|
|
316
307
|
|
|
317
308
|
---
|
|
318
309
|
|
|
@@ -322,9 +313,9 @@ See the [gadgets](./src/modules/gadgets/README.md) docs for details on implement
|
|
|
322
313
|
|
|
323
314
|
| Contract | Address |
|
|
324
315
|
| ------------------- | -------------------------------------------- |
|
|
325
|
-
| DataSource Registry | `
|
|
326
|
-
| Schema Registry | `
|
|
327
|
-
| Settlement Registry | `
|
|
316
|
+
| DataSource Registry | `0xdb82c131a9d51f6e7695e744bb2bd7774cbb224c` |
|
|
317
|
+
| Schema Registry | `0x35b67934f9c75bfef6ff3f4d61ff406d81420066` |
|
|
318
|
+
| Settlement Registry | `0x6aff8212e126ed3232958fd228bc58a202b8f590` |
|
|
328
319
|
|
|
329
320
|
---
|
|
330
321
|
|
|
@@ -338,8 +329,6 @@ pnpm test
|
|
|
338
329
|
|
|
339
330
|
### E2E Tests
|
|
340
331
|
|
|
341
|
-
Copy the example env and fill in values:
|
|
342
|
-
|
|
343
332
|
```sh
|
|
344
333
|
cp env.example .env
|
|
345
334
|
pnpm test:e2e
|
|
@@ -347,36 +336,34 @@ pnpm test:e2e
|
|
|
347
336
|
|
|
348
337
|
Required variables:
|
|
349
338
|
|
|
350
|
-
| Variable
|
|
351
|
-
|
|
|
352
|
-
| `DELEGATOR_ETH_PRIVATE_KEY`
|
|
353
|
-
| `DELEGATEE_ETH_PRIVATE_KEY`
|
|
354
|
-
| `PINATA_JWT`
|
|
355
|
-
| `PINATA_GATEWAY`
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
358
|
-
| `
|
|
359
|
-
| `
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
362
|
-
| `
|
|
363
|
-
|
|
364
|
-
|
|
339
|
+
| Variable | Description |
|
|
340
|
+
| ------------------------------ | ----------------------------------------- |
|
|
341
|
+
| `DELEGATOR_ETH_PRIVATE_KEY` | Publisher private key (needs testnet ETH) |
|
|
342
|
+
| `DELEGATEE_ETH_PRIVATE_KEY` | Consumer private key |
|
|
343
|
+
| `PINATA_JWT` | Pinata API JWT |
|
|
344
|
+
| `PINATA_GATEWAY` | Pinata gateway URL |
|
|
345
|
+
| `WORKER_URL` | Access worker URL (optional for Phase 3) |
|
|
346
|
+
| `CHAIN_NAME` | `arbitrumSepolia` |
|
|
347
|
+
| `CAIP2` | `421614` |
|
|
348
|
+
| `RPC_URL` | RPC endpoint |
|
|
349
|
+
| `USDC_ADDRESS` | USDC contract address |
|
|
350
|
+
| `DATA_SOURCE_REGISTRY_ADDRESS` | DataSourceRegistry address |
|
|
351
|
+
| `SCHEMA_REGISTRY_ADDRESS` | SchemaRegistry address |
|
|
352
|
+
| `SETTLEMENT_REGISTRY_ADDRESS` | SettlementRegistry address |
|
|
353
|
+
|
|
354
|
+
Phase 3 tests are skipped unless `WORKER_URL` is set. Run the access worker locally with `wrangler dev --local` and set `WORKER_URL=http://localhost:8787` to enable them.
|
|
365
355
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
CHAIN_RPC_URL=https://sepolia-rollup.arbitrum.io/rpc
|
|
370
|
-
USDC_CONTRACT_ADDRESS=0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d
|
|
371
|
-
DS_REGISTRY_ADDR=0x6fb3579bfd504cce85b923db335dfc096d912478
|
|
372
|
-
SCHEMA_REGISTRY_ADDR=0x49ab3d52b997e63ad56c91178df48263fd80b2dc
|
|
373
|
-
SETTLEMENT_TRACKER_ADDR=0x7c6ae9eb3398234eb69b2f3acfae69065505ff69
|
|
374
|
-
```
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Limitations / Future Work
|
|
375
359
|
|
|
376
|
-
|
|
360
|
+
- Schema validation is client-side only — no on-chain enforcement.
|
|
361
|
+
- The access worker is a trusted component. Future versions will replace it with a TEE or protocol-native verification layer.
|
|
362
|
+
- One worker per R2 bucket. Multi-bucket support is planned.
|
|
363
|
+
- Purchase ledger is in-memory only. Persistent ledger backed by IPFS is in progress.
|
|
377
364
|
|
|
378
365
|
---
|
|
379
366
|
|
|
380
367
|
## License
|
|
381
368
|
|
|
382
|
-
|
|
369
|
+
MITSonnet 4.6Claude is AI and can make mistakes. Please double-check responses.
|