@subetha/proof-of-call 0.1.0 → 0.1.1
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 +23 -10
- package/dist/poc.mjs +10 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
25
25
|
1. **Install the package.**
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npm install -g @subetha/proof-of-call@0.1.
|
|
28
|
+
npm install -g @subetha/proof-of-call@0.1.1
|
|
29
29
|
poc --version
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -39,7 +39,7 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
39
39
|
| macOS arm64 | `fb330265653d23a8cfbfef05500b408d9e488a7f5d0ba84f2f23f77ac976c92e` | `9f111c3d2c604d39d72916421ae51752154847a3` (`main`) |
|
|
40
40
|
| Linux arm64 (glibc) | `adf6ab438ca36f4fadbc50f17df35b0511bdfeeebabd794d022b080e5caa522d` | `1213cc51b74f4f46e258ab5f0ae769812bee4bb9` (`9f111c3` plus the Linux build scripts) |
|
|
41
41
|
|
|
42
|
-
Without a global install, every command also runs as `npx @subetha/proof-of-call@0.1.
|
|
42
|
+
Without a global install, every command also runs as `npx @subetha/proof-of-call@0.1.1 <command>`. Use the same
|
|
43
43
|
package spec each time: the configuration records the absolute path of the binary and its sha256, and `poc mcp`
|
|
44
44
|
and `poc serve`, when they start on their own, refuse to start when the file at that path is gone or has another
|
|
45
45
|
sha256 (run `poc setup` again then).
|
|
@@ -67,14 +67,22 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
69
|
umask 077
|
|
70
|
+
mkdir -p ~/.config/subetha
|
|
70
71
|
# one line: your Base Sepolia test key, 0x + 64 hex characters
|
|
71
72
|
$EDITOR ~/.config/subetha/funding.key
|
|
72
73
|
# the witness's published shared Router principal: {"principalId": "…", "token": "…"}
|
|
73
74
|
$EDITOR ~/.config/subetha/router-access.json
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
**Where to get the Router principal:**
|
|
77
|
-
|
|
77
|
+
**Where to get the Router principal:** the two values of `router-access.json` for the public witness are published
|
|
78
|
+
in the repository README, section "Use the public witness":
|
|
79
|
+
<https://github.com/subetha-labs/subetha-proof-of-call#use-the-public-witness>. Copy the JSON line from there; it
|
|
80
|
+
is not repeated here.
|
|
81
|
+
|
|
82
|
+
**Test funds:** the address of your funding key needs Base Sepolia test USDC. Circle's testnet faucet gives it:
|
|
83
|
+
<https://faucet.circle.com> (choose USDC on Base Sepolia). `poc setup` prints the payer address to fund. It needs
|
|
84
|
+
no Base Sepolia ETH: the requester only signs a transfer authorization (x402, EIP-3009), and a facilitator
|
|
85
|
+
submits it on chain.
|
|
78
86
|
|
|
79
87
|
4. **Set up**: checks the prerequisites, shows your payer address and the testnet asset, reads
|
|
80
88
|
`GET <witness>/v1/witness` and shows the witness identity it will trust (its Router recipient address, executor
|
|
@@ -84,11 +92,15 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
84
92
|
|
|
85
93
|
```sh
|
|
86
94
|
poc setup \
|
|
87
|
-
--witness https
|
|
95
|
+
--witness https://witness.subethalabs.com \
|
|
88
96
|
--funding-key-file ~/.config/subetha/funding.key \
|
|
89
|
-
--router-access-file ~/.config/subetha/router-access.json
|
|
97
|
+
--router-access-file ~/.config/subetha/router-access.json \
|
|
98
|
+
--ens-rpc-url https://ethereum-sepolia-rpc.publicnode.com
|
|
90
99
|
```
|
|
91
100
|
|
|
101
|
+
`https://witness.subethalabs.com` is SubEtha's public witness; another witness has another origin and its own
|
|
102
|
+
access values. `--ens-rpc-url` is needed to hire workers by ENS name (more on it below).
|
|
103
|
+
|
|
92
104
|
Setup says which binary it uses: `the prebuilt binary of the npm package … is used`, with its sha256 marked
|
|
93
105
|
`(the pinned SubEtha build)`. It finds the SRS at the default location of `poc fetch-srs`; `--srs <file>` (or
|
|
94
106
|
`DELIVERY_SRS_DAT`) names another one.
|
|
@@ -104,7 +116,8 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
104
116
|
with `--delivery-bin <path>` (or switch with `--use-packaged-delivery`).
|
|
105
117
|
|
|
106
118
|
To hire workers by ENS name, also give a Sepolia JSON-RPC endpoint: `--ens-rpc-url https://<sepolia rpc>` (https,
|
|
107
|
-
no credentials in the URL's user part
|
|
119
|
+
no credentials in the URL's user part; one public endpoint that needs no key is
|
|
120
|
+
`https://ethereum-sepolia-rpc.publicnode.com`), and optionally `--ens-universal-resolver <address>` to override the Sepolia
|
|
108
121
|
Universal Resolver. Setup shows only the RPC's origin. The URL is kept in `config.json` (mode 600); if it carries an
|
|
109
122
|
API key you would rather not store, leave it out and set `ENS_RPC_URL` (and `ENS_UNIVERSAL_RESOLVER`) in the MCP
|
|
110
123
|
server's environment instead: `poc mcp` uses those when set, else the values from setup. There is no default RPC
|
|
@@ -116,7 +129,7 @@ Requirements: Node.js 22 or later, on macOS arm64 or Linux arm64 (glibc). Other
|
|
|
116
129
|
```sh
|
|
117
130
|
claude mcp add subetha-requester -- poc mcp
|
|
118
131
|
# without a global install:
|
|
119
|
-
claude mcp add subetha-requester -- npx -y @subetha/proof-of-call@0.1.
|
|
132
|
+
claude mcp add subetha-requester -- npx -y @subetha/proof-of-call@0.1.1 mcp
|
|
120
133
|
```
|
|
121
134
|
|
|
122
135
|
### Alternative: your own build of the `delivery` binary
|
|
@@ -152,8 +165,8 @@ pinned build.
|
|
|
152
165
|
```sh
|
|
153
166
|
git clone https://github.com/subetha-labs/subetha-proof-of-call.git && cd subetha-proof-of-call
|
|
154
167
|
npm ci
|
|
155
|
-
cd packages/toolkit && npm pack # builds dist/poc.mjs and writes subetha-proof-of-call-0.1.
|
|
156
|
-
npm install -g ./subetha-proof-of-call-0.1.
|
|
168
|
+
cd packages/toolkit && npm pack # builds dist/poc.mjs and writes subetha-proof-of-call-0.1.1.tgz
|
|
169
|
+
npm install -g ./subetha-proof-of-call-0.1.1.tgz
|
|
157
170
|
```
|
|
158
171
|
|
|
159
172
|
## Commands
|
package/dist/poc.mjs
CHANGED
|
@@ -3675,7 +3675,7 @@ function recordedCalls(home, ledger) {
|
|
|
3675
3675
|
const verdict = readJson(path8.join(dir, "verdict.json"));
|
|
3676
3676
|
const decided = isRecord9(verdict) && verdict["orderId"] === line.orderId && verdict["callNumber"] === line.callNumber ? verdict : void 0;
|
|
3677
3677
|
const ledgerVerdict = ledger.filter((entry) => entry.type === "call_verdict" && entry.callNumber === line.callNumber && entry.orderId === line.orderId);
|
|
3678
|
-
const verified = decided?.["verified"] === true && decided["unverifiedReason"] === null && ledgerVerdict.some((entry) => entry.verified);
|
|
3678
|
+
const verified = decided?.["verified"] === true && decided["unverifiedReason"] === null && ledgerVerdict.some((entry) => entry.verified === true);
|
|
3679
3679
|
const router = isRecord9(decided?.["router"]) ? decided["router"] : void 0;
|
|
3680
3680
|
const local = isRecord9(decided?.["local"]) ? decided["local"] : void 0;
|
|
3681
3681
|
const response = verified ? readBounded(path8.join(dir, "response.bin"), MAX_RESPONSE_BYTES) : void 0;
|
|
@@ -5754,7 +5754,7 @@ ${String(stderr)}
|
|
|
5754
5754
|
}
|
|
5755
5755
|
|
|
5756
5756
|
// src/pins.ts
|
|
5757
|
-
var TOOLKIT_VERSION = "0.1.
|
|
5757
|
+
var TOOLKIT_VERSION = "0.1.1";
|
|
5758
5758
|
var ROUTER_SOURCE = Object.freeze({
|
|
5759
5759
|
repository: "https://github.com/subetha-labs/subetha-router.git",
|
|
5760
5760
|
/** `main` after PR #236 (zktls: publish the source of the delivery binary). */
|
|
@@ -8671,6 +8671,10 @@ import { existsSync as existsSync17 } from "node:fs";
|
|
|
8671
8671
|
import { createConnection } from "node:net";
|
|
8672
8672
|
import path22 from "node:path";
|
|
8673
8673
|
var SOCKET_FILE = "serve.sock";
|
|
8674
|
+
function socketPathProblem(socketPath) {
|
|
8675
|
+
const bytes = Buffer.byteLength(socketPath);
|
|
8676
|
+
return bytes < 104 ? void 0 : `the data directory path is probably too long for the service's local socket (${socketPath} is ${bytes} bytes; local socket paths are limited to about 104 bytes on macOS and 108 on Linux): choose a shorter data directory (--data-dir, or POC_DATA_DIR)`;
|
|
8677
|
+
}
|
|
8674
8678
|
var MAX_LINE_BYTES = 4 * 1024 * 1024;
|
|
8675
8679
|
var REQUEST_TIMEOUT_MS = 12e4;
|
|
8676
8680
|
function socketPathOf(dataDir) {
|
|
@@ -9170,9 +9174,11 @@ async function runServe(dataDir, env) {
|
|
|
9170
9174
|
let handle;
|
|
9171
9175
|
try {
|
|
9172
9176
|
handle = await startServe({ dataDir, core, log: log2, ...prepared.resolve === void 0 ? {} : { resolve: prepared.resolve } });
|
|
9173
|
-
} catch {
|
|
9177
|
+
} catch (error) {
|
|
9174
9178
|
opened.budget.close();
|
|
9175
|
-
|
|
9179
|
+
const code = typeof error === "object" && error !== null && typeof error.code === "string" ? ` (${error.code})` : "";
|
|
9180
|
+
const tooLong = socketPathProblem(socketPathOf(dataDir));
|
|
9181
|
+
return die(`could not open the local socket in the data directory${code}${tooLong === void 0 ? "" : `: ${tooLong}`}`);
|
|
9176
9182
|
}
|
|
9177
9183
|
log2.write(`poc serve ${TOOLKIT_VERSION} running (${prepared.summary}); pid ${process.pid}`);
|
|
9178
9184
|
let ending = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subetha/proof-of-call",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "SubEtha Proof of Call requester toolkit: hire an agent, pay its API calls through the SubEtha Router with your own key, and verify each call with zkTLS before you decrypt it (Base Sepolia test funds only)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|