@ocap/chain-node 0.0.0-stage → 1.32.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.
Files changed (43) hide show
  1. package/README.md +234 -2
  2. package/esm/access-log.d.mts +34 -0
  3. package/esm/access-log.mjs +71 -0
  4. package/esm/config-consistency.d.mts +59 -0
  5. package/esm/config-consistency.mjs +220 -0
  6. package/esm/env.d.mts +32 -0
  7. package/esm/env.mjs +218 -0
  8. package/esm/follower-config.d.mts +25 -0
  9. package/esm/follower-config.mjs +57 -0
  10. package/esm/index.d.mts +7 -0
  11. package/esm/index.mjs +7 -0
  12. package/esm/standalone-env.d.mts +92 -0
  13. package/esm/standalone-env.mjs +152 -0
  14. package/esm/start-chain-node.d.mts +14 -0
  15. package/esm/start-chain-node.mjs +1107 -0
  16. package/esm/test-hooks-token.d.mts +12 -0
  17. package/esm/test-hooks-token.mjs +21 -0
  18. package/esm/testing.d.mts +13 -0
  19. package/esm/testing.mjs +23 -0
  20. package/esm/types.d.mts +310 -0
  21. package/esm/types.mjs +1 -0
  22. package/lib/_virtual/rolldown_runtime.cjs +29 -0
  23. package/lib/access-log.cjs +73 -0
  24. package/lib/access-log.d.cts +34 -0
  25. package/lib/config-consistency.cjs +227 -0
  26. package/lib/config-consistency.d.cts +59 -0
  27. package/lib/env.cjs +221 -0
  28. package/lib/env.d.cts +32 -0
  29. package/lib/follower-config.cjs +63 -0
  30. package/lib/follower-config.d.cts +25 -0
  31. package/lib/index.cjs +32 -0
  32. package/lib/index.d.cts +7 -0
  33. package/lib/standalone-env.cjs +165 -0
  34. package/lib/standalone-env.d.cts +92 -0
  35. package/lib/start-chain-node.cjs +1116 -0
  36. package/lib/start-chain-node.d.cts +14 -0
  37. package/lib/test-hooks-token.cjs +24 -0
  38. package/lib/test-hooks-token.d.cts +12 -0
  39. package/lib/testing.cjs +23 -0
  40. package/lib/testing.d.cts +13 -0
  41. package/lib/types.cjs +0 -0
  42. package/lib/types.d.cts +310 -0
  43. package/package.json +78 -4
@@ -0,0 +1,14 @@
1
+ import { ChainNodeTestHooks, ChainProfile, RunningChainNode, StartChainNodeOptions } from "./types.cjs";
2
+
3
+ //#region src/start-chain-node.d.ts
4
+
5
+ /**
6
+ * Boot a unified OCAP chain node (`validator`, `follower`, or `hotstuff`) with a 12-step LIFO rollback guard
7
+ * and 9-step reverse graceful shutdown (`docs/chain-node-design.md` §2.3–§2.4).
8
+ */
9
+ declare function startChainNode(options: StartChainNodeOptions): Promise<RunningChainNode>;
10
+ declare function startChainNode(profile: ChainProfile & {
11
+ testHooks?: ChainNodeTestHooks;
12
+ }): Promise<RunningChainNode>;
13
+ //#endregion
14
+ export { startChainNode };
@@ -0,0 +1,24 @@
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ let _ocap_util_lib_error = require("@ocap/util/lib/error");
3
+
4
+ //#region src/test-hooks-token.ts
5
+ /**
6
+ * Private non-global symbol guarding `ChainNodeTestHooks` (P3-2).
7
+ *
8
+ * Intentionally created via `Symbol(...)` (NEVER `Symbol.for(...)`) and unexported from the
9
+ * `@ocap/chain-node` barrel so JSON/CLI/env payloads and untrusted callers cannot forge it.
10
+ */
11
+ const CHAIN_NODE_TEST_HOOKS_TOKEN = Symbol("@ocap/chain-node/test-hooks-token");
12
+ function assertNotProductionForTestHooks() {
13
+ if (process.env.NODE_ENV === "production") throw new _ocap_util_lib_error.CustomError("FORBIDDEN_IN_PRODUCTION", "ChainNodeTestHooks cannot be enabled when NODE_ENV=production");
14
+ }
15
+ function assertValidChainNodeTestHooks(candidate) {
16
+ if (candidate === void 0) return;
17
+ assertNotProductionForTestHooks();
18
+ if (!candidate || typeof candidate !== "object" || candidate[CHAIN_NODE_TEST_HOOKS_TOKEN] !== true) throw new _ocap_util_lib_error.CustomError("SECURITY_VIOLATION", "Invalid ChainNodeTestHooks token: must be created via createChainNodeTestHooks from @ocap/chain-node/testing");
19
+ }
20
+
21
+ //#endregion
22
+ exports.CHAIN_NODE_TEST_HOOKS_TOKEN = CHAIN_NODE_TEST_HOOKS_TOKEN;
23
+ exports.assertNotProductionForTestHooks = assertNotProductionForTestHooks;
24
+ exports.assertValidChainNodeTestHooks = assertValidChainNodeTestHooks;
@@ -0,0 +1,12 @@
1
+ //#region src/test-hooks-token.d.ts
2
+ /**
3
+ * Private non-global symbol guarding `ChainNodeTestHooks` (P3-2).
4
+ *
5
+ * Intentionally created via `Symbol(...)` (NEVER `Symbol.for(...)`) and unexported from the
6
+ * `@ocap/chain-node` barrel so JSON/CLI/env payloads and untrusted callers cannot forge it.
7
+ */
8
+ declare const CHAIN_NODE_TEST_HOOKS_TOKEN: unique symbol;
9
+ declare function assertNotProductionForTestHooks(): void;
10
+ declare function assertValidChainNodeTestHooks(candidate: unknown): void;
11
+ //#endregion
12
+ export { CHAIN_NODE_TEST_HOOKS_TOKEN, assertNotProductionForTestHooks, assertValidChainNodeTestHooks };
@@ -0,0 +1,23 @@
1
+ const require_test_hooks_token = require('./test-hooks-token.cjs');
2
+
3
+ //#region src/testing.ts
4
+ /**
5
+ * Construct a token-stamped `ChainNodeTestHooks` object for deterministic tests (`@ocap/chain-node/testing`).
6
+ *
7
+ * Hard-blocked when `process.env.NODE_ENV === 'production'` (`FORBIDDEN_IN_PRODUCTION`), and stamped with a
8
+ * private non-global `Symbol` (`P3-2`) re-verified inside `startChainNode` Step 1.
9
+ */
10
+ function createChainNodeTestHooks(input = {}) {
11
+ require_test_hooks_token.assertNotProductionForTestHooks();
12
+ const stamped = { ...input };
13
+ Object.defineProperty(stamped, require_test_hooks_token.CHAIN_NODE_TEST_HOOKS_TOKEN, {
14
+ value: true,
15
+ enumerable: false,
16
+ configurable: false,
17
+ writable: false
18
+ });
19
+ return Object.freeze(stamped);
20
+ }
21
+
22
+ //#endregion
23
+ exports.createChainNodeTestHooks = createChainNodeTestHooks;
@@ -0,0 +1,13 @@
1
+ import { ChainNodeTestHooks, ChainNodeTestHooksInput, FollowerSyncTestController, FollowerUpstreamInterceptorContext } from "./types.cjs";
2
+
3
+ //#region src/testing.d.ts
4
+
5
+ /**
6
+ * Construct a token-stamped `ChainNodeTestHooks` object for deterministic tests (`@ocap/chain-node/testing`).
7
+ *
8
+ * Hard-blocked when `process.env.NODE_ENV === 'production'` (`FORBIDDEN_IN_PRODUCTION`), and stamped with a
9
+ * private non-global `Symbol` (`P3-2`) re-verified inside `startChainNode` Step 1.
10
+ */
11
+ declare function createChainNodeTestHooks(input?: ChainNodeTestHooksInput): ChainNodeTestHooks;
12
+ //#endregion
13
+ export { type ChainNodeTestHooks, type ChainNodeTestHooksInput, type FollowerSyncTestController, type FollowerUpstreamInterceptorContext, createChainNodeTestHooks };
package/lib/types.cjs ADDED
File without changes
@@ -0,0 +1,310 @@
1
+ import { FutureTimestampGuardConfig, TChainConfigCheckMode } from "./standalone-env.cjs";
2
+ import { CHAIN_NODE_TEST_HOOKS_TOKEN } from "./test-hooks-token.cjs";
3
+ import express from "express";
4
+ import { IChainConfig, IPipelineLogger, TFollowerSyncMode, TNodeWritePolicy } from "@ocap/types";
5
+ import http from "node:http";
6
+ import { AnchorPublisher, ICheckpointSignerWallet, IHotStuffRuntimeValidatorMember, ILedgerHealth, INodeRoleConfig, ISegmentArchiveStore, IWriterLeaseConfig, Ledger, LedgerConfig } from "@arcblock/ledger-core";
7
+ import { SqliteLedgerStorage } from "@arcblock/ledger-sqlite";
8
+ import SqliteIndexDB from "@ocap/indexdb-sqlite";
9
+ import OCAPResolver, { FollowerSyncService, HotStuffNodeRuntime, HotStuffNodeRuntimeOptions, IColdSegmentReader, INodeMaintenanceController, NodePreferencesManager, TFollowerUpstreamFetchKind } from "@ocap/resolver";
10
+ import SqliteStateDB from "@ocap/statedb-sqlite";
11
+ import { SqliteTrustedStorage } from "@ocap/trusted-storage";
12
+
13
+ //#region src/types.d.ts
14
+ type ILedgerLeaseOptions = IWriterLeaseConfig;
15
+ type ILedgerHealthStatus = ILedgerHealth;
16
+ type TNodeRetentionMode = INodeRoleConfig['retentionMode'];
17
+ type ChainNodeSegmentPublisher = NonNullable<LedgerConfig['segmentPublisher']> & {
18
+ getArchiveStore?: () => ISegmentArchiveStore | undefined;
19
+ };
20
+ interface TrustedAccountConfig {
21
+ address: string;
22
+ [key: string]: unknown;
23
+ }
24
+ /**
25
+ * Consensus / proposer signer configuration supporting `ed25519`, standard `secp256k1` (`did:abt:z...`),
26
+ * and Ethereum `0x...` `secp256k1` accounts.
27
+ */
28
+ interface ChainNodeSignerConfig {
29
+ address: string;
30
+ secretKey: string;
31
+ publicKey?: string;
32
+ keyType?: 'ed25519' | 'secp256k1' | 'eth';
33
+ }
34
+ /**
35
+ * Public-key-only proposer configuration for legacy single-validator chains whose moderator secretKey
36
+ * is held offline (e.g., Blocklet Server `BLOCKLET_APP_PPK` before `CHAIN_CONSENSUS_SK` cutover).
37
+ * Produces unsigned local checkpoints while `storage.trustedStorageSecretKey` signs `trusted.sqlite`.
38
+ */
39
+ interface PublicKeyOnlyValidatorSignerConfig {
40
+ address: string;
41
+ publicKey?: string;
42
+ secretKey?: undefined;
43
+ keyType?: 'ed25519' | 'secp256k1' | 'eth';
44
+ }
45
+ type ValidatorSignerConfig = ChainNodeSignerConfig | PublicKeyOnlyValidatorSignerConfig;
46
+ type ChainNodeRoleConfig = ValidatorRoleConfig | FollowerRoleConfig | HotStuffValidatorRoleConfig;
47
+ interface ValidatorRoleConfig {
48
+ kind: 'validator';
49
+ signer: ValidatorSignerConfig;
50
+ retentionMode?: TNodeRetentionMode;
51
+ hotWindowEntries?: number;
52
+ hotWindowCheckpoints?: number;
53
+ snapshotBaseUrl?: string | null;
54
+ witnessQuorum?: number;
55
+ trustedWitnesses?: Record<string, string> | string[];
56
+ witnessSubmitUrls?: string[];
57
+ anchorWebhookUrl?: string | null;
58
+ }
59
+ interface FollowerRoleConfig {
60
+ kind: 'follower';
61
+ /** `'reject'` (`FOLLOWER_READ_ONLY`) | `'forward'` (single-hop forward to Leader via `LeaderRouter`) */
62
+ writePolicy: TNodeWritePolicy;
63
+ upstreamChainUrl: string | null;
64
+ clusterPeerUrls?: string[];
65
+ snapshotBaseUrl?: string | null;
66
+ snapshotPrefix?: string;
67
+ trustedProposer?: string | null;
68
+ trustedProposerPublicKey?: string | null;
69
+ hotstuffValidators?: IHotStuffRuntimeValidatorMember[];
70
+ hotstuffQuorumThreshold?: number;
71
+ /** Whether `127.0.0.1` / RFC1918 private peers are allowed (`false` by default for SSRF safety) */
72
+ allowPrivatePeers?: boolean;
73
+ /** Reject cascaded keyless/unsigned follower upstreams with `UPSTREAM_CASCADED_FORBIDDEN` */
74
+ disallowKeylessCascadedUpstream?: boolean;
75
+ allowUnauthenticatedBootstrap?: boolean;
76
+ syncMode?: TFollowerSyncMode;
77
+ pollIntervalMs?: number;
78
+ maxSyncLag?: number;
79
+ maxUpstreamStaleMs?: number;
80
+ retentionMode?: TNodeRetentionMode;
81
+ hotWindowEntries?: number;
82
+ hotWindowCheckpoints?: number;
83
+ witnessWallet?: ICheckpointSignerWallet;
84
+ witnessSubmitUrls?: string[];
85
+ /** Optional Standby consensus signer when running a keyed Standby node */
86
+ signer?: ChainNodeSignerConfig;
87
+ /** Optional explicit runtime role (`'follower'` default or `'standby'`) */
88
+ runtimeRole?: 'follower' | 'standby';
89
+ }
90
+ interface HotStuffValidatorRoleConfig {
91
+ kind: 'hotstuff';
92
+ signer: ChainNodeSignerConfig;
93
+ validators: IHotStuffRuntimeValidatorMember[];
94
+ quorumThreshold?: number;
95
+ consensusBindHost: string;
96
+ consensusPort: number;
97
+ allowPublicConsensusBind?: boolean;
98
+ writePolicy?: TNodeWritePolicy;
99
+ allowPrivatePeers?: boolean;
100
+ retentionMode?: TNodeRetentionMode;
101
+ hotWindowEntries?: number;
102
+ hotWindowCheckpoints?: number;
103
+ snapshotBaseUrl?: string | null;
104
+ witnessQuorum?: number;
105
+ trustedWitnesses?: Record<string, string> | string[];
106
+ witnessSubmitUrls?: string[];
107
+ }
108
+ interface ChainAppHookContext {
109
+ nodeId: string;
110
+ dataDir: string;
111
+ role: ChainNodeRoleConfig['kind'];
112
+ config: IChainConfig;
113
+ statedb: SqliteStateDB;
114
+ indexdb: SqliteIndexDB;
115
+ ledger: Ledger;
116
+ resolver: OCAPResolver;
117
+ preferencesManager: NodePreferencesManager;
118
+ maintenanceController: INodeMaintenanceController;
119
+ }
120
+ interface ChainProfileBase {
121
+ /** Optional explicit nodeId (otherwise loaded/persisted in `<dataDir>/.node-id`) */
122
+ nodeId?: string;
123
+ /** Exclusive node data directory (`statedb.sqlite`, `ledger.sqlite`, `indexdb.sqlite`, `trusted.sqlite`, `.node-id`) */
124
+ dataDir: string;
125
+ http: {
126
+ /** Default `'127.0.0.1'`; pass `'0.0.0.0'` explicitly to listen on all interfaces */
127
+ host?: string;
128
+ /** Pass `0` for OS-assigned ephemeral port; `restart()` reuses the bound port automatically */
129
+ port: number;
130
+ corsOrigins?: string | string[] | boolean;
131
+ drainTimeoutMs?: number;
132
+ enableDashboard?: boolean;
133
+ enableExplorer?: boolean;
134
+ explorerDistDir?: string;
135
+ enableAccessLog?: boolean;
136
+ adminEnv?: Record<string, string | undefined>;
137
+ onGraphqlError?: (err: Error & {
138
+ originalError?: Error;
139
+ }) => void;
140
+ };
141
+ storage?: {
142
+ statedbPath?: string;
143
+ ledgerPath?: string;
144
+ indexdbPath?: string;
145
+ trustedPath?: string;
146
+ entryHashV2?: 'auto' | 'activate';
147
+ walAutoCheckpoint?: number;
148
+ indexWalAutoCheckpoint?: number;
149
+ lease?: ILedgerLeaseOptions | false;
150
+ /** Defaults to `role.signer.secretKey` on Validator/HotStuff; Keyless Follower uses `.follower-trusted.key` */
151
+ trustedStorageSecretKey?: string;
152
+ legacyTrustedSecretKeys?: string[];
153
+ trustedRetryLimit?: number;
154
+ trustedAllowLegacySignatures?: boolean;
155
+ };
156
+ checkpoint?: {
157
+ batchSize?: number;
158
+ timeoutMs?: number;
159
+ auto?: boolean;
160
+ periodicTimer?: boolean;
161
+ timerIntervalMs?: number;
162
+ };
163
+ da?: {
164
+ segmentPublisher?: ChainNodeSegmentPublisher | null;
165
+ coldArchiveReader?: IColdSegmentReader | null;
166
+ anchorPublisher?: AnchorPublisher | null;
167
+ env?: Record<string, string | undefined>;
168
+ };
169
+ genesisTime?: string;
170
+ reservedSymbols?: string[];
171
+ blacklist?: {
172
+ dumpPath?: string;
173
+ dumpIntervalMs?: number;
174
+ staticBlockedAddresses?: string[];
175
+ getTrustedAccounts?: () => Promise<TrustedAccountConfig[]> | TrustedAccountConfig[];
176
+ admissionBlockedCheck?: (addr: string) => boolean;
177
+ admissionReservedSymbolCheck?: (sym: string) => boolean;
178
+ };
179
+ txQueue?: {
180
+ maxRequest?: number;
181
+ concurrent?: number;
182
+ timeoutMs?: number;
183
+ };
184
+ maintenance?: {
185
+ pruneIndexDbFn?: (opts: {
186
+ findOnly?: boolean;
187
+ indexdb: SqliteIndexDB;
188
+ statedb: SqliteStateDB;
189
+ }) => Promise<unknown>;
190
+ requireAllowUpdateTokenDistributionEnv?: boolean;
191
+ env?: Record<string, string | undefined>;
192
+ };
193
+ validateTokenConfig?: boolean;
194
+ /**
195
+ * Follower only (#1961): before any replay, compare the consensus config this node replays with against the
196
+ * upstream leader's `getConfig`. Default `off` (no request). `enforce` refuses to start on a difference.
197
+ */
198
+ configCheck?: {
199
+ mode: TChainConfigCheckMode;
200
+ /** Stub upstream for tests; defaults to `getConfig` over `<upstreamChainUrl>/api/gql`. */
201
+ fetchUpstreamConfig?: (upstreamUrl: string) => Promise<unknown>;
202
+ /** `enforce`: how long an unavailable upstream is retried before deciding (default 60 s). */
203
+ retryDeadlineMs?: number;
204
+ };
205
+ /** Follower only (#1961): acceptance guards on replayed ledger entries. Default: none (today's behavior). */
206
+ replayGuards?: {
207
+ /** Refuse (retryably) entries at or after `activationSequence` whose timestamp is ahead of the local clock. */
208
+ futureTimestamp?: FutureTimestampGuardConfig;
209
+ };
210
+ logger?: IPipelineLogger;
211
+ configureApp?: (app: express.Express, ctx: ChainAppHookContext) => void | Promise<void>;
212
+ }
213
+ /**
214
+ * Validator / HotStuff profiles require a complete `chainConfig`; Keyless Follower profiles may omit it
215
+ * and rehydrate `IChainConfig` directly from `statedb.sqlite` after snapshot verification.
216
+ */
217
+ type ChainProfile = (ChainProfileBase & {
218
+ role: ValidatorRoleConfig | HotStuffValidatorRoleConfig;
219
+ chainConfig: IChainConfig;
220
+ }) | (ChainProfileBase & {
221
+ role: FollowerRoleConfig;
222
+ chainConfig?: Partial<IChainConfig>;
223
+ expectedChainId?: string;
224
+ });
225
+ type ChainNodeProfile = ChainProfile;
226
+ interface FollowerUpstreamInterceptorContext {
227
+ kind: TFollowerUpstreamFetchKind;
228
+ url: string;
229
+ init?: RequestInit;
230
+ }
231
+ interface FollowerSyncTestController {
232
+ pause(): void;
233
+ resume(): void;
234
+ isPaused(): boolean;
235
+ triggerSyncOnce(): Promise<void>;
236
+ }
237
+ interface ChainNodeTestHooksInput {
238
+ now?: () => number;
239
+ initialClockOffsetMs?: number;
240
+ initialClockOffsetSeconds?: number;
241
+ checkpoint?: {
242
+ batchSize?: number;
243
+ timeoutMs?: number;
244
+ };
245
+ logger?: IPipelineLogger;
246
+ followerSync?: {
247
+ startPaused?: boolean;
248
+ artificialPollDelayMs?: number;
249
+ interceptUpstreamFetch?: (ctx: FollowerUpstreamInterceptorContext, defaultFetch: typeof fetch) => Promise<Response>;
250
+ onControllerReady?: (ctrl: FollowerSyncTestController) => void;
251
+ };
252
+ hotstuff?: {
253
+ onOutboundConsensusRequest?: HotStuffNodeRuntimeOptions['onOutboundConsensusRequest'];
254
+ /** @deprecated Use `onOutboundConsensusRequest` */
255
+ interceptOutboundRpc?: HotStuffNodeRuntimeOptions['onOutboundConsensusRequest'];
256
+ };
257
+ resolver?: {
258
+ beforeStateDbCommit?: (info: {
259
+ commitHash: string;
260
+ prevHash: string;
261
+ seq: number;
262
+ }) => void | Promise<void>;
263
+ };
264
+ onAfterBoot?: (handles: {
265
+ dataDir: string;
266
+ statedb: SqliteStateDB;
267
+ ledger: Ledger;
268
+ trustedStorage: SqliteTrustedStorage;
269
+ }) => void | Promise<void>;
270
+ }
271
+ interface ChainNodeTestHooks extends ChainNodeTestHooksInput {
272
+ readonly [CHAIN_NODE_TEST_HOOKS_TOKEN]: true;
273
+ }
274
+ interface StartChainNodeOptions {
275
+ profile: ChainProfile;
276
+ testHooks?: ChainNodeTestHooks;
277
+ }
278
+ interface RunningChainNode {
279
+ readonly endpoint: string;
280
+ readonly rpcUrl: string;
281
+ readonly wsUrl: string;
282
+ readonly port: number;
283
+ readonly host: string;
284
+ readonly chainId: string;
285
+ readonly role: ChainNodeRoleConfig['kind'];
286
+ readonly nodeId: string;
287
+ readonly dataDir: string;
288
+ readonly proposerDid: string | null;
289
+ readonly proposerPublicKey: string | null;
290
+ readonly signatureKeyType: 'ed25519' | 'secp256k1' | null;
291
+ readonly app: express.Express;
292
+ readonly resolver: OCAPResolver;
293
+ readonly ledger: Ledger;
294
+ readonly ledgerStorage: SqliteLedgerStorage;
295
+ readonly statedb: SqliteStateDB;
296
+ readonly indexdb: SqliteIndexDB;
297
+ readonly trustedStorage: SqliteTrustedStorage;
298
+ readonly server: http.Server;
299
+ readonly followerSync?: FollowerSyncService;
300
+ readonly hotstuffRuntime?: HotStuffNodeRuntime;
301
+ readonly preferencesManager: NodePreferencesManager;
302
+ readonly maintenanceController: INodeMaintenanceController;
303
+ ledgerHealth(): Promise<ILedgerHealthStatus>;
304
+ advanceClock?(seconds: number): number;
305
+ restart(nextProfile?: Partial<ChainProfile>): Promise<RunningChainNode>;
306
+ stop(): Promise<void>;
307
+ }
308
+ type ChainNodeHandle = RunningChainNode;
309
+ //#endregion
310
+ export { ChainAppHookContext, ChainNodeHandle, ChainNodeProfile, ChainNodeRoleConfig, ChainNodeSegmentPublisher, ChainNodeSignerConfig, ChainNodeTestHooks, ChainNodeTestHooksInput, ChainProfile, ChainProfileBase, FollowerRoleConfig, FollowerSyncTestController, FollowerUpstreamInterceptorContext, HotStuffValidatorRoleConfig, ILedgerHealthStatus, ILedgerLeaseOptions, PublicKeyOnlyValidatorSignerConfig, RunningChainNode, StartChainNodeOptions, TNodeRetentionMode, TrustedAccountConfig, ValidatorRoleConfig, ValidatorSignerConfig };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@ocap/chain-node",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "1.32.1",
7
+ "description": "Unified OCAP chain node runtime assembly (Validator, Standby, Keyless Follower)",
8
+ "type": "module",
9
+ "main": "./lib/index.cjs",
10
+ "module": "./esm/index.mjs",
11
+ "types": "./esm/index.d.mts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./esm/index.d.mts",
15
+ "import": "./esm/index.mjs",
16
+ "default": "./lib/index.cjs"
17
+ },
18
+ "./testing": {
19
+ "types": "./esm/testing.d.mts",
20
+ "import": "./esm/testing.mjs",
21
+ "default": "./lib/testing.cjs"
22
+ },
23
+ "./lib/*.js": {
24
+ "types": "./esm/*.d.mts",
25
+ "import": "./esm/*.mjs",
26
+ "default": "./lib/*.cjs"
27
+ },
28
+ "./lib/*": {
29
+ "types": "./esm/*.d.mts",
30
+ "import": "./esm/*.mjs",
31
+ "default": "./lib/*.cjs"
32
+ }
33
+ },
34
+ "files": [
35
+ "lib",
36
+ "esm"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsdown",
40
+ "prebuild": "rm -rf lib esm",
41
+ "lint": "biome check",
42
+ "lint:fix": "biome check --write",
43
+ "test": "bun test",
44
+ "coverage": "npm run test -- --coverage",
45
+ "clean": "rm -rf lib esm"
46
+ },
47
+ "keywords": [
48
+ "ocap",
49
+ "chain-node",
50
+ "ledger",
51
+ "follower",
52
+ "validator"
53
+ ],
54
+ "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
55
+ "license": "MIT",
56
+ "devDependencies": {
57
+ "@ocap/mcrypto": "1.32.1",
58
+ "@ocap/message": "1.32.1",
59
+ "@types/express": "^4.17.23",
60
+ "@types/node": "^20.10.0",
61
+ "tsdown": "^0.18.4"
62
+ },
63
+ "dependencies": {
64
+ "@arcblock/did": "1.32.1",
65
+ "@arcblock/ledger-core": "1.32.1",
66
+ "@arcblock/ledger-sqlite": "1.32.1",
67
+ "@ocap/config": "1.32.1",
68
+ "@ocap/gql": "1.32.1",
69
+ "@ocap/indexdb-sqlite": "1.32.1",
70
+ "@ocap/resolver": "1.32.1",
71
+ "@ocap/state": "1.32.1",
72
+ "@ocap/statedb-sqlite": "1.32.1",
73
+ "@ocap/trusted-storage": "1.32.1",
74
+ "@ocap/types": "1.32.1",
75
+ "@ocap/util": "1.32.1",
76
+ "@ocap/wallet": "1.32.1",
77
+ "cors": "^2.8.5",
78
+ "express": "^4.22.1"
79
+ }
80
+ }