@ariestools/aries-chain-serve 0.1.16 → 0.1.18
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.
|
@@ -9,9 +9,13 @@ export declare function isChainBackingKind(value: string): value is ChainBacking
|
|
|
9
9
|
* this seam up to the server level rather than fit this interface.
|
|
10
10
|
*/
|
|
11
11
|
export interface ChainBacking {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
Human-readable label for banners and status output.
|
|
14
|
+
*/
|
|
13
15
|
readonly description: string;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
Directory the S3-compatible server persists bucket objects under. Only valid after prepare().
|
|
18
|
+
*/
|
|
15
19
|
readonly directory: string;
|
|
16
20
|
cleanup(): Promise<void>;
|
|
17
21
|
prepare(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainBacking.d.ts","sourceRoot":"","sources":["../../src/ChainBacking.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,qBAAsB,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAA;AAE5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,gBAAgB,CAE3E;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B
|
|
1
|
+
{"version":3,"file":"ChainBacking.d.ts","sourceRoot":"","sources":["../../src/ChainBacking.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,qBAAsB,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAA;AAE5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,gBAAgB,CAE3E;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;MAEE;IACF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;MAEE;IACF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED,wBAAgB,mBAAmB,IAAI,YAAY,CAgBlD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAMnE"}
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ChainBacking.ts", "../../src/startChainServer.ts"],
|
|
4
|
-
"sourcesContent": ["import { mkdtemp, rm } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport path from 'node:path'\n\nexport const CHAIN_BACKINGS = ['memory'] as const\nexport type ChainBackingKind = typeof CHAIN_BACKINGS[number]\n\nexport function isChainBackingKind(value: string): value is ChainBackingKind {\n return (CHAIN_BACKINGS as readonly string[]).includes(value)\n}\n\n/**\n * Where the served chain layout's objects live. v1 ships only `memory` (an\n * ephemeral temp directory wiped on shutdown); a `disk` kind (caller-owned\n * directory, no-op cleanup) is the natural next addition. An `s3` kind will\n * proxy a remote bucket instead of running a local store, so it will lift\n * this seam up to the server level rather than fit this interface.\n */\nexport interface ChainBacking {\n
|
|
5
|
-
"mappings": ";AAAA,SAAS,SAAS,UAAU;AAC5B,SAAS,cAAc;AACvB,OAAO,UAAU;AAEV,IAAM,iBAAiB,CAAC,QAAQ;AAGhC,SAAS,mBAAmB,OAA0C;AAC3E,SAAQ,eAAqC,SAAS,KAAK;AAC7D;
|
|
4
|
+
"sourcesContent": ["import { mkdtemp, rm } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport path from 'node:path'\n\nexport const CHAIN_BACKINGS = ['memory'] as const\nexport type ChainBackingKind = typeof CHAIN_BACKINGS[number]\n\nexport function isChainBackingKind(value: string): value is ChainBackingKind {\n return (CHAIN_BACKINGS as readonly string[]).includes(value)\n}\n\n/**\n * Where the served chain layout's objects live. v1 ships only `memory` (an\n * ephemeral temp directory wiped on shutdown); a `disk` kind (caller-owned\n * directory, no-op cleanup) is the natural next addition. An `s3` kind will\n * proxy a remote bucket instead of running a local store, so it will lift\n * this seam up to the server level rather than fit this interface.\n */\nexport interface ChainBacking {\n /**\n Human-readable label for banners and status output.\n */\n readonly description: string\n /**\n Directory the S3-compatible server persists bucket objects under. Only valid after prepare().\n */\n readonly directory: string\n cleanup(): Promise<void>\n prepare(): Promise<void>\n}\n\nexport function createMemoryBacking(): ChainBacking {\n let dir: string | undefined\n return {\n description: 'memory (ephemeral temp directory)',\n get directory(): string {\n if (dir === undefined) throw new Error('Memory backing not prepared')\n return dir\n },\n async prepare(): Promise<void> {\n dir ??= await mkdtemp(path.join(tmpdir(), 'aries-chain-'))\n },\n async cleanup(): Promise<void> {\n if (dir !== undefined) await rm(dir, { recursive: true, force: true })\n dir = undefined\n },\n }\n}\n\nexport function resolveBacking(kind: ChainBackingKind): ChainBacking {\n switch (kind) {\n case 'memory': {\n return createMemoryBacking()\n }\n }\n}\n", "import S3rver from 's3rver'\n\nimport type { ChainBacking } from './ChainBacking.ts'\n\n/**\n * The bucket-per-role split of the published chain layout. Path-style\n * addressing turns each bucket into a subfolder of the one origin \u2014\n * `/blocks`, `/state`, `/indexes` \u2014 replacing the production sub-domains.\n */\nexport const CHAIN_BUCKETS = ['blocks', 'state', 'indexes'] as const\nexport type ChainBucket = typeof CHAIN_BUCKETS[number]\n\nconst DEFAULT_HOST = '127.0.0.1'\nconst DEFAULT_PORT = 8791\n\n/**\nAllow browser RestBlockViewer clients to read the layout cross-origin.\n*/\nconst CORS_ALLOW_READS = `<CORSConfiguration>\n <CORSRule>\n <AllowedOrigin>*</AllowedOrigin>\n <AllowedMethod>GET</AllowedMethod>\n <AllowedMethod>HEAD</AllowedMethod>\n <AllowedHeader>*</AllowedHeader>\n </CORSRule>\n</CORSConfiguration>`\n\nexport interface ChainServerOptions {\n backing: ChainBacking\n host?: string\n port?: number\n publicHost?: string\n silent?: boolean\n tls?: {\n cert: string | Buffer\n key: string | Buffer\n }\n}\n\nexport interface RunningChainServer {\n baseUrl: string\n port: number\n close(): Promise<void>\n}\n\n/**\n * Boots an S3-compatible server (s3rver) pre-configured with the three chain\n * layout buckets. Writers use the S3 API (any credentials are accepted);\n * readers fetch `/{bucket}/{layout-path}` over HTTP or optional TLS.\n *\n * DEV ONLY \u2014 this server is a local development fixture, not a production\n * chain host. It intentionally skips the production concerns the datalake\n * and signing-pool planes carry (auth, metrics, durable multi-instance\n * storage): any S3 credentials are accepted and the only backing is an\n * ephemeral temp directory. Production chains stay on the real sub-domain\n * layout (blocks/state/indexes origins backed by S3/R2).\n */\nexport async function startChainServer(options: ChainServerOptions): Promise<RunningChainServer> {\n const host = options.host ?? DEFAULT_HOST\n const publicHost = options.publicHost ?? host\n await options.backing.prepare()\n const server = new S3rver({\n address: host,\n allowMismatchedSignatures: true,\n cert: options.tls?.cert,\n configureBuckets: CHAIN_BUCKETS.map(name => ({ name, configs: [CORS_ALLOW_READS] })),\n directory: options.backing.directory,\n key: options.tls?.key,\n port: options.port ?? DEFAULT_PORT,\n silent: options.silent ?? false,\n vhostBuckets: false,\n })\n try {\n const { port } = await server.run()\n return {\n baseUrl: `${options.tls === undefined ? 'http' : 'https'}://${publicHost}:${port}`,\n port,\n close: async (): Promise<void> => {\n await server.close()\n await options.backing.cleanup()\n },\n }\n } catch (error) {\n await options.backing.cleanup()\n throw error\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS,UAAU;AAC5B,SAAS,cAAc;AACvB,OAAO,UAAU;AAEV,IAAM,iBAAiB,CAAC,QAAQ;AAGhC,SAAS,mBAAmB,OAA0C;AAC3E,SAAQ,eAAqC,SAAS,KAAK;AAC7D;AAsBO,SAAS,sBAAoC;AAClD,MAAI;AACJ,SAAO;AAAA,IACL,aAAa;AAAA,IACb,IAAI,Y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I,IAAI;AAAA,MAChF;AAAA,MACA,OAAO,YAA2B;AAChC,cAAM,OAAO,MAAM;AACnB,cAAM,QAAQ,QAAQ,QAAQ;AAAA,MAChC;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AACd,UAAM,QAAQ,QAAQ,QAAQ;AAC9B,UAAM;AAAA,EACR;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startChainServer.d.ts","sourceRoot":"","sources":["../../src/startChainServer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,aAAa,yCAA0C,CAAA;AACpE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"startChainServer.d.ts","sourceRoot":"","sources":["../../src/startChainServer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,aAAa,yCAA0C,CAAA;AACpE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;AAiBtD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,YAAY,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;QACrB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACrB,CAAA;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6B/F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariestools/aries-chain-serve",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "Aries chain REST server: serves the XL1 published-chain S3 layout from one origin with /blocks, /state, /indexes subfolders",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ariestools",
|
|
@@ -34,27 +34,32 @@
|
|
|
34
34
|
"dist",
|
|
35
35
|
"README.md"
|
|
36
36
|
],
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
37
|
"dependencies": {
|
|
41
38
|
"s3rver": "~3.7.1"
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
|
-
"@ariestools/
|
|
45
|
-
"@ariestools/
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
41
|
+
"@ariestools/actor-model": "~1.3.0",
|
|
42
|
+
"@ariestools/actor-system": "~1.3.0",
|
|
43
|
+
"@ariestools/cli-kit": "~1.2.3",
|
|
44
|
+
"@ariestools/cli-kit-node": "~1.2.3",
|
|
45
|
+
"@ariestools/toolchain": "~9.0.2",
|
|
46
|
+
"@ariestools/tsconfig": "~9.0.2",
|
|
47
|
+
"@aws-sdk/client-s3": "~3.1110.0",
|
|
48
|
+
"@types/node": "~26.2.0",
|
|
48
49
|
"@types/s3rver": "~3.7.4",
|
|
49
|
-
"rolldown": "~1.2.
|
|
50
|
+
"rolldown": "~1.2.4",
|
|
50
51
|
"typescript": "~6.0.3",
|
|
51
|
-
"vite": "~8.1
|
|
52
|
-
"vitest": "~4.1.10"
|
|
52
|
+
"vite": "~8.2.1",
|
|
53
|
+
"vitest": "~4.1.10",
|
|
54
|
+
"zod": "~4.4.3"
|
|
53
55
|
},
|
|
54
56
|
"engines": {
|
|
55
57
|
"node": ">=18.17.1"
|
|
56
58
|
},
|
|
57
59
|
"engineStrict": true,
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
58
63
|
"scripts": {
|
|
59
64
|
"package-compile": "package-compile-only && rolldown -c rolldown.config.ts"
|
|
60
65
|
}
|